According to recommonmark's documentation the enable_auto_doc_ref is deprecated. This is not true, as it's broken with Sphinx 1.6+ commit 12d639873953847de31ec99742b42e50e89ed58c. recommonmark bug report is here: https://github.com/rtfd/recommonmark/issues/73 Instead of using this feature, which doesn't support top level directories in the relative document path anyway, use the TOC tree or inline RST code. Disable auto_doc_ref and document how to reference documents. Change-Id: I9319985b504c4215c33ebbeb9c38317b9efcb283 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/28550 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tom Hiller <thrilleratplay@gmail.com> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
3.2 KiB
coreboot documentation guidelines
Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing.
That said please always try to write documentation! One problem in the firmware development is the missing documentation. In this document you will get a brief introduction how to write, submit and publish documenation to coreboot.
Preparations
coreboot uses Sphinx documentation tool. We prefer the markdown format over reStructuredText so only embedded ReST is supported. Checkout the Markdown Guide for more information.
Install Sphinx
Please follow this official guide to install sphinx. You will also need python-recommonmark for sphinx to be able to handle markdown documenation.
The recommended version is sphinx 1.7.7, sphinx_rtd_theme 0.4.1 and recommonmark 0.4.0.
Optional
Install shpinx-autobuild for rebuilding markdown/rst sources on the fly!
Basic and simple rules
The following rules should be followed in order to get it at least reviewed on review.coreboot.org.
Documentation:
- Must be written in markdown with embedded reStructuredText format.
- Must be written in English.
- Must be placed into Documentation/ directory subfolder.
- Should follow the same directory structure as src/ when practical.
- Must be referenced from within other markdown files
- The commit must follow the Gerrit Guidelines.
- Must have all lowercase filenames.
- Running text should have a visible width of about 72 chars.
- Should not duplicate documentation, but reference it instead.
- Must not include the same picture in multiple markdown files.
- Images should be kept small. They should be under 700px in width, as the current theme doesn't allow bigger images.
- Shouldn't cover implementation details; for details, the code is the reference.
Referencing markdown documents
Starting with Sphinx 1.6 recommonmark's auto_doc_ref feature is broken. To reference documents use the TOC tree or inline RST code.
Markdown and Tables
Under Sphinx markdown tables are not supported. Therefore you can use following code block to write tables in reStructuredText and embed them into the markdown:
```eval_rst
+------------+------------+-----------+
| Header 1 | Header 2 | Header 3 |
+============+============+===========+
| body row 1 | column 2 | column 3 |
+------------+------------+-----------+
| body row 2 | Cells may span columns.|
+------------+------------+-----------+
| body row 3 | Cells may | - Cells |
+------------+ span rows. | - contain |
| body row 4 | | - blocks. |
+------------+------------+-----------+
``` #just a code block is enough