-
Notifications
You must be signed in to change notification settings - Fork 28
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
ENH: adding sphinx documentation for the dandi-cli #712
Conversation
conf.py got tuned up by black after (git)lena:~/proj/dandi/dandi-cli-master[enh-sphinx]docs $> sphinx-quickstart Welcome to the Sphinx 3.4.3 quickstart utility. Please enter values for the following settings (just press Enter to accept a default value, if one is given in brackets). Selected root path: . You have two options for placing the build directory for Sphinx output. Either, you use a directory "_build" within the root path, or you separate "source" and "build" directories within the root path. > Separate source and build directories (y/n) [n]: y The project name will occur in several places in the built documentation. > Project name: DANDI Archive CLI and Python API library > Author name(s): DANDI Team > Project release []: TODOdandi.__version__ If the documents are to be written in a language other than English, you can select a language here by its language code. Sphinx will then translate text that it generates into that language. For a list of supported codes, see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language. > Project language [en]: Creating file /home/yoh/proj/dandi/dandi-cli-master/docs/source/conf.py. Creating file /home/yoh/proj/dandi/dandi-cli-master/docs/source/index.rst. Creating file /home/yoh/proj/dandi/dandi-cli-master/docs/Makefile. Creating file /home/yoh/proj/dandi/dandi-cli-master/docs/make.bat. Finished: An initial directory structure has been created. You should now populate your master file /home/yoh/proj/dandi/dandi-cli-master/docs/source/index.rst and create other documentation source files. Use the Makefile to build the docs, like so: make builder where "builder" is one of the supported builders, e.g. html, latex or linkcheck.
Codecov Report
@@ Coverage Diff @@
## master #712 +/- ##
==========================================
- Coverage 84.06% 84.02% -0.04%
==========================================
Files 59 59
Lines 5659 5659
==========================================
- Hits 4757 4755 -2
- Misses 902 904 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@yarikoptic Just how much should be done for this PR? Is it OK if largely-placeholder pages are created for each page-worthy item, or should absolutely everything be documented? Something in between? |
I think something in between -- just concentrated on what would be relevant to the user, so they could get a good idea of interfaces they could/should use and what they provide. For the use-cases and example I guess we would just do them in the handbook, and should link to it from this documentation. |
Options | ||
------- | ||
|
||
.. option:: --skip-missing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh -- you just manually produced them? great for now but we should look into making them generated automagically... may be smth like https://github.com/click-contrib/sphinx-click could be used ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like the way the sphinx-click output looks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be there is a way to improve that? I just fear that manually produced docs would quickly become our of sync with actual CLI
tox.ini
Outdated
basepython = python3 | ||
deps = -rdocs/requirements.txt | ||
changedir = docs | ||
commands = sphinx-build -E -b html source build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commands = sphinx-build -E -b html source build | |
commands = sphinx-build -E -W -b html source build |
so warnings are treated as errors? (if so -- please also add to docs/Makefile
SPHINXOPTS) . unfortunately it would then error out upon encountering the first one,
ATM I still observe some warnings to be dealt with
$> python3 `which sphinx-build` -E -W -b html source build
Running Sphinx v3.4.3
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 16 source files that are out of date
updating environment: [new config] 16 added, 0 changed, 0 removed
reading sources... [100%] modref/utils
Warning, treated as error:
/home/yoh/proj/dandi/dandi-cli-master/docs/source/cmdline/organize.rst:41:Unknown directive type "options".
.. options:: -d, --dandiset-path <dir>
A top directory (local) of the dandiset to organize files under. If not
specified, dandiset current directory is under is assumed. For 'simulate'
mode target dandiset/directory must not exist.
(dev3) 1 22202 ->2.....................................:Fri 16 Jul 2021 12:44:05 PM EDT:.
(git)lena:~/proj/dandi/dandi-cli-master[enh-sphinx]docs
$> python3 `which sphinx-build` -E -b html source build
Running Sphinx v3.4.3
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 16 source files that are out of date
updating environment: [new config] 16 added, 0 changed, 0 removed
reading sources... [100%] modref/utils
/home/yoh/proj/dandi/dandi-cli-master/docs/source/cmdline/organize.rst:41: WARNING: Unknown directive type "options".
.. options:: -d, --dandiset-path <dir>
A top directory (local) of the dandiset to organize files under. If not
specified, dandiset current directory is under is assumed. For 'simulate'
mode target dandiset/directory must not exist.
/home/yoh/proj/dandi/dandi-cli-master/dandi/dandiapi.py:docstring of dandi.dandiapi.RemoteDandiset.iter_upload_raw_asset:6: WARNING: Unexpected section title.
Parameters
----------
/home/yoh/proj/dandi/dandi-cli-master/dandi/dandiapi.py:docstring of dandi.dandiapi.RemoteDandiset.iter_upload_raw_asset:17: WARNING: Unexpected section title.
Returns
-------
/home/yoh/proj/dandi/dandi-cli-master/dandi/dandiapi.py:docstring of dandi.dandiapi.RemoteDandiset.upload_raw_asset:6: WARNING: Unexpected section title.
Parameters
----------
/home/yoh/proj/dandi/dandi-cli-master/dandi/dandiarchive.py:docstring of dandi.dandiarchive.navigate_url:4: WARNING: Unexpected section title.
Parameters
----------
/home/yoh/proj/dandi/dandi-cli-master/dandi/dandiarchive.py:docstring of dandi.dandiarchive.navigate_url:9: WARNING: Unexpected section title.
Yields
------
/home/yoh/proj/dandi/dandi-cli-master/dandi/dandiarchive.py:docstring of dandi.dandiarchive._dandi_url_parser.parse:5: WARNING: Unexpected indentation.
/home/yoh/proj/dandi/dandi-cli-master/dandi/dandiarchive.py:docstring of dandi.dandiarchive._dandi_url_parser.parse:16: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/yoh/proj/dandi/dandi-cli-master/dandi/dandiarchive.py:docstring of dandi.dandiarchive._dandi_url_parser.parse:20: WARNING: Unexpected section title.
Returns
-------
/home/yoh/proj/dandi/dandi-cli-master/docs/source/modref/index.rst.rst:44: WARNING: autosummary: stub file not found 'dandi.tests.fixtures'. Check your autosummary_generate setting.
/home/yoh/proj/dandi/dandi-cli-master/docs/source/modref/index.rst.rst:44: WARNING: autosummary: stub file not found 'dandi.tests.skip'. Check your autosummary_generate setting.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] modref/utils
/home/yoh/proj/dandi/dandi-cli-master/docs/source/cmdline/upload.rst:10: WARNING: unknown option: --dandiset-path
generating indices... genindex py-modindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 12 warnings.
The HTML pages are in build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done & fixed.
Great, thank you @jwodder |
No description provided.