Project

General

Profile

« Previous | Next » 

Revision 6833

dict2redmine: Hyperlink each term to its anchor in the data dictionary, rather than to its first source, which is not necessarily the definitive definition of the term. This also allows clicking the term to get its permalink in the address bar, rather than having to click the small, light gray paragraph mark next to the term name that Redmine provides.

View differences:

dict2redmine
111 111
    # Translate input
112 112
    reader = csv.reader(sys.stdin)
113 113
    header = reader.next()
114
    page_name = header[term_col]
114 115
    writer = RedmineDictWriter(term_col, def_col, header, sys.stdout)
115 116
    for row in reader:
116 117
        term = row[term_col]
117 118
        sources = row[sources_col].split(source_sep)
118 119
        
119
        row[term_col] = redmine_url(term, simplify_url(sources[0]))
120
        row[term_col] = redmine_url(term, page_name+'#'+term)
120 121
        row[sources_col] = source_sep.join(map(source2redmine_url, sources))
121 122
        
122 123
        writer.writerow(row)

Also available in: Unified diff