diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2005-07-14 18:08:56 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2005-07-14 18:08:56 +0000 |
| commit | ef739404d33e8ea24f106e386575eaf1128a2d14 (patch) | |
| tree | a9cd6a176e1438a7955355a637d2bc6f78b4a3ff | |
| parent | 8c098891e29985a49a4069349ea56990d9a2c30b (diff) | |
Moved doc building script into django website dir
git-svn-id: http://code.djangoproject.com/svn/django/trunk@27 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rwxr-xr-x | docs/build.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/docs/build.py b/docs/build.py deleted file mode 100755 index 29b5c5add4..0000000000 --- a/docs/build.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python - -""" -Script to build the documentation for Django from ReST -> HTML. -""" - -import os -import sys -import glob -import locale -from docutils.core import publish_parts -from docutils.writers import html4css1 - -SETTINGS = { - 'initial_header_level': 2 -} - -locale.setlocale(locale.LC_ALL, '') - -def build(dirs): - writer = html4css1.Writer() - writer.translator_class = DjangoHTMLTranslator - for dir in dirs: - for fname in glob.glob1(dir, "*.txt"): - in_file = os.path.join(dir, fname) - out_file = os.path.join(dir, os.path.splitext(fname)[0] + ".html") - print "+++", in_file - parts = publish_parts( - open(in_file).read(), - source_path=in_file, - destination_path=out_file, - writer=writer, - settings_overrides={ - 'initial_header_level' : 2, - } - ) - open(out_file, 'w').write(parts['html_body']) - -class DjangoHTMLTranslator(html4css1.HTMLTranslator): - """Remove the damn border=1 from the standard HTML writer""" - def visit_table(self, node): - self.body.append(self.starttag(node, 'table', CLASS='docutils')) - -if __name__ == "__main__": - if len(sys.argv) > 1: - build(sys.argv[1:]) - else: - build([os.getcwd()]) |
