diff --git a/.circleci/config.yml b/.circleci/config.yml index 470e0f56..45dcb5ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,7 @@ jobs: - restore_cache: keys: - cache-pip + - run: pip install --user -e . # Install the packages needed to build our documentation # This will depend on your particular package! - run: pip install --user -r docs/doc-requirements.txt diff --git a/Pipfile b/Pipfile index 451eb5e2..054e2aef 100644 --- a/Pipfile +++ b/Pipfile @@ -11,6 +11,7 @@ recommonmark = "*" alabaster = "*" Sphinx = ">=1.4,!=1.5.4" alabaster_jupyterhub = "*" +sphinxcontrib-autoprogram = "*" [packages] repo2docker = {path=".", editable=true} diff --git a/docs/doc-requirements.txt b/docs/doc-requirements.txt index 03f3de16..6fbafab2 100644 --- a/docs/doc-requirements.txt +++ b/docs/doc-requirements.txt @@ -4,3 +4,4 @@ sphinx>=1.4, !=1.5.4 recommonmark alabaster alabaster_jupyterhub +sphinxcontrib-autoprogram diff --git a/docs/source/conf.py b/docs/source/conf.py index 2685d03f..a4f0a86b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -33,7 +33,9 @@ import recommonmark.parser # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx.ext.extlinks'] +extensions = ['sphinx.ext.extlinks', + 'sphinxcontrib.autoprogram', + ] extlinks = { 'issue': ('https://github.com/jupyter/repo2docker/issues/%s', 'Issue #'), diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 2c443d65..658c5d80 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -107,4 +107,12 @@ be used by docker directly. jupyter-repo2docker --no-build --debug https://github.com/norvig/pytudes + +Command line API +================ + +.. autoprogram:: repo2docker.__main__:argparser + :prog: jupyter-repo2docker + + .. _Pytudes: https://github.com/norvig/pytudes diff --git a/repo2docker/__main__.py b/repo2docker/__main__.py index 6c5bd4c6..d0e01d14 100644 --- a/repo2docker/__main__.py +++ b/repo2docker/__main__.py @@ -37,7 +37,9 @@ def validate_image_name(image_name): def get_argparser(): """Get arguments that may be used by repo2docker""" - argparser = argparse.ArgumentParser() + argparser = argparse.ArgumentParser( + description='Fetch a repository and build a container image', + ) argparser.add_argument( '--config', @@ -194,6 +196,8 @@ def get_argparser(): return argparser +argparser = get_argparser() + def make_r2d(argv=None): if argv is None: