diff options
author | Bob Ippolito <bob@redivi.com> | 2008-09-27 15:55:05 +0000 |
---|---|---|
committer | Bob Ippolito <bob@redivi.com> | 2008-09-27 15:55:05 +0000 |
commit | 41cb5114519b8ed175bca56af2e9e673f570ad88 (patch) | |
tree | c8f1e560c517d7ff94cd38660ccfbcc57d89a9fa /scripts/make_docs.py | |
parent | 0acf8b44f644756d6b874887b251d810f4f500dd (diff) | |
download | simplejson-41cb5114519b8ed175bca56af2e9e673f570ad88.tar.gz |
switch to sphinx for docs
git-svn-id: http://simplejson.googlecode.com/svn/trunk@127 a4795897-2c25-0410-b006-0d3caba88fa1
Diffstat (limited to 'scripts/make_docs.py')
-rwxr-xr-x | scripts/make_docs.py | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/scripts/make_docs.py b/scripts/make_docs.py index 2c59032..d046c1a 100755 --- a/scripts/make_docs.py +++ b/scripts/make_docs.py @@ -3,26 +3,15 @@ import os import subprocess import shutil -PROJECT='simplejson' +SPHINX_BUILD = 'sphinx-build' -def _get_version(): - from pkg_resources import PathMetadata, Distribution - egg_info = PROJECT + '.egg-info' - base_dir = os.path.dirname(egg_info) - metadata = PathMetadata(base_dir, egg_info) - dist_name = os.path.splitext(os.path.basename(egg_info))[0] - dist = Distribution(base_dir, project_name=dist_name, metadata=metadata) - return dist.version -VERSION = _get_version() - -PUDGE = '/Library/Frameworks/Python.framework/Versions/2.4/bin/pudge' -#PUDGE = 'pudge' +DOCTREES_DIR = 'build/doctrees' +HTML_DIR = 'docs' +for dirname in DOCTREES_DIR, HTML_DIR: + if not os.path.exists(dirname): + os.makedirs(dirname) res = subprocess.call([ - PUDGE, '-v', '-d', 'docs', '-m', PROJECT, - '-l', '%s %s' % (PROJECT, VERSION), - '--theme=green' + SPHINX_BUILD, '-d', DOCTREES_DIR, '-b', 'html', '.', 'docs', ]) -if not res: - shutil.copyfile('docs/module-simplejson.html', 'docs/index.html') raise SystemExit(res) |