From 41cb5114519b8ed175bca56af2e9e673f570ad88 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Sat, 27 Sep 2008 15:55:05 +0000 Subject: switch to sphinx for docs git-svn-id: http://simplejson.googlecode.com/svn/trunk@127 a4795897-2c25-0410-b006-0d3caba88fa1 --- scripts/make_docs.py | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'scripts') 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) -- cgit v1.2.1