Skip to content

Commit

Permalink
Trac #33763: Refactor src/sage/docs
Browse files Browse the repository at this point in the history
We deprecate the package `sage.docs` which contains two modules `conf`
and `instancedoc`.

The module `conf` is not one of normal sage modules, but is the Sphinx
configuration for documentation building. Hence we move the module into
`sage_docbuild`.

The module `instancedoc` provides a decorator to add docstrings to
instance objects. This has nothing to do with building documentation.
Hence we move it to `sage.misc`.

This ticket also refactors the code in `sage_docbuild.__init__`. The
"builders" are moved to a new module `sage_docbuild.builders` and the
"main" function is moved into `sage_docbuild.__main__`.

Finally we add some documentation about Sage's documentation system.

----

**To minimize confusion, this ticket should be merged with sage 9.7.beta
as early as possible (before any other tickets touching `conf.py`)**

URL: https://trac.sagemath.org/33763
Reported by: klee
Ticket author(s): Kwankyu Lee
Reviewer(s): Matthias Koeppe
  • Loading branch information
Release Manager committed May 22, 2022
2 parents 9597eaf + d8a645f commit df168c8
Show file tree
Hide file tree
Showing 83 changed files with 3,343 additions and 2,135 deletions.
2 changes: 1 addition & 1 deletion pkgs/sagemath-objects/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ include sage/misc/flatten.* # dep of sage/categories/coxeter_groups.

include sage/misc/lazy_import*.*
include sage/misc/sageinspect.* # dep of sage/misc/lazy_import
graft sage/docs # dep of sage/misc/lazy_import
include sage/misc/instancedoc.* # dep of sage/misc/lazy_import

include sage/misc/persist.*
include sage/misc/sage_unittest.* # dep of sage/misc/persist
Expand Down
6 changes: 3 additions & 3 deletions src/doc/ca/intro/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/de/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/de/thematische_anleitungen/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/de/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/constructions/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/developer/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/faq/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import *
from sage_docbuild.conf import release
from sage_docbuild.conf import *

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/installation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/prep/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/reference/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

import os
from sage.env import SAGE_DOC_SRC, SAGE_DOC
from sage.docs.conf import release, latex_elements, exclude_patterns
from sage.docs.conf import *
from sage_docbuild.conf import release, latex_elements, exclude_patterns
from sage_docbuild.conf import *

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/reference/conf_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

import os
from sage.env import SAGE_DOC_SRC, SAGE_DOC
from sage.docs.conf import release, exclude_patterns
from sage.docs.conf import *
from sage_docbuild.conf import release, exclude_patterns
from sage_docbuild.conf import *

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
1 change: 1 addition & 0 deletions src/doc/en/reference/documentation/conf.py
12 changes: 12 additions & 0 deletions src/doc/en/reference/documentation/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Documentation System
====================

.. toctree::
:maxdepth: 1

sage_docbuild/__main__
sage_docbuild/builders
sage_docbuild/build_options
sage_docbuild/sphinxbuild
sage_docbuild/conf
sage_docbuild/utils
7 changes: 6 additions & 1 deletion src/doc/en/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Geometry, Topology, and Homological Algebra

* :doc:`Euclidean Spaces and Vector Calculus <euclidean_spaces/index>`
* :doc:`Combinatorial and Discrete Geometry <discrete_geometry/index>`
* :doc:`Cell Complexes, Simplicial Complexes, and
* :doc:`Cell Complexes, Simplicial Complexes, and
Simplicial Sets <topology/index>`
* :doc:`Manifolds and Differential Geometry <manifolds/index>`
* :doc:`Hyperbolic Geometry <hyperbolic_geometry/index>`
Expand Down Expand Up @@ -157,6 +157,11 @@ Interfaces
* :doc:`C/C++ Library Interfaces <libs/index>`
* :doc:`Python Technicalities <cpython/index>`

Documentation System
--------------------

* :doc:`Documentation System <documentation/index>`

General Information
===================

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/thematic_tutorials/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import *
from sage_docbuild.conf import release
from sage_docbuild.conf import *

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/thematic_tutorials/numerical_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/website/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/es/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# All configuration values have a default; values that are commented
# out serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import *
from sage_docbuild.conf import release
from sage_docbuild.conf import *

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/es/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release
from sage.docs.conf import *
from sage_docbuild.conf import release
from sage_docbuild.conf import *

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
6 changes: 3 additions & 3 deletions src/doc/fr/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from sage.docs.conf import release, latex_elements
from sage.docs.conf import * # NOQA
from sage_docbuild.conf import release, latex_elements
from sage_docbuild.conf import * # NOQA

# Add any paths that contain custom static files (such as style sheets),
# relative to this directory to html_static_path. They are copied after the
# builtin static files, so a file named "default.css" will overwrite the
# builtin "default.css". html_common_static_path imported from sage.docs.conf
# builtin "default.css". html_common_static_path imported from sage_docbuild.conf
# contains common paths.
html_static_path = [] + html_common_static_path

Expand Down
Loading

0 comments on commit df168c8

Please sign in to comment.