summaryrefslogtreecommitdiff
path: root/doc/build/genhtml.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/build/genhtml.py')
-rw-r--r--doc/build/genhtml.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/doc/build/genhtml.py b/doc/build/genhtml.py
index 3cb1f7b2c..ddc2e8a92 100644
--- a/doc/build/genhtml.py
+++ b/doc/build/genhtml.py
@@ -24,9 +24,13 @@ files = [
'types',
'pooling',
'plugins',
- 'docstrings'
+ 'docstrings',
]
+post_files = [
+ 'copyright'
+]
+
parser = optparse.OptionParser(usage = "usage: %prog [options] [tests...]")
parser.add_option("--file", action="store", dest="file", help="only generate file <file>")
parser.add_option("--docstrings", action="store_true", dest="docstrings", help="only generate docstrings")
@@ -34,9 +38,11 @@ parser.add_option("--version", action="store", dest="version", default=sqlalchem
(options, args) = parser.parse_args()
if options.file:
- files = [options.file]
+ to_gen = [options.file]
+else:
+ to_gen = files + post_files
-title='SQLAlchemy 0.3 Documentation'
+title='SQLAlchemy 0.4 Documentation'
version = options.version
root = toc.TOCElement('', 'root', '', version=version, doctitle=title)
@@ -46,7 +52,7 @@ shutil.copy('./content/docstrings.html', './output/docstrings.html')
shutil.copy('./content/documentation.html', './output/documentation.html')
if not options.docstrings:
- read_markdown.parse_markdown_files(root, files)
+ read_markdown.parse_markdown_files(root, [f for f in files if f in to_gen])
if not options.file or options.docstrings:
docstrings = gen_docstrings.make_all_docs()
@@ -54,8 +60,12 @@ if not options.file or options.docstrings:
pickle.dump(docstrings, file('./output/compiled_docstrings.pickle', 'w'))
- pickle.dump(root, file('./output/table_of_contents.pickle', 'w'))
+if not options.docstrings:
+ read_markdown.parse_markdown_files(root, [f for f in post_files if f in to_gen])
+if not options.file or options.docstrings:
+ pickle.dump(root, file('./output/table_of_contents.pickle', 'w'))
+
template_dirs = ['./templates', './output']
output = os.path.dirname(os.getcwd())
@@ -69,7 +79,7 @@ def genfile(name, outname):
outfile.write(t.render(attributes={}))
if not options.docstrings:
- for filename in files:
+ for filename in to_gen:
try:
genfile(filename, os.path.join(os.getcwd(), '../', filename + ".html"))
except: