mirror of
https://github.com/axiomatic-systems/Bento4.git
synced 2024-12-04 23:39:34 +00:00
32 lines
787 B
Python
32 lines
787 B
Python
"""Tasks to build the Bento4 documentation"""
|
|
|
|
import os
|
|
import sys
|
|
import shutil
|
|
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)
|