Skip to content

Commit d19ccad

Browse files
committed
Elaborate on input formats
1 parent ea4cea5 commit d19ccad

4 files changed

Lines changed: 39 additions & 6 deletions

File tree

README.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ doc2dash: Create docsets for Dash.app and clones
1919
``doc2dash`` is an MIT-licensed extensible `Documentation Set`_ generator intended to be used with the `Dash.app`_ API browser for OS X or one of its many clones.
2020

2121
If you’ve never heard of Dash.app, you’re missing out:
22-
Together with ``doc2dash`` it’s all your API documentation at your fingertips!
22+
together with ``doc2dash`` it’s all your API documentation at your fingertips!
2323

24-
``doc2dash``\ ’s documentation lives at `Read the Docs <http://doc2dash.readthedocs.org/>`_, the code on `GitHub <https://github.com/hynek/doc2dash>`_.
24+
``doc2dash``\ ’s documentation lives at `Read the Docs`_, the code on GitHub_.
2525
It’s tested on Python 2.7, 3.3+, and PyPy.
2626
Both Linux and OS X are supported although certain features are only available on OS X.
2727

2828

2929
.. _`Documentation Set`: https://developer.apple.com/legacy/library/documentation/DeveloperTools/Conceptual/Documentation_Sets/010-Overview_of_Documentation_Sets/docset_overview.html#//apple_ref/doc/uid/TP40005266-CH13-SW6
3030
.. _`Dash.app`: http://kapeli.com/dash/
31+
.. _`Read the Docs`: <http://doc2dash.readthedocs.org/>
32+
.. _`GitHub`: https://github.com/hynek/doc2dash

docs/formats.rst

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,43 @@
11
Supported Input Formats
22
=======================
33

4-
Currently, the following input formats are supported:
4+
Currently, ``doc2dash`` supports two documentation formats:
55

6-
- Sphinx_’s HTML output (nearly every single Python project out there)
7-
- pydoctor_’s HTML output (Twisted_!)
6+
- :ref:`Sphinx-sec`
7+
- :ref:`pydoctor-sec`
88

99
Feel free to help adding more! While ``doc2dash`` is implemented in Python, the scope for the supported documentation types is unlimited.
1010
So go on and submit a parser for your favourite Ruby, Haskell, Lisp, Erlang, JavaScript, … format!
1111

1212

13+
.. _Sphinx-sec:
14+
15+
Sphinx
16+
------
17+
18+
Sphinx_ is a very common documentation format in the Python world and beyond.
19+
20+
``doc2dash`` offers two approaches to parsing it.
21+
The preferable one is used whenever a machine-readable intersphinx_ index file is present and it results in very precise and reliable parsing.
22+
23+
If none is found, ``doc2dash`` attempts to parse the HTML API index file (``genindex.html`` or ``genindex-all.html``).
24+
Simply point ``doc2dash`` at Sphinx's HTML output (usually ``_build/html`` if you built it yourself) and it will do the right thing.
25+
26+
27+
.. _pydoctor-sec:
28+
29+
pydoctor
30+
--------
31+
32+
Contrary to Sphinx, pydoctor_ is not a complete documentation format.
33+
Instead, it's focused on creating API documentation from Python docstrings.
34+
The most popular project employing is Twisted_ and its ecosystem.
35+
36+
Since pydoctor alas does not emit a machine-readable file, the ``nameIndex.html`` is always parsed.
37+
Fortunately, no theming is common in the pydoctor world, so the parsing is reliable nonetheless.
38+
39+
1340
.. _Twisted: https://twistedmatrix.com/
1441
.. _pydoctor: https://launchpad.net/pydoctor
1542
.. _Sphinx: http://sphinx-doc.org/
43+
.. _intersphinx: http://sphinx-doc.org/latest/ext/intersphinx.html

docs/installation.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Of course, you can also install it as usual using pip_::
1212
``doc2dash`` runs on Python 2.7, and 3.3+, and PyPy.
1313
Both Linux and OS X are supported although certain features are only available on OS X.
1414

15+
.. note::
16+
17+
For best performance when converting large pieces documentation, I *strongly* recommend using PyPy as the interpreter of choice.
18+
1519

1620
.. _clones:
1721

docs/usage.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ Hints
3737
For Sphinx, you get the best results using the intersphinx_ parser that is used automatically if a version 2 ``objects.inv`` file is present.
3838
This approach obviates parsing problems completely by using that machine readable file using Sphinx’s own APIs.
3939

40-
.. _intersphinx: http://sphinx-doc.org/latest/ext/intersphinx.html
4140
.. _SQLite: http://www.sqlite.org/

0 commit comments

Comments
 (0)