Skip to content
Snippets Groups Projects
Commit 98080d8d authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[scripts] Add script to dump sphinx catalogs

parent 64b607c4
No related branches found
No related tags found
No related merge requests found
Pipeline #25717 failed
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
from sphinx.ext import intersphinx
import click
from . import bdt
from ..log import verbosity_option
@click.command(context_settings=dict(
ignore_unknown_options=True,
allow_extra_args=True,
),
epilog='''
Examples:
1. Dumps objects documented in python 3.x:
$ bdt dumpsphinx https://docs.python.org/3/objects.inv
2. Dumps objects documented in numpy:
$ bdt dumpsphinx https://docs.scipy.org/doc/numpy/objects.inv
3. Dumps objects documented in matplotlib:
$ bdt dumpsphinx http://matplotlib.org/objects.inv
''')
@click.argument('url')
@verbosity_option()
@bdt.raise_on_error
def dumpsphinx(url):
"""Dumps all the objects given an sphinx catalog/inventory URL
This command is useful when you are struggling to do proper links from your
documentation.
"""
intersphinx.inspect_main([url])
......@@ -39,10 +39,10 @@ requirements:
- gitpython
- python-gitlab
- requests
- sphinx
test:
requires:
- sphinx
- sphinx_rtd_theme
imports:
- {{ name }}
......@@ -54,6 +54,7 @@ test:
- bdt changelog --help
- bdt release --help
- bdt visibility --help
- bdt dumpsphinx --help
- sphinx-build -aEW ${PREFIX}/share/doc/{{ name }}/doc {{ project_dir }}/sphinx
about:
......
......@@ -13,6 +13,7 @@ requires = [
'requests',
'gitpython',
'python-gitlab',
'sphinx',
]
setup(
......@@ -42,6 +43,7 @@ setup(
'changelog = bob.devtools.scripts.changelog:changelog',
'lasttag = bob.devtools.scripts.lasttag:lasttag',
'visibility = bob.devtools.scripts.visibility:visibility',
'dumpsphinx = bob.devtools.scripts.dumpsphinx:dumpsphinx',
],
},
classifiers=[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment