hgbook

changeset 860:600e7ab15c67

Make references appear in the web TOC.
author gpiancastelli
date Sun Aug 23 01:14:14 2009 +0200 (2009-08-23)
parents 84629ae2c99d
children 39342fe9ba5b
files it/bibliography.xml it/web/genindex.py
line diff
     1.1 --- a/it/bibliography.xml	Sun Aug 23 00:51:45 2009 +0200
     1.2 +++ b/it/bibliography.xml	Sun Aug 23 01:14:14 2009 +0200
     1.3 @@ -1,4 +1,5 @@
     1.4 -<bibliography id="bib">
     1.5 +<bibliography id="chap:bib">
     1.6 +<?dbhtml filename="riferimenti.html"?>
     1.7  <title>Riferimenti</title>
     1.8  
     1.9  <biblioentry id="bib:quilt" xreflabel="Quilt">
     2.1 --- a/it/web/genindex.py	Sun Aug 23 00:51:45 2009 +0200
     2.2 +++ b/it/web/genindex.py	Sun Aug 23 01:14:14 2009 +0200
     2.3 @@ -2,12 +2,13 @@
     2.4  
     2.5  import glob, os, re
     2.6  
     2.7 -chapter_re = re.compile(r'<(chapter|appendix|preface)\s+id="([^"]+)">')
     2.8 +chapter_re = re.compile(r'<(chapter|appendix|preface|bibliography)\s+id="([^"]+)">')
     2.9  filename_re = re.compile(r'<\?dbhtml filename="([^"]+)"\?>')
    2.10  title_re = re.compile(r'<title>(.*)</title>')
    2.11  
    2.12  chapters = (sorted(glob.glob('../ch*.xml')) +
    2.13 -            sorted(glob.glob('../app*.xml')))
    2.14 +            sorted(glob.glob('../app*.xml')) +
    2.15 +            sorted(glob.glob('../biblio*.xml')))
    2.16  
    2.17  fp = open('index-read.html.in', 'w', encoding='utf-8')
    2.18  
    2.19 @@ -34,11 +35,13 @@
    2.20          if m:
    2.21              title = m.group(1)
    2.22          if filename and title and chapid:
    2.23 -            if chaptype == 'appendix':
    2.24 -                num = chr(ord('A') + app)
    2.25 +            if chaptype == 'bibliography':
    2.26 +                num = ''
    2.27 +            elif chaptype == 'appendix':
    2.28 +                num = str(chr(ord('A') + app)) + '. '
    2.29                  app += 1
    2.30              else:
    2.31 -                num = ch
    2.32 +                num = str(ch) + '. '
    2.33                  ch += 1
    2.34              if title.find('&') >= 0:
    2.35                  title = title.replace('&', '\&')
    2.36 @@ -52,7 +55,7 @@
    2.37                  'filename': filename,
    2.38                  'title': title,
    2.39                  }
    2.40 -            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)
    2.41 +            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)
    2.42              break
    2.43  
    2.44  print('</ul></div>', file=fp)