Skip to content

Commit 9cea411

Browse files
authored
Fix documentation; use hdmf-docutils (#388)
* Fix formatting errors * Use hdmf-docutils and hdmf-common-schema * Link to stable not latest hdmf-common-schema
1 parent 62c7340 commit 9cea411

File tree

8 files changed

+23
-18
lines changed

8 files changed

+23
-18
lines changed

docs/format/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ doctest:
170170
"results in $(BUILDDIR)/doctest/output.txt."
171171

172172
apidoc:
173-
PYTHONPATH=$(CONFDIR):$(PYTHONPATH) nwb_generate_format_docs
173+
PYTHONPATH=$(CONFDIR):$(PYTHONPATH) hdmf_generate_format_docs
174174
@echo
175175
@echo "Generate rst source files from NWB spec."
176176

docs/format/Readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The NWB:N specification documentation uses Sphinx [http://www.sphinx-doc.org/en/
44

55
**Prerequisites**
66

7-
```pip install nwb-docutils```
7+
```pip install hdmf-docutils```
88

99
**Rebuilding All**
1010

@@ -27,7 +27,7 @@ The format documentation is auto-generated from the format specification (YAML/J
2727

2828
```make apidoc```
2929

30-
This will invoke the ``nwb_generate_format_docs`` executable provided by ``nwb-docutils`` package to automatically generate a series of .rst, .png, and .pdf files that are stored in the folder ```source/_format_auto_docs```. The generated .rst files are included in ```source/format.rst``` and the png and pdf files are used as figures in the autogenerated docs. The folder ```source/format_auto_docs``` is reserved for autogenerated files, i.e., files in the folder should not be added or edited by hand as they will be deleted and rebuilt during the full build of the documentation.
30+
This will invoke the ``hdmf_generate_format_docs`` executable provided by ``hdmf-docutils`` package to automatically generate a series of .rst, .png, and .pdf files that are stored in the folder ```source/_format_auto_docs```. The generated .rst files are included in ```source/format.rst``` and the png and pdf files are used as figures in the autogenerated docs. The folder ```source/format_auto_docs``` is reserved for autogenerated files, i.e., files in the folder should not be added or edited by hand as they will be deleted and rebuilt during the full build of the documentation.
3131

3232
By default the Sphinx configuration is setup to always regenerate the sources whenever the docs are being built (see next section). This behavior can be customized via the ```spec_doc_rebuild_always``` parameter in ```source/conf.py```
3333

@@ -85,7 +85,7 @@ Finally, the name and location of output files can be customized as follows:
8585
* ```spec_output_src_filename``` Name of the file where the sources of the format spec go. NOTE: This file is only generated if spec_generate_src_file is enabled
8686
* ```spec_output_doc_type_hierarchy_filename``` Name of the file containing the type hierarchy. (Included in spec_output_doc_filename)
8787

88-
To speed up the build of the format docs we can prevent the ``nwb_generate_format_docs`` executable from regenerating the sources from YAML if the git-hash from the previous build is still current. This is controlled via the following options:
88+
To speed up the build of the format docs we can prevent the ``hdmf_generate_format_docs`` executable from regenerating the sources from YAML if the git-hash from the previous build is still current. This is controlled via the following options:
8989

9090
* ``spec_clean_output_dir_if_old_git_hash`` Clean up the output directory before we generate the source if the git hash is out of date
9191

docs/format/make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ results in %BUILDDIR%/doctest/output.txt.
204204

205205
if "%1" == "apidoc" (
206206
set PYTHONPATH=%cd%/source;%PYTHONPATH%
207-
nwb_generate_format_docs
207+
hdmf_generate_format_docs
208208
if errorlevel 1 exit /b 1
209209
echo.
210210
echo.Generate rst source files from NWB spec.

docs/format/source/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def run_doc_autogen(_):
3131
from conf_doc_autogen import spec_output_dir
3232

3333
if spec_doc_rebuild_always or not os.path.exists(spec_output_dir):
34-
from nwb_docutils.generate_format_docs import main as generate_docs
34+
from hdmf_docutils.generate_format_docs import main as generate_docs
3535
generate_docs()
3636

3737
def setup(app):
@@ -59,7 +59,7 @@ def setup(app):
5959

6060
# Add any Sphinx extension module names here, as strings. They can be extensions
6161
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
62-
extensions = ['sphinx.ext.autodoc']
62+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
6363

6464
# Add any paths that contain templates here, relative to this directory.
6565
templates_path = ['_templates']
@@ -121,6 +121,10 @@ def setup(app):
121121
# A list of ignored prefixes for module index sorting.
122122
#modindex_common_prefix = []
123123

124+
intersphinx_mapping = {
125+
'hdmf-common-schema': ('https://hdmf-common-schema.readthedocs.io/en/stable/', None),
126+
}
127+
124128

125129
# -- Options for HTML output ---------------------------------------------------
126130

docs/format/source/format_description.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ All NWB:N Groups and Datasets with an assigned neurodata_type have three require
211211

212212
- ``neurodata_type`` (variable-length string) is the name of the NWB:N primitive that this group or dataset maps onto
213213
- ``namespace`` (variable-length string) is the namespace where ``neurodata_type`` is defined, e.g. "core" or the
214-
namespace of an extension
214+
namespace of an extension
215215
- ``object_id`` (variable-length string) is a universally unique identifier for this object within its hierarchy.
216-
It should be set to the string representation of a random UUID version 4 value
217-
(see `RFC 4122 <https://tools.ietf.org/html/rfc4122>`_) upon first creation. It is **not** a hash of the data. Files
218-
that contain the exact same data but were generated in different instances will have different ``object_id`` values.
219-
Currently, modification of an object does not require its ``object_id`` to be changed.
216+
It should be set to the string representation of a random UUID version 4 value
217+
(see `RFC 4122 <https://tools.ietf.org/html/rfc4122>`_) upon first creation. It is **not** a hash of the data. Files
218+
that contain the exact same data but were generated in different instances will have different ``object_id`` values.
219+
Currently, modification of an object does not require its ``object_id`` to be changed.
220220

221221

222222

docs/format/source/format_release_notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Release Notes
22
=============
33

44
2.2.0 (January 6, 2020)
5-
----------------
5+
-----------------------
66

77
- Moved common data structures such as Container and DynamicTable to hdmf-common-schema.
88

docs/language/source/specification_language_description.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ and subsequent sections.
6464

6565
.. tip::
6666

67-
The ``nwb-docutils`` package includes tools to generate Sphinx documentation from
68-
format specifications. In particular the executable ``nwb_init_sphinx_extension_doc``
67+
The ``hdmf-docutils`` package includes tools to generate Sphinx documentation from
68+
format specifications. In particular the executable ``hdmf_init_sphinx_extension_doc``
6969
provides functionality to setup documentation for a format or extension defined
7070
by a namespace (similar to the documentation for NWB core namespace at http://nwb-schema.readthedocs.io/en/latest/ ).
71-
Use ``nwb_init_sphinx_extension_doc --help`` to view the list
72-
of options for generating the docs. The package also includes the executable ``nwb_generate_format_docs``
71+
Use ``hdmf_init_sphinx_extension_doc --help`` to view the list
72+
of options for generating the docs. The package also includes the executable ``hdmf_generate_format_docs``
7373
which is used for generating actual reStructuredText files and figures from YAML/JSON
7474
specification sources. For an example see: http://pynwb.readthedocs.io/en/latest/example.html#documenting-extensions
7575

requirements-doc.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
nwb-docutils
1+
hdmf-docutils
2+
pynwb

0 commit comments

Comments
 (0)