diff options
author | blackbird <devnull@localhost> | 2007-01-13 11:03:25 +0100 |
---|---|---|
committer | blackbird <devnull@localhost> | 2007-01-13 11:03:25 +0100 |
commit | dbf655bf5c98148bc60722bdb9107c80a431ae40 (patch) | |
tree | 16b3dcd66729716a9e4b3e8061051c662faa0a53 /docs/generate.py | |
parent | e1cfcf8d31c8c814acb7c72b05289993718bf3f9 (diff) | |
download | pygments-dbf655bf5c98148bc60722bdb9107c80a431ae40.tar.gz |
[svn] added authors and changelog to documentation
Diffstat (limited to 'docs/generate.py')
-rw-r--r-- | docs/generate.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/docs/generate.py b/docs/generate.py index c52677a5..a99a6c78 100644 --- a/docs/generate.py +++ b/docs/generate.py @@ -93,9 +93,37 @@ def generate_filter_docs(): ''' % (cls.__name__, cls.__doc__, name)) return ''.join(out) +def generate_changelog(): + fn = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', + 'CHANGES')) + f = file(fn) + result = [] + in_header = False + header = True + for line in f: + if header: + if not in_header and line.strip(): + in_header = True + elif in_header and not line.strip(): + header = False + else: + result.append(line.rstrip()) + f.close() + return '\n'.join(result) + +def generate_authors(): + fn = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', + 'AUTHORS')) + f = file(fn) + r = f.read().rstrip() + f.close() + return r + LEXERDOCS = generate_lexer_docs() FORMATTERDOCS = generate_formatter_docs() FILTERDOCS = generate_filter_docs() +CHANGELOG = generate_changelog() +AUTHORS = generate_authors() PYGMENTS_FORMATTER = HtmlFormatter(style='pastie', cssclass='syntax') @@ -347,7 +375,9 @@ def generate_documentation(data, link_style): writer = DocumentationWriter(link_style) data = data.replace('[builtin_lexer_docs]', LEXERDOCS).\ replace('[builtin_formatter_docs]', FORMATTERDOCS).\ - replace('[builtin_filter_docs]', FILTERDOCS) + replace('[builtin_filter_docs]', FILTERDOCS).\ + replace('[changelog]', CHANGELOG).\ + replace('[authors]', AUTHORS) parts = publish_parts( data, writer=writer, |