mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-26 12:35:32 +00:00
Minor fixes to documentation build scripts
This commit is contained in:
parent
9492b9ff03
commit
06045cb4a5
@ -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])
|
||||
|
@ -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:
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user