COIN-OR::LEMON - Graph Library

Ticket #184: 184-f92258d6ea47.patch

File 184-f92258d6ea47.patch, 2.6 KB (added by Peter Kovacs, 15 years ago)
  • doc/Makefile.am

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1254495823 -7200
    # Node ID f92258d6ea4739e3e57f526226997991bc82c207
    # Parent  2e1eff023cf357749d9691254d56e308717137ec
    Improve bib2dox.py using \section for entiries (#184)
    
    diff --git a/doc/Makefile.am b/doc/Makefile.am
    a b  
    6969references.dox: doc/references.bib
    7070        if test ${python_found} = yes; then \
    7171          cd doc; \
    72           python $(abs_top_srcdir)/scripts/bib2dox.py $(abs_top_builddir)/$< >$@; \
     72          python @abs_top_srcdir@/scripts/bib2dox.py @abs_top_builddir@/$< >$@; \
    7373          cd ..; \
    7474        else \
    7575          echo; \
  • scripts/bib2dox.py

    diff --git a/scripts/bib2dox.py b/scripts/bib2dox.py
    a b  
    8686
    8787url_rex = re.compile('\\\url\{([^}]*)\}')
    8888
     89#
     90# styles for html formatting
     91#
     92divstyle = 'margin-top: -4ex; margin-left: 8em;'
    8993
    9094#
    9195# return the string parameter without braces
     
    284288            entry = []
    285289            entrytype = pubtype_rex.sub('\g<1>',line)
    286290            entrytype = string.lower(entrytype)
    287             # entryid   = pubtype_rex.sub('\g<2>', line)
     291            entryid   = pubtype_rex.sub('\g<2>', line)
    288292
    289293        # end entry if just a }
    290294        elif endtype_rex.match(line):
     
    379383                bibkey = entrycont['key']
    380384            entry.insert(0, sortkey)
    381385            entry.insert(1, bibkey)
     386            entry.insert(2, entryid)
    382387           
    383388            # add the entry to the file contents
    384389            filecont.append(entry)
     
    439444    for entry in filecont:
    440445        # generate output key form the bibtex key
    441446        bibkey = entry[1]
     447        entryid = entry[2]
    442448        if keytable[bibkey] == 1:
    443449            outkey = bibkey
    444450        else:
     
    446452        counttable[bibkey] += 1
    447453       
    448454        # append the entry code to the output
    449         file.append('<tr valign="top">\n' + \
    450                     '<td>[' + outkey + ']</td>')
    451         file.append('<td>')
    452         file.append('\\anchor ' + outkey)
    453         for line in entry[2:]:
     455        file.append('\\section ' + entryid + ' [' + outkey + ']')
     456        file.append('<div style="' + divstyle + '">')
     457        for line in entry[3:]:
    454458            file.append(line)
    455         file.append('</td>\n</tr>')
     459        file.append('</div>')
    456460        file.append('')
    457461
    458462    return file
     
    780784    print '/**'
    781785    print '\page references References'
    782786    print
    783     print '<table border="0" cellspacing="5px" width="100%">'
    784     print
    785787    for line in outdata:
    786788        print line
    787     print '</table>'
    788     print
    789789    print '*/'
    790790
    791791