diff options
author | Waylan Limberg <waylan@gmail.com> | 2010-08-20 13:13:18 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2010-08-20 13:35:42 -0400 |
commit | f8dbe639cdd3a09df68e6bb67702832c27d0330a (patch) | |
tree | 8f658f31b809cc8ab433de94e8c19cdfafc3ace7 /setup.py | |
parent | bba9fc56c16b09c4f72c2249a52612a8b7b0f15f (diff) | |
download | markdown-f8dbe639cdd3a09df68e6bb67702832c27d0330a.tar.gz markdown-f8dbe639cdd3a09df68e6bb67702832c27d0330a.tar.bz2 markdown-f8dbe639cdd3a09df68e6bb67702832c27d0330a.zip |
Made the build_docs command a subcommand of build in setup script. This still does not install docs on the system. It just writes html to the temp build dir.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -3,6 +3,7 @@ import sys, os from distutils.core import setup from distutils.command.install_scripts import install_scripts +from distutils.command.build import build from distutils.core import Command from distutils.util import change_root, newer @@ -113,7 +114,7 @@ class build_docs(Command): self.mkpath(os.path.split(outfile)[0]) if self.force or newer(doc, outfile): if self.verbose: - print ('Converting %s ---> %s' % (doc, outfile)) + print ('Converting %s -> %s' % (doc, outfile)) if not self.dry_run: outfile = open(outfile, 'w') outfile.write(doc_header % {'title': title}) @@ -121,9 +122,14 @@ class build_docs(Command): md.reset() outfile.write(doc_footer) outfile.close() - else: - if self.verbose: - print ('Skipping... (%s is newer)' % outfile) + + +class md_build(build): + """ Run "build_docs" command from "build" command. """ + def has_docs(self): + return True + + sub_commands = build.sub_commands + [('build_docs', has_docs)] data = dict( @@ -141,7 +147,8 @@ data = dict( scripts = ['bin/%s' % SCRIPT_NAME], cmdclass = {'install_scripts': md_install_scripts, 'build_py': build_py, - 'build_docs': build_docs}, + 'build_docs': build_docs, + 'build': md_build}, classifiers = ['Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', |