Skip to content

Commit

Permalink
Merge pull request #463 from Remi-Gau/autodoc
Browse files Browse the repository at this point in the history
[DOC] auto doc main CLI
  • Loading branch information
Remi-Gau authored Sep 3, 2023
2 parents da4f22c + 5e0a707 commit f1ee11f
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 512 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
- name: Install neurodocker
run: python -m pip install --editable .[docs]
- name: build docs
run: sphinx-build docs docs-build
run: |
make -C docs cli
sphinx-build docs docs-build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![build status](https://github.com/ReproNim/neurodocker/actions/workflows/pull-request.yml/badge.svg)](https://github.com/ReproNim/neurodocker/actions/workflows/pull-request.yml)
[![docker pulls](https://img.shields.io/docker/pulls/repronim/neurodocker.svg)](https://hub.docker.com/r/repronim/neurodocker/)
[![docker pulls](https://img.shields.io/docker/pulls/kaczmarj/neurodocker.svg)](https://hub.docker.com/r/kaczmarj/neurodocker/)
[![python versions](https://img.shields.io/pypi/pyversions/neurodocker.svg)](https://pypi.org/project/neurodocker/)
[![DOI](https://zenodo.org/badge/88654995.svg)](https://zenodo.org/badge/latestdoi/88654995)

Expand Down
5 changes: 4 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ help:

.PHONY: help Makefile

cli:
bash generate_cli_help.sh

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
%: Makefile cli
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
29 changes: 25 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@
"sphinx.ext.githubpages",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
# "sphinx.ext.mathjax",
# "sphinx.ext.ifconfig",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
# "sphinx.ext.linkcode",
"sphinxcontrib.apidoc",
]

Expand All @@ -63,10 +60,34 @@
#
html_theme = "pydata_sphinx_theme"

html_theme_options = {
"use_edit_page_button": True,
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/ReproNim/neurodocker",
"icon": "fa-brands fa-github",
},
{
"name": "Docker Hub",
"url": "https://hub.docker.com/r/repronim/neurodocker",
"icon": "fa-brands fa-docker",
},
],
}


html_context = {
"github_user": "ReproNim",
"github_repo": "neurodocker",
"github_version": "master",
"doc_path": "docs",
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
# html_static_path = ["_static"]

# -- Options for extensions ---------------------------------------------------

Expand Down
11 changes: 11 additions & 0 deletions docs/generate_cli_help.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/bash

# quick and dirty way to make sure the CLI help is up to date

echo "Generating CLI help for Neurodocker and its subcommands..."

neurodocker --help > user_guide/cli_help.txt
neurodocker generate --help > user_guide/generate_cli_help.txt
neurodocker generate docker --help > user_guide/generate_docker_cli_help.txt
neurodocker generate singularity --help > user_guide/generate_singularity_cli_help.txt
neurodocker minify --help > user_guide/minify_cli_help.txt
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ This website is in progress. Is there is something you would like to see here, p
:caption: Contents:

user_guide/index
build_results
api


Expand Down
1 change: 1 addition & 0 deletions docs/user_guide/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.txt
511 changes: 7 additions & 504 deletions docs/user_guide/cli.rst

Large diffs are not rendered by default.

0 comments on commit f1ee11f

Please sign in to comment.