From 0f672ac2117a7fbb252e3779a7a9f45125d8a6d4 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Tue, 15 Mar 2022 02:31:31 +0100 Subject: [PATCH] docs: use autoprogram Signed-off-by: Unai Martinez-Corral --- docs/conf.py | 6 +++--- docs/f4pga/Reference.rst | 6 ++++++ docs/index.rst | 1 + docs/requirements.txt | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 docs/f4pga/Reference.rst diff --git a/docs/conf.py b/docs/conf.py index ea7f8a0..7b66c26 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,15 +20,14 @@ # Updated documentation of the configuration options is available at # https://www.sphinx-doc.org/en/master/usage/configuration.html -import sys, os +from sys import path as sys_path from pathlib import Path from tabulate import tabulate ROOT = Path(__file__).resolve().parent -#sys.path.insert(0, os.path.abspath('.')) -sys.path.insert(0, str(ROOT)) +sys_path.insert(0, str(ROOT)) from changes import generate_changes_inc @@ -69,6 +68,7 @@ release = '' # The full version, including alpha/beta/rc tags. extensions = [ 'sphinx.ext.extlinks', 'sphinx.ext.intersphinx', + "sphinxcontrib.autoprogram", 'sphinx_verilog_domain', 'sphinxcontrib.bibtex', 'myst_parser' diff --git a/docs/f4pga/Reference.rst b/docs/f4pga/Reference.rst new file mode 100644 index 0000000..396f9f7 --- /dev/null +++ b/docs/f4pga/Reference.rst @@ -0,0 +1,6 @@ +Reference +######### + +.. autoprogram:: f4pga.cli:CLI().MainParser + :prog: f4pga + :groups: diff --git a/docs/index.rst b/docs/index.rst index 4ef3e12..16a2a5c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -66,6 +66,7 @@ Table of Contents f4pga/Usage f4pga/modules/index f4pga/DevNotes + f4pga/Reference f4pga/Deprecated diff --git a/docs/requirements.txt b/docs/requirements.txt index 44c25a3..1398ef3 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,8 @@ +-r ../f4pga/requirements.txt myst-parser pyyaml sphinx>=4.5.0 +sphinxcontrib-autoprogram sphinxcontrib-bibtex https://github.com/f4pga/sphinx_f4pga_theme/archive/f4pga.zip#sphinx-f4pga-theme https://github.com/SymbiFlow/sphinx-verilog-domain/archive/master.zip#sphinx-verilog-domain