Anonymous avatar Anonymous committed 600e7ab

Make references appear in the web TOC.

Comments (0)

Files changed (2)

it/bibliography.xml

-<bibliography id="bib">
+<bibliography id="chap:bib">
+<?dbhtml filename="riferimenti.html"?>
 <title>Riferimenti</title>
 
 <biblioentry id="bib:quilt" xreflabel="Quilt">

it/web/genindex.py

 
 import glob, os, re
 
-chapter_re = re.compile(r'<(chapter|appendix|preface)\s+id="([^"]+)">')
+chapter_re = re.compile(r'<(chapter|appendix|preface|bibliography)\s+id="([^"]+)">')
 filename_re = re.compile(r'<\?dbhtml filename="([^"]+)"\?>')
 title_re = re.compile(r'<title>(.*)</title>')
 
 chapters = (sorted(glob.glob('../ch*.xml')) +
-            sorted(glob.glob('../app*.xml')))
+            sorted(glob.glob('../app*.xml')) +
+            sorted(glob.glob('../biblio*.xml')))
 
 fp = open('index-read.html.in', 'w', encoding='utf-8')
 
         if m:
             title = m.group(1)
         if filename and title and chapid:
-            if chaptype == 'appendix':
-                num = chr(ord('A') + app)
+            if chaptype == 'bibliography':
+                num = ''
+            elif chaptype == 'appendix':
+                num = str(chr(ord('A') + app)) + '. '
                 app += 1
             else:
-                num = ch
+                num = str(ch) + '. '
                 ch += 1
             if title.find('&') >= 0:
                 title = title.replace('&', '\&')
                 'filename': filename,
                 'title': title,
                 }
-            print('<li class="zebra_%(ab)s"><span class="chapinfo">%(date)s</span>%(num)s. <a href="%(filename)s">%(title)s</a></li>' % args, file=fp)
+            print('<li class="zebra_%(ab)s"><span class="chapinfo">%(date)s</span>%(num)s<a href="%(filename)s">%(title)s</a></li>' % args, file=fp)
             break
 
 print('</ul></div>', file=fp)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.