Skip to content

Commit 8e33bed

Browse files
committed
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
1 parent 91ab799 commit 8e33bed

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

docs/examples/first_app.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,14 @@ Users can access command history using two methods:
284284

285285
- the `readline <https://docs.python.org/3/library/readline.html>`_ library
286286
which provides a python interface to the `GNU readline library
287-
<https://tiswww.case.edu/php/chet/readline/rltop.html>`_
287+
<https://en.wikipedia.org/wiki/GNU_Readline>`_
288288
- the ``history`` command which is built-in to ``cmd2``
289289

290290
From the prompt in a ``cmd2``-based application, you can press ``Control-p`` to
291291
move to the previously entered command, and ``Control-n`` to move to the next
292292
command. You can also search through the command history using ``Control-r``.
293293
The `GNU Readline User Manual
294-
<https://tiswww.case.edu/php/chet/readline/rluserman.html>`_ has all the
294+
<http://man7.org/linux/man-pages/man3/readline.3.html>`_ has all the
295295
details, including all the available commands, and instructions for customizing
296296
the key bindings.
297297

docs/features/completion.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ displayed to help the user.
6060

6161
.. _arg_decorators: https://github.com/python-cmd2/cmd2/blob/master/examples/arg_decorators.py
6262
.. _colors: https://github.com/python-cmd2/cmd2/blob/master/examples/colors.py
63-
.. _tab_autocompletion: https://github.com/python-cmd2/cmd2/blob/master/examples/tab_autocompletion..py
63+
.. _tab_autocompletion: https://github.com/python-cmd2/cmd2/blob/master/examples/tab_autocompletion.py
6464

6565

6666
CompletionItem For Providing Extra Context

docs/features/history.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ You can also search through the command history using ``Control-r``.
2929
Eric Johnson hosts a nice `readline cheat sheet
3030
<http://readline.kablamo.org/emacs.html>`_, or you can dig into the `GNU
3131
Readline User Manual
32-
<https://tiswww.case.edu/php/chet/readline/rluserman.html>`_ for all the
32+
<http://man7.org/linux/man-pages/man3/readline.3.html>`_ for all the
3333
details, including instructions for customizing the key bindings.
3434

3535
``cmd2`` makes a third type of history access available with the ``history``

docs/overview/alternatives.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ argparse_.
1010

1111
.. _sys: https://docs.python.org/3/library/sys.html
1212
.. _argparse: https://docs.python.org/3/library/argparse.html
13-
.. _docopt: https://pypi.python.org/pypi/docopt
14-
.. _click: http://click.pocoo.org
13+
.. _docopt: https://pypi.org/project/docopt
14+
.. _click: https://click.palletsprojects.com
1515

1616

1717
The curses_ module produces applications that interact via a plaintext terminal
@@ -31,7 +31,7 @@ nonetheless. Two of the most mature and full featured are:
3131
* `Python Prompt Toolkit`_
3232
* Click_
3333

34-
.. _`Python Prompt Toolkit`: https://github.com/jonathanslenders/python-prompt-toolkit
34+
.. _`Python Prompt Toolkit`: https://github.com/prompt-toolkit/python-prompt-toolkit
3535

3636
`Python Prompt Toolkit`_ is a library for building powerful interactive command
3737
lines and terminal applications in Python. It provides a lot of advanced

docs/overview/installation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Installation Instructions
33
=========================
44

55

6-
.. _pip: https://pypi.python.org/pypi/pip
7-
.. _setuptools: https://pypi.python.org/pypi/setuptools
8-
.. _PyPI: https://pypi.python.org/pypi
6+
.. _pip: https://pypi.org/project/pip
7+
.. _setuptools: https://pypi.org/project/setuptools
8+
.. _PyPI: https://pypi.org
99

1010
``cmd2`` works on Linux, macOS, and Windows. It requires Python 3.5 or
1111
higher, pip_, and setuptools_. If you've got all that, then you can just:
@@ -129,7 +129,7 @@ environment on a Mac, detailed in the following subsections.
129129
gnureadline Python module
130130
~~~~~~~~~~~~~~~~~~~~~~~~~
131131

132-
Install the `gnureadline <https://pypi.python.org/pypi/gnureadline>`_ Python module which is statically linked against a specific compatible version of GNU Readline:
132+
Install the `gnureadline <https://pypi.org/project/gnureadline>`_ Python module which is statically linked against a specific compatible version of GNU Readline:
133133

134134
.. code-block:: shell
135135

tasks.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def rmrf(items, verbose=True):
4545
@invoke.task
4646
def pytest(context):
4747
"Run tests and code coverage using pytest"
48-
context.run("pytest --cov=cmd2 --cov-report=term --cov-report=html")
48+
context.run("pytest --cov=cmd2 --cov-report=term --cov-report=html", pty=True)
4949
namespace.add_task(pytest)
5050

5151
@invoke.task
@@ -98,7 +98,7 @@ def tox_clean(context):
9898
def docs(context, builder='html'):
9999
"Build documentation using sphinx"
100100
cmdline = 'python -msphinx -M {} {} {} {}'.format(builder, DOCS_SRCDIR, DOCS_BUILDDIR, SPHINX_OPTS)
101-
context.run(cmdline)
101+
context.run(cmdline, pty=True)
102102
namespace.add_task(docs)
103103

104104
@invoke.task()
@@ -114,6 +114,12 @@ def docs_clean(context):
114114
rmrf(DOCS_BUILDDIR)
115115
namespace_clean.add_task(docs_clean, name='docs')
116116

117+
@invoke.task()
118+
def linkcheck(context):
119+
"""Check external links in Sphinx documentation for integrity."""
120+
context.run('cd docs && make linkcheck', pty=True)
121+
namespace.add_task(linkcheck)
122+
117123
@invoke.task
118124
def livehtml(context):
119125
"Launch webserver on http://localhost:8000 with rendered documentation"

0 commit comments

Comments
 (0)