Handle url fields in bib2dox.py (#184)
authorPeter Kovacs <kpeter@inf.elte.hu>
Sat, 10 Oct 2009 08:15:07 +0200
changeset 7542de0fc630899
parent 750 b7e3662faf02
child 755 134852d7fb0a
Handle url fields in bib2dox.py (#184)
and modify the bibtex file using url fields.
doc/references.bib
scripts/bib2dox.py
     1.1 --- a/doc/references.bib	Mon Oct 05 20:21:54 2009 +0200
     1.2 +++ b/doc/references.bib	Sat Oct 10 08:15:07 2009 +0200
     1.3 @@ -12,16 +12,14 @@
     1.4    key =          {EGRES},
     1.5    title =        {{EGRES} -- {E}gerv{\'a}ry {R}esearch {G}roup on
     1.6                    {C}ombinatorial {O}ptimization},
     1.7 -  howpublished = {\url{http://www.cs.elte.hu/egres/}},
     1.8 -  year =         2009
     1.9 +  url =          {http://www.cs.elte.hu/egres/}
    1.10  }
    1.11  
    1.12  @misc{coinor,
    1.13    key =          {COIN-OR},
    1.14    title =        {{COIN-OR} -- {C}omputational {I}nfrastructure for
    1.15                    {O}perations {R}esearch},
    1.16 -  howpublished = {\url{http://www.coin-or.org/}},
    1.17 -  year =         2009
    1.18 +  url =          {http://www.coin-or.org/}
    1.19  }
    1.20  
    1.21  
    1.22 @@ -30,8 +28,7 @@
    1.23  @misc{boost,
    1.24    key =          {Boost},
    1.25    title =        {{B}oost {C++} {L}ibraries},
    1.26 -  howpublished = {\url{http://www.boost.org/}},
    1.27 -  year =         2009
    1.28 +  url =          {http://www.boost.org/}
    1.29  }
    1.30  
    1.31  @book{bglbook,
    1.32 @@ -47,8 +44,7 @@
    1.33    key =          {LEDA},
    1.34    title =        {{LEDA} -- {L}ibrary of {E}fficient {D}ata {T}ypes and
    1.35                    {A}lgorithms},
    1.36 -  howpublished = {\url{http://www.algorithmic-solutions.com/}},
    1.37 -  year =         2009
    1.38 +  url =          {http://www.algorithmic-solutions.com/}
    1.39  }
    1.40  
    1.41  @book{ledabook,
    1.42 @@ -67,16 +63,14 @@
    1.43  @misc{cmake,
    1.44    key =          {CMake},
    1.45    title =        {{CMake} -- {C}ross {P}latform {M}ake},
    1.46 -  howpublished = {\url{http://www.cmake.org/}},
    1.47 -  year =         2009
    1.48 +  url =          {http://www.cmake.org/}
    1.49  }
    1.50  
    1.51  @misc{doxygen,
    1.52    key =          {Doxygen},
    1.53    title =        {{Doxygen} -- {S}ource code documentation generator
    1.54                    tool},
    1.55 -  howpublished = {\url{http://www.doxygen.org/}},
    1.56 -  year =         2009
    1.57 +  url =          {http://www.doxygen.org/}
    1.58  }
    1.59  
    1.60  
    1.61 @@ -85,37 +79,32 @@
    1.62  @misc{glpk,
    1.63    key =          {GLPK},
    1.64    title =        {{GLPK} -- {GNU} {L}inear {P}rogramming {K}it},
    1.65 -  howpublished = {\url{http://www.gnu.org/software/glpk/}},
    1.66 -  year =         2009
    1.67 +  url =          {http://www.gnu.org/software/glpk/}
    1.68  }
    1.69  
    1.70  @misc{clp,
    1.71    key =          {Clp},
    1.72    title =        {{Clp} -- {Coin-Or} {L}inear {P}rogramming},
    1.73 -  howpublished = {\url{http://projects.coin-or.org/Clp/}},
    1.74 -  year =         2009
    1.75 +  url =          {http://projects.coin-or.org/Clp/}
    1.76  }
    1.77  
    1.78  @misc{cbc,
    1.79    key =          {Cbc},
    1.80    title =        {{Cbc} -- {Coin-Or} {B}ranch and {C}ut},
    1.81 -  howpublished = {\url{http://projects.coin-or.org/Cbc/}},
    1.82 -  year =         2009
    1.83 +  url =          {http://projects.coin-or.org/Cbc/}
    1.84  }
    1.85  
    1.86  @misc{cplex,
    1.87    key =          {CPLEX},
    1.88    title =        {{ILOG} {CPLEX}},
    1.89 -  howpublished = {\url{http://www.ilog.com/}},
    1.90 -  year =         2009
    1.91 +  url =          {http://www.ilog.com/}
    1.92  }
    1.93  
    1.94  @misc{soplex,
    1.95    key =          {SoPlex},
    1.96    title =        {{SoPlex} -- {T}he {S}equential {O}bject-{O}riented
    1.97                    {S}implex},
    1.98 -  howpublished = {\url{http://soplex.zib.de/}},
    1.99 -  year =         2009
   1.100 +  url =          {http://soplex.zib.de/}
   1.101  }
   1.102  
   1.103  
     2.1 --- a/scripts/bib2dox.py	Mon Oct 05 20:21:54 2009 +0200
     2.2 +++ b/scripts/bib2dox.py	Sat Oct 10 08:15:07 2009 +0200
     2.3 @@ -70,7 +70,7 @@
     2.4  #
     2.5  author_rex = re.compile('\s+and\s+')
     2.6  rembraces_rex = re.compile('[{}]')
     2.7 -capitalize_rex = re.compile('({\w*})')
     2.8 +capitalize_rex = re.compile('({[^}]*})')
     2.9  
    2.10  # used by bibtexkeywords(data)
    2.11  keywords_rex = re.compile('[,;]')
    2.12 @@ -363,6 +363,8 @@
    2.13                      entry.append(entrycont['year'] + '.')
    2.14              if entrycont.has_key('note') and (entrycont['note'] != ''):
    2.15                  entry.append(entrycont['note'] + '.')
    2.16 +            if entrycont.has_key('url') and (entrycont['url'] != ''):
    2.17 +                entry.append(entrycont['url'] + '.')
    2.18  
    2.19              # generate keys for sorting and for the output
    2.20              sortkey = ''
    2.21 @@ -410,6 +412,9 @@
    2.22                  field = field_rex.sub('\g<1>', line)
    2.23                  field = string.lower(field)
    2.24                  data =  data_rex.sub('\g<2>', line)
    2.25 +
    2.26 +            if field == 'url':
    2.27 +                data = '\\url{' + data.strip() + '}'
    2.28              
    2.29              if field in ('author', 'editor'):
    2.30                  entrycont[field] = bibtexauthor(data)