diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-01-26 12:57:57 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-01-26 12:57:57 -0500 |
commit | 8e33bed3f57c7667e132148af76fe646d837e232 (patch) | |
tree | acab882c27707818b644d1d5c778436d9131c2c0 /tasks.py | |
parent | 91ab799f293f0789bbb2759aaabc13c00da36b03 (diff) | |
download | cmd2-git-8e33bed3f57c7667e132148af76fe646d837e232.tar.gz |
Fixed broken links in Sphinx docs
Also:
- Added a "linkcheck" task to the invoke tasks
_ Use pseudoterminals for invoke tasks with colored output so that we can see the color when using invoke
Diffstat (limited to 'tasks.py')
-rw-r--r-- | tasks.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -45,7 +45,7 @@ namespace.add_collection(namespace_clean, 'clean') @invoke.task def pytest(context): "Run tests and code coverage using pytest" - context.run("pytest --cov=cmd2 --cov-report=term --cov-report=html") + context.run("pytest --cov=cmd2 --cov-report=term --cov-report=html", pty=True) namespace.add_task(pytest) @invoke.task @@ -98,7 +98,7 @@ SPHINX_OPTS = '-nvWT' # Be nitpicky, verbose, and treat warnings as errors def docs(context, builder='html'): "Build documentation using sphinx" cmdline = 'python -msphinx -M {} {} {} {}'.format(builder, DOCS_SRCDIR, DOCS_BUILDDIR, SPHINX_OPTS) - context.run(cmdline) + context.run(cmdline, pty=True) namespace.add_task(docs) @invoke.task() @@ -114,6 +114,12 @@ def docs_clean(context): rmrf(DOCS_BUILDDIR) namespace_clean.add_task(docs_clean, name='docs') +@invoke.task() +def linkcheck(context): + """Check external links in Sphinx documentation for integrity.""" + context.run('cd docs && make linkcheck', pty=True) +namespace.add_task(linkcheck) + @invoke.task def livehtml(context): "Launch webserver on http://localhost:8000 with rendered documentation" |