Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] auto doc main CLI #463

Merged
merged 8 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![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/)
[![docker pulls](https://img.shields.io/docker/pulls/repronim/neurodocker.svg)](https://hub.docker.com/r/repronim/neurodocker/)
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
[![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",
}

Comment on lines +63 to +86
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are just to add links to the repos on github or docker hub in the navbar and to add an "edit source" link when browsing the doc.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding this. i always appreciate when i'm able to easily browse the source from the documentation.

# 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.