mirror of
https://github.com/axiomatic-systems/Bento4.git
synced 2024-12-04 07:19:17 +00:00
30 lines
762 B
Python
30 lines
762 B
Python
"""Tasks to build the Bento4 documentation"""
|
|
|
|
import os
|
|
from invoke import task, Collection
|
|
|
|
@task(default=True)
|
|
def mkdocs_build(ctx):
|
|
'''Generate the Bento4 documentation using MkDocs'''
|
|
|
|
# Build the HTML docs
|
|
mkdocs_dir = os.path.join(ctx.C.DOC_DIR, 'MkDocs')
|
|
with ctx.cd(mkdocs_dir):
|
|
ctx.run("mkdocs build")
|
|
|
|
print("HTML docs built, you can now open {}/site/index.html".format(mkdocs_dir))
|
|
|
|
@task
|
|
def mkdocs_serve(ctx):
|
|
'''Start a local mkdocs server'''
|
|
mkdocs_dir = os.path.join(ctx.C.DOC_DIR, 'MkDocs')
|
|
with ctx.cd(mkdocs_dir):
|
|
ctx.run("mkdocs serve")
|
|
|
|
mkdocs = Collection('mkdocs')
|
|
mkdocs.add_task(mkdocs_build, 'build')
|
|
mkdocs.add_task(mkdocs_serve, 'serve')
|
|
|
|
# Export a namespace
|
|
ns = Collection(mkdocs)
|