Skip to content

Commit 9af9f7a

Browse files
committed
Minor documentation formatting improvement
1 parent 94fe540 commit 9af9f7a

File tree

3 files changed

+43
-13
lines changed

3 files changed

+43
-13
lines changed

pkgs/sage-docbuild/README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Sage: Open Source Mathematics Software: Build system of the Sage documentation
33
================================================================================
44

5+
.. NOTE::
6+
7+
If you are a developer and want to build the SageMath documentation from source,
8+
refer to `developer's guide <../../developer/sage_manuals.html>`.
9+
510
About SageMath
611
--------------
712

src/doc/en/developer/sage_manuals.rst

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ Editing the documentation
4747

4848
After modifying some files in the Sage tutorial
4949
(:sage_root:`src/doc/en/tutorial/`), you will want to visualize the result. In
50-
order to build a **html** version of this document, type::
50+
order to build a **html** version of this document, type:
51+
52+
.. CODE-BLOCK:: bash
5153
5254
sage --docbuild tutorial html
5355
@@ -62,13 +64,17 @@ your web browser.
6264

6365
**Run doctests:** All files must pass tests. After modifying a document
6466
(e.g. ``tutorial``), you can run tests with the following command (see
65-
:ref:`chapter-testing`)::
67+
:ref:`chapter-testing`):
68+
69+
.. CODE-BLOCK:: bash
6670
6771
sage -tp SAGE_ROOT/src/doc/en/tutorial/
6872
6973
**Reference manual:** as this manual is mostly generated from Sage's source
7074
code, you will need to build Sage in order to see the changes you made to some
71-
function's documentation. Type::
75+
function's documentation. Type:
76+
77+
.. CODE-BLOCK:: bash
7278
7379
sage -b && sage --docbuild reference html
7480
@@ -77,7 +83,9 @@ function's documentation. Type::
7783
Hyperlinks
7884
==========
7985

80-
The documentation can contain links toward modules, classes, or methods, e.g.::
86+
The documentation can contain links toward modules, classes, or methods, e.g.:
87+
88+
.. CODE-BLOCK:: rest
8189
8290
:mod:`link to a module <sage.module_name>`
8391
:mod:`sage.module_name` (here the link's text is the module's name)
@@ -313,16 +321,22 @@ script. The content of the ``sage --docbuild`` script is defined in
313321
the ``sphinx-build`` script which does all of the real work. It is
314322
designed to be a replacement for the default Makefiles generated by
315323
the ``sphinx-quickstart`` script. The general form of the command
316-
is::
324+
is:
325+
326+
.. CODE-BLOCK:: bash
317327
318328
sage --docbuild <document-name> <format>
319329
320-
For example::
330+
For example:
331+
332+
.. CODE-BLOCK:: bash
321333
322334
sage --docbuild reference html
323335
324336
Two **help** commands which give plenty of documentation for the ``sage
325-
--docbuild`` script::
337+
--docbuild`` script:
338+
339+
.. CODE-BLOCK:: bash
326340
327341
sage --docbuild -h # short help message
328342
sage --docbuild -H # a more comprehensive one
@@ -333,9 +347,11 @@ used in Sage. See `<http://www.sphinx-doc.org/builders.html>`_.
333347
**Broken links:** in order to build the documentation while reporting the broken
334348
links that it contains, use the ``--warn-links`` flag. Note that Sphinx will not
335349
rebuild a document that has not been updated, and thus not report its broken
336-
links::
350+
links:
351+
352+
.. CODE-BLOCK:: bash
337353
338-
sage --docbuild --warn-links reference html
354+
sage --docbuild --warn-links reference html
339355
340356
.. _section-manuals-names:
341357

@@ -351,12 +367,16 @@ The ``<document-name>`` has the form:
351367
where ``lang`` is a two-letter language code, and ``name`` is the
352368
descriptive name of the document. If the language is not specified,
353369
then it defaults to English (``en``). The following two commands do
354-
the exact same thing::
370+
the exact same thing:
371+
372+
.. CODE-BLOCK:: bash
355373
356374
sage --docbuild tutorial html
357375
sage --docbuild en/tutorial html
358376
359-
To specify the French version of the tutorial, you would simply run::
377+
To specify the French version of the tutorial, you would simply run:
378+
379+
.. CODE-BLOCK:: bash
360380
361381
sage --docbuild fr/tutorial html
362382

src/sage_docbuild/builders.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"""
33
Documentation builders
44
5+
.. NOTE::
6+
7+
If you are a developer and want to build the SageMath documentation from source,
8+
refer to `developer's guide <../../../developer/sage_manuals.html>`.
9+
510
This module is the starting point for building documentation, and is
611
responsible to figure out what to build and with which options. The actual
712
documentation build for each individual document is then done in a subprocess
@@ -21,7 +26,7 @@
2126
in ``local/share/inventory``.
2227
2328
The reference manual is built in two passes, first by :class:`ReferenceBuilder`
24-
with ``inventory`` output type and secondly with``html`` output type. The
29+
with ``inventory`` output type and secondly with ``html`` output type. The
2530
:class:`ReferenceBuilder` itself uses :class:`ReferenceTopBuilder` and
2631
:class:`ReferenceSubBuilder` to build subcomponents of the reference manual.
2732
The :class:`ReferenceSubBuilder` examines the modules included in the
@@ -293,7 +298,7 @@ def clean(self, *args):
293298

294299
def build_many(target, args, processes=None):
295300
"""
296-
Thin wrapper around `sage_docbuild.utils.build_many` which uses the
301+
Thin wrapper around :func:`sage_docbuild.utils.build_many` which uses the
297302
docbuild settings ``NUM_THREADS`` and ``ABORT_ON_ERROR``.
298303
"""
299304
if processes is None:

0 commit comments

Comments
 (0)