File tree Expand file tree Collapse file tree 6 files changed +23
-14
lines changed
Expand file tree Collapse file tree 6 files changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ formats: all
1111
1212# Optionally set the version of Python and requirements required to build your docs
1313python :
14- version : 3
14+ version : 3.8
1515 install :
1616 - requirements : doc/requirements.txt
1717 - method : pip
Original file line number Diff line number Diff line change 1- Sphinx >= 3.0
1+ Sphinx >= 6.2.1
22sphinx-rtd-theme
33sphinxcontrib-programoutput
Original file line number Diff line number Diff line change 1414from datetime import datetime
1515from distutils .version import LooseVersion
1616
17+ import jsonschema2md
18+
1719import fusesoc
18- from fusesoc .capi2 .core import gen_doc
20+ from fusesoc .capi2 .json_schema import capi2_schema
21+ from fusesoc .utils import yaml_read
1922
2023# -- Path setup --------------------------------------------------------------
2124
5659 "sphinx.ext.intersphinx" ,
5760 "sphinx.ext.todo" ,
5861 "sphinxcontrib.programoutput" ,
62+ "myst_parser" ,
5963]
6064
6165intersphinx_mapping = {"https://docs.python.org/3" : None }
6771# The suffix(es) of source filenames.
6872# You can specify multiple suffix as a list of string:
6973#
70- # source_suffix = ['.rst', '.md']
71- source_suffix = ".rst"
74+ source_suffix = [".rst" , ".md" ]
7275
7376# The master toctree document.
7477master_doc = "index"
203206
204207# -- Extension configuration -------------------------------------------------
205208
209+ p = jsonschema2md .Parser (
210+ examples_as_yaml = False ,
211+ show_examples = "all" ,
212+ )
213+ md_lines = p .parse_schema (yaml_read (capi2_schema ))
206214
207- s = gen_doc ()
208- with open (os .path .join (os .path .abspath ("." ), "ref/capi2.rst" ), "w" ) as f :
209- f .write (s )
215+ with open (os .path .join (os .path .abspath ("." ), "ref/capi2.md" ), "w" ) as f :
216+ f .write ("" .join (md_lines ))
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ FuseSoC Reference Manual
66 :maxdepth: 2
77 :caption: Contents
88
9- capi2.rst
9+ capi2.md
1010 migrations.rst
1111 glossary.rst
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ def read(fname):
5656 "pyyaml" ,
5757 "simplesat>=0.8.0" ,
5858 "fastjsonschema" ,
59+ "jsonschema2md" ,
60+ "myst_parser" ,
5961 ],
6062 # Supported Python versions: 3.6+
6163 python_requires = ">=3.6, <4" ,
Original file line number Diff line number Diff line change @@ -55,16 +55,16 @@ description = Automatically (re-)build the HTML documentation with Sphinx
5555deps =
5656 -rdoc/requirements.txt
5757 sphinx-autobuild
58+ myst_parser
59+ jsonschema2md
5860commands =
59- # capi2.rst is generated during the documentation build and would
61+ # capi2.md is generated during the documentation build and would
6062 # immediately re-trigger a build. We ignore the generated file, and instead
61- # watch the primary source of information for the generated file. Since
62- # capi2.rst is also produced from some other files this check isn't fully
63- # exhaustive, but covers most use cases.
63+ # watch the primary source of information for the generated file.
6464 sphinx-autobuild \
6565 --open-browser \
6666 -d " {toxworkdir}/docs_doctree" \
67- --ignore " */doc/source/ref/capi2.rst " \
67+ --ignore " */doc/source/ref/capi2.md " \
6868 --watch " fusesoc/capi2" \
6969 doc/source \
7070 " {toxworkdir}/docs_out" \
You can’t perform that action at this time.
0 commit comments