Opened at 2013-11-12T16:12:38Z
Closed at 2020-01-20T20:31:48Z
#2102 closed enhancement (fixed)
generate docs with sphinx
Reported by: | zooko | Owned by: | ambimorph |
---|---|---|---|
Priority: | normal | Milestone: | soon (release n/a) |
Component: | documentation | Version: | 1.10.0 |
Keywords: | docs | Cc: | |
Launchpad Bug: |
Description
Sphinx apparently makes docs have nice formatting which looks like software docs style. It also provides cross-referencing (e.g. a table of contents).
Here is an example:
Here is a pull request:
Change History (8)
comment:1 Changed at 2013-11-12T16:26:31Z by zooko
comment:2 Changed at 2013-11-17T21:12:30Z by daira
- Keywords review-needed removed
- Owner changed from marlowe to zooko
It looks like links with filetype .rst should be rewritten to .html. This can probably be done on the source with a sed replacement before running it thorough sphinx.
comment:3 Changed at 2013-11-17T21:19:36Z by daira
Besides that, I really like these docs. They make all the doc files much more discoverable and navigable.
comment:4 Changed at 2013-11-21T22:56:42Z by zooko
Here is an unanswered Stack Overflow question about how to do this: http://stackoverflow.com/questions/16977926/sphinx-restructuredtext-to-html-hyperlink-conversion
comment:5 Changed at 2013-11-29T22:42:42Z by Novacha
What you will want to use is the :doc: directive (At http://sphinx-doc.org/markup/inline.html#role-doc). You will want to replace the following
To use Tahoe-LAFS, please see quickstart.rst_.
With
To use Tahoe-LAFS, please see :doc:`quickstart`
You can also name the link what you want
To use Tahoe-LAFS, please see :doc:`the quickstart guide <quickstart>`
Though you can do this, the files you reference MUST be included in a toctree so that sphinx knows the hierarch of the file. It is not good enough just to reference it like this (and the sphinx builder will throw errors if this is the case). You can create a hidden toctree on the front page to include all these files.
The syntax in the line below is something that I have not seen before, and I do not believe it is a valid way of using labels.
.. _quickstart.rst: quickstart.rst
The solution above with the :doc: directive is the way to go with all the links that are formatted this way. You could also place labels at the top of sections and files (such as putting .. _quickstart: at the top of the quickstart.rst file and referencing it like :ref:`quickstart`). The documentation for this method can be found at http://sphinx-doc.org/markup/inline.html#role-ref
comment:6 Changed at 2014-06-09T18:30:19Z by zooko
comment:7 Changed at 2014-06-09T18:30:30Z by zooko
- Owner changed from zooko to ambimorph
comment:8 Changed at 2020-01-20T20:31:48Z by exarkun
- Resolution set to fixed
- Status changed from new to closed
Pull request was merged some great while ago.
I looked at https://zooko.com/uri/URI%3ADIR2-MDMF-RO%3Afz45kpgz2hhjb7t2xhoscntdqi%3A2lcyvnawrwn7mhnlps5rbw52kybaurrsocktpz7b3s367xrusrnq/index.html . It looks nice! But it has broken links, such as the link on What Is Provider-Independent Security? with anchor text "quickstart.rst", which points to ./quickstart.rst.