1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
"""Documentation Tasks"""
from fabric.api import lcd, local, task
from .utils import pip, requires
PACKAGE = 'circuits'
@task()
def api():
"""Generate the API Documentation"""
if PACKAGE is not None:
pip(requirements='docs/requirements.txt')
local(f'sphinx-apidoc -f -e -T -o docs/source/api {PACKAGE:s}')
@task()
@requires('make')
def clean():
"""Delete Generated Documentation"""
with lcd('docs'):
pip(requirements='requirements.txt')
local('make clean')
@task(default=True)
@requires('make')
def build(**options):
"""Build the Documentation"""
pip(requirements='docs/requirements.txt')
with lcd('docs'):
local('make html')
@task()
@requires('open')
def view(**options):
"""View the Documentation"""
with lcd('docs'):
import webbrowser
webbrowser.open_new_tab('build/html/index.html')
|