1.1 --- a/convert.py Thu Dec 20 00:30:55 2012 +0100
1.2 +++ b/convert.py Thu Dec 20 00:49:03 2012 +0100
1.3 @@ -268,7 +268,7 @@
1.4 # In the page directory for each comment, write the page title in a
1.5 # special file for later processing.
1.6
1.7 - write(join(pages_dir, commentid, "pagetitle"), "%s/%s" % (title, position))
1.8 + write(join(pages_dir, commentid, "pagetitle"), "%s/%04d" % (title, position))
1.9
1.10 def sort_manifest(pages_dir, pageid, output=None):
1.11
1.12 @@ -294,6 +294,7 @@
1.13 manifest = join(pages_dir, pageid, "manifest")
1.14 pagetitle = join(pages_dir, pageid, "pagetitle")
1.15 children = join(pages_dir, pageid, "children")
1.16 + comments = join(pages_dir, pageid, "comments")
1.17
1.18 if exists(pagetitle):
1.19 title = read(pagetitle)
1.20 @@ -336,6 +337,11 @@
1.21
1.22 append(filename, child_page_section % "\n".join(child_pages))
1.23
1.24 + # Add comments to the content.
1.25 +
1.26 + if exists(comments) and title:
1.27 + append(filename, comment_section % title)
1.28 +
1.29 finally:
1.30 f.close()
1.31
1.32 @@ -354,6 +360,14 @@
1.33 %s
1.34 """
1.35
1.36 +# Template for comments.
1.37 +
1.38 +comment_section = """
1.39 +----
1.40 +
1.41 +<<Include("^%s/")>>
1.42 +"""
1.43 +
1.44 # Main program.
1.45
1.46 if __name__ == "__main__":