From 06045cb4a52b916d2dca5f48f74bac22800c7a77 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 2 Jun 2016 06:52:07 -0700 Subject: [PATCH] Minor fixes to documentation build scripts --- doc/build.py | 2 +- support/release.py | 2 +- support/update-website.py | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/build.py b/doc/build.py index 3e988c92..d3da88f4 100755 --- a/doc/build.py +++ b/doc/build.py @@ -94,7 +94,7 @@ def build_docs(version='dev', **kwargs): html_dir = os.path.join(work_dir, 'html') versions = [v for v in ['3.0.0', '2.0.0', '1.1.0'] if v != version] check_call(['sphinx-build', - '-Dbreathe_projects.format=' + doxyxml_dir, + '-Dbreathe_projects.format=' + os.path.abspath(doxyxml_dir), '-Dversion=' + version, '-Drelease=' + version, '-Aversion=' + version, '-Aversions=' + ','.join(versions), '-b', 'html', doc_dir, html_dir]) diff --git a/support/release.py b/support/release.py index f6e30129..e89fe806 100755 --- a/support/release.py +++ b/support/release.py @@ -186,7 +186,7 @@ if __name__ == '__main__': r = requests.post('https://api.github.com/repos/fmtlib/fmt/releases', params={'access_token': os.getenv('FMT_TOKEN')}, data=json.dumps({'tag_name': version, 'target_commitish': 'release', - 'body': changes, 'draft': True})) + 'body': changes, 'draft': True})) if r.status_code != 201: raise Exception('Failed to create a release ' + str(r)) finally: diff --git a/support/update-website.py b/support/update-website.py index 4683be30..69553065 100755 --- a/support/update-website.py +++ b/support/update-website.py @@ -34,15 +34,15 @@ fmt_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.join(fmt_dir, 'doc')) import build -work_dir = 'build' +build_dir = 'build' # Virtualenv and repos are cached to speed up builds. -build.create_build_env(os.path.join(work_dir, 'virtualenv')) +build.create_build_env(os.path.join(build_dir, 'virtualenv')) -fmt_repo = Git(os.path.join(work_dir, 'fmt')) +fmt_repo = Git(os.path.join(build_dir, 'fmt')) fmt_repo.update('git@github.com:fmtlib/fmt') -doc_repo = Git(os.path.join(work_dir, 'fmtlib.github.io')) +doc_repo = Git(os.path.join(build_dir, 'fmtlib.github.io')) doc_repo.update('git@github.com:fmtlib/fmtlib.github.io') for version in ['1.0.0']:#, '1.1.0', '2.0.0', '3.0.0']: @@ -57,7 +57,7 @@ for version in ['1.0.0']:#, '1.1.0', '2.0.0', '3.0.0']: shutil.rmtree(path) # Copy the new theme. for entry in ['_static', '_templates', 'basic-bootstrap', 'bootstrap', - 'conf.py', 'fmt.less']: + 'conf.py', 'fmt.less']: src = os.path.join(fmt_dir, 'doc', entry) dst = os.path.join(target_doc_dir, entry) copy = shutil.copytree if os.path.isdir(src) else shutil.copyfile @@ -74,12 +74,12 @@ for version in ['1.0.0']:#, '1.1.0', '2.0.0', '3.0.0']: data = f.read() data = data.replace('std::ostream &', 'std::ostream&') data = re.sub(r'doxygenfunction.. (bin|oct|hexu|hex)', - r'doxygenfunction:: \1(int)', data) + r'doxygenfunction:: \1(int)', data) with open(reference, 'w') as f: f.write(data) # Build the docs. html_dir = build.build_docs(version, doc_dir=target_doc_dir, - include_dir=fmt_repo.dir, work_dir=work_dir) + include_dir=fmt_repo.dir, work_dir=build_dir) # Create symlinks for older versions. for link, target in {'index': 'contents', 'api': 'reference'}.items(): os.symlink(target + '.html', os.path.join(html_dir, link) + '.html')