/setup/build_docs.py
http://blogmaker.googlecode.com/ · Python · 31 lines · 24 code · 5 blank · 2 comment · 1 complexity · 9d3383a9bd6f2a5dd6862203e610649b MD5 · raw file
- import os
- from distutils.cmd import Command
- from distutils import log
- from docutils.core import publish_file
- class build_docs(Command):
- description = "build documentation"
- user_options = [
- # ('optname=', None, ""),
- ]
- def initialize_options(self):
- pass
-
- def finalize_options(self):
- pass
-
- def run(self):
- """build end-user documentation."""
- readmeDir = "./release/"
- if not os.path.isdir(readmeDir):
- os.makedirs(readmeDir)
- readmeFile = os.path.join(readmeDir, "README.html")
- body = publish_file(open("./README.txt", 'r'),
- destination=open(readmeFile, 'w'),
- writer_name='html',
- settings_overrides=dict(stylesheet_path='./setup/blogmaker.css',
- strip_comments=True),
- )
- log.info("published docs to: " + readmeFile)