Skip to content

Commit 9252cfe

Browse files
author
Matthias Koeppe
committed
git grep -l -E "SAGE_ROOT/[^lu]" src/doc | xargs sed -i.bak 's,`SAGE_ROOT/\([^]*\)`,:sage_root:\1`,g'
1 parent 53cd3c0 commit 9252cfe

File tree

15 files changed

+106
-106
lines changed

15 files changed

+106
-106
lines changed

src/doc/de/tutorial/sagetex.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Tutorial und den Abschnitt "Make SageTeX known to TeX" des `Sage installation gu
1515
Installationsanleitung führen) um weitere Informationen zu erhalten.
1616

1717
Hier stellen wir ein sehr kurzes Beispiel vor wie man SageTeX nutzt.
18-
Die komplette Dokumentation finden Sie unter ``SAGE_ROOT/venv/share/texmf/tex/latex/sagetex``,
18+
Die komplette Dokumentation finden Sie unter :sage_root:`venv/share/texmf/tex/latex/sagetex`,
1919
wobei ``SAGE_ROOT`` das Installationsverzeichnis von Sage ist. Dieses Verzeichnis
2020
enthält die Dokumentation, eine Beispieldatei und einige nützliche Python Skripte.
2121

@@ -103,4 +103,4 @@ an den Sage Befehlen in Ihrem Dokument vorgenommen haben.
103103

104104
Es gibt noch viel mehr über SageTeX zu sagen, aber da sowohl Sage alsauch
105105
LaTeX komplexe und mächtige Werkzeuge sind, sollten Sie die Dokumentation
106-
über SageTeX in ``SAGE_ROOT/venv/share/texmf/tex/latex/sagetex`` lesen.
106+
über SageTeX in :sage_root:`venv/share/texmf/tex/latex/sagetex` lesen.

src/doc/en/developer/coding_basics.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ of several different types of polynomial rings.
123123

124124
If you want to create a new directory (`package
125125
<https://docs.python.org/3/tutorial/modules.html#packages>`_) in the
126-
Sage library ``SAGE_ROOT/src/sage`` (say, ``measure_theory``), that
126+
Sage library :sage_root:`src/sage` (say, ``measure_theory``), that
127127
directory will usually contain an empty file ``__init__.py``, which
128128
marks the directory as an ordinary package (see
129129
:ref:`section_namespace_packages`), and also a file ``all.py``,
@@ -141,7 +141,7 @@ framework::
141141
lazy_import('sage.measure_theory.borel_measure', 'BorelMeasure')
142142
lazy_import('sage.measure_theory.banach_tarski', 'BanachTarskiParadox')
143143

144-
Then in the file ``SAGE_ROOT/src/sage/all.py``, add a line ::
144+
Then in the file :sage_root:`src/sage/all.py`, add a line ::
145145

146146
from sage.measure_theory.all import *
147147

@@ -176,16 +176,16 @@ included in one of the following places:
176176

177177
- Older code in the Sage library accesses
178178
the package data in more direct ways. For example,
179-
``SAGE_ROOT/src/sage/interfaces/maxima.py`` uses the file
180-
``SAGE_ROOT/src/sage/interfaces/maxima.lisp`` at runtime, so it
179+
:sage_root:`src/sage/interfaces/maxima.py` uses the file
180+
:sage_root:`src/sage/interfaces/maxima.lisp` at runtime, so it
181181
refers to it as::
182182

183183
os.path.join(os.path.dirname(__file__), 'sage-maxima.lisp')
184184

185-
- In an appropriate subdirectory of ``SAGE_ROOT/src/sage/ext_data/``.
185+
- In an appropriate subdirectory of :sage_root:`src/sage/ext_data/`.
186186
(At runtime, it is then available in the directory indicated by
187187
``SAGE_EXTCODE``). For example, if ``file`` is placed in
188-
``SAGE_ROOT/src/sage/ext_data/directory/`` it can be accessed with ::
188+
:sage_root:`src/sage/ext_data/directory/` it can be accessed with ::
189189

190190
from sage.env import SAGE_EXTCODE
191191
file = os.path.join(SAGE_EXTCODE, 'directory', 'file')
@@ -194,7 +194,7 @@ included in one of the following places:
194194

195195
In all cases, the files must be listed (explicitly or via wildcards) in
196196
the section ``options.package_data`` of the file
197-
``SAGE_ROOT/pkgs/sagemath-standard/setup.cfg.m4`` (or the corresponding
197+
:sage_root:`pkgs/sagemath-standard/setup.cfg.m4` (or the corresponding
198198
file of another distribution).
199199

200200
Large data files should not be added to the Sage source tree. Instead, it
@@ -270,7 +270,7 @@ The top of each Sage code file should follow this format::
270270
# https://www.gnu.org/licenses/
271271
# ****************************************************************************
272272

273-
As an example, see ``SAGE_ROOT/src/sage/rings/integer.pyx``, which contains the
273+
As an example, see :sage_root:`src/sage/rings/integer.pyx`, which contains the
274274
implementation for `\ZZ`. The names of the people who made major contributions
275275
to the file appear in the ``AUTHORS`` section. You can add your name to the
276276
list if you belong to the people, but refrain from being verbose in the
@@ -919,7 +919,7 @@ LaTeX-formatted ``\\Bold{Z}`` in the html manual, and as ``Z`` in the
919919
interactive help. Other examples: ``\\GF{q}`` (`\GF{q}`) and ``\\Zmod{p}``
920920
(`\Zmod{p}`).
921921

922-
See the file ``SAGE_ROOT/src/sage/misc/latex_macros.py`` for a full list and
922+
See the file :sage_root:`src/sage/misc/latex_macros.py` for a full list and
923923
for details about how to add more macros.
924924

925925
.. _section-doctest-writing:
@@ -968,13 +968,13 @@ written.
968968

969969
Note that **TestSuites** are an automatic way to generate some of these
970970
tests in specific situations. See
971-
``SAGE_ROOT/src/sage/misc/sage_unittest.py``.
971+
:sage_root:`src/sage/misc/sage_unittest.py`.
972972

973973
**The syntax:**
974974

975975
- **Environment:** doctests should work if you copy/paste them in Sage's
976976
interactive console. For example, the function ``AA()`` in the file
977-
``SAGE_ROOT/src/sage/algebras/steenrod/steenrod_algebra.py`` includes an
977+
:sage_root:`src/sage/algebras/steenrod/steenrod_algebra.py` includes an
978978
EXAMPLES block containing the following::
979979

980980
sage: from sage.algebras.steenrod.steenrod_algebra import AA as A
@@ -1001,7 +1001,7 @@ written.
10011001
- **Writing files:** If a test outputs to a file, the file should be a
10021002
temporary file. Use :func:`tmp_filename` to get a temporary filename, or
10031003
:func:`tmp_dir` to get a temporary directory. An example from
1004-
``SAGE_ROOT/src/sage/plot/graphics.py``)::
1004+
:sage_root:`src/sage/plot/graphics.py`)::
10051005

10061006
sage: plot(x^2 - 5, (x, 0, 5), ymin=0).save(tmp_filename(ext='.png'))
10071007

@@ -1445,14 +1445,14 @@ put ``.. linkall`` anywhere in the file, on a line by itself. (For
14451445
clarity, it might be best to put it near the top of the file.) Then
14461446
``sage -t`` will act as if there were a ``.. link`` before each
14471447
verbatim environment. The file
1448-
``SAGE_ROOT/src/doc/en/tutorial/interfaces.rst`` contains a
1448+
:sage_root:`src/doc/en/tutorial/interfaces.rst` contains a
14491449
``.. linkall`` directive, for example.
14501450

14511451
You can also put ``.. skip`` right before a verbatim environment to
14521452
have that example skipped when testing the file. This goes in the
14531453
same place as the ``.. link`` in the previous example.
14541454

1455-
See the files in ``SAGE_ROOT/src/doc/en/tutorial/`` for many
1455+
See the files in :sage_root:`src/doc/en/tutorial/` for many
14561456
examples of how to include automated testing in reST documentation for
14571457
Sage.
14581458

src/doc/en/developer/coding_in_other.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ asynchronous because it derives from the Sage class ``Expect``, which
639639
handles the communication between Sage and the external process.
640640

641641
For example, here is part of the file
642-
``SAGE_ROOT/src/sage/interfaces/octave.py``, which
642+
:sage_root:`src/sage/interfaces/octave.py`, which
643643
defines an interface between Sage and Octave, an open source program
644644
for doing numerical computations, among other things:
645645

@@ -751,5 +751,5 @@ documented.
751751

752752
These are only excerpts from ``octave.py``; check that file for more
753753
definitions and examples. Look at other files in the directory
754-
``SAGE_ROOT/src/sage/interfaces/`` for examples of interfaces to other
754+
:sage_root:`src/sage/interfaces/` for examples of interfaces to other
755755
software packages.

src/doc/en/developer/coding_in_python.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ support the command ``latex``.
129129

130130
#. You can use any macros included in ``amsmath``, ``amssymb``, or
131131
``amsfonts``, or the ones defined in
132-
``SAGE_ROOT/doc/commontex/macros.tex``.
132+
:sage_root:`doc/commontex/macros.tex`.
133133

134134
An example template for a ``_latex_`` method follows. Note that the
135135
``.. skip`` line should not be included in your code; it is here to
@@ -171,7 +171,7 @@ the context.
171171

172172
Here is an example of the ``_latex_`` and ``_repr_`` functions for the
173173
``Pi`` class. It is from the file
174-
``SAGE_ROOT/src/sage/symbolic/constants.py``:
174+
:sage_root:`src/sage/symbolic/constants.py`:
175175

176176
.. CODE-BLOCK:: python
177177
@@ -202,7 +202,7 @@ matrix over a ring `R`. Then the Sage function ``matrix`` will work
202202
for this object.
203203

204204
The following is from
205-
``SAGE_ROOT/src/sage/graphs/generic_graph.py``:
205+
:sage_root:`src/sage/graphs/generic_graph.py`:
206206

207207
.. CODE-BLOCK:: python
208208
@@ -221,7 +221,7 @@ The following is from
221221
Similarly, provide a ``_vector_`` method for an object that can be
222222
coerced to a vector over a ring `R`. Then the Sage function ``vector``
223223
will work for this object. The following is from the file
224-
``SAGE_ROOT/src/sage/modules/free_module_element.pyx``:
224+
:sage_root:`src/sage/modules/free_module_element.pyx`:
225225

226226
.. CODE-BLOCK:: python
227227
@@ -298,11 +298,11 @@ creates the file ``foo.sage.py``.
298298

299299
The following files are relevant to preparsing in Sage:
300300

301-
#. ``SAGE_ROOT/src/bin/sage``
301+
#. :sage_root:`src/bin/sage`
302302

303-
#. ``SAGE_ROOT/src/bin/sage-preparse``
303+
#. :sage_root:`src/bin/sage-preparse`
304304

305-
#. ``SAGE_ROOT/src/sage/repl/preparse.py``
305+
#. :sage_root:`src/sage/repl/preparse.py`
306306

307307
In particular, the file ``preparse.py`` contains the Sage preparser
308308
code.
@@ -344,7 +344,7 @@ scope variable.
344344
345345
Certain objects, e.g. matrices, may start out mutable and become
346346
immutable later. See the file
347-
``SAGE_ROOT/src/sage/structure/mutability.py``.
347+
:sage_root:`src/sage/structure/mutability.py`.
348348

349349

350350
The __hash__ special method
@@ -538,15 +538,15 @@ large third-party modules. See also :ref:`section_dependencies_distributions`
538538
for a discussion of imports from the viewpoint of modularization.
539539

540540
First, you must avoid circular imports. For example, suppose that the
541-
file ``SAGE_ROOT/src/sage/algebras/steenrod_algebra.py``
541+
file :sage_root:`src/sage/algebras/steenrod_algebra.py`
542542
started with a line:
543543

544544
.. CODE-BLOCK:: python
545545
546546
from sage.sage.algebras.steenrod_algebra_bases import *
547547
548548
and that the file
549-
``SAGE_ROOT/src/sage/algebras/steenrod_algebra_bases.py``
549+
:sage_root:`src/sage/algebras/steenrod_algebra_bases.py`
550550
started with a line:
551551

552552
.. CODE-BLOCK:: python
@@ -647,17 +647,17 @@ When importing from other Python libraries that do not provide sufficient typing
647647
information, it is possible to augment the library's typing information for
648648
the purposes of typechecking the Sage library:
649649

650-
- Create typestub files and place them in the directory ``SAGE_ROOT/src/typings``.
650+
- Create typestub files and place them in the directory :sage_root:`src/typings`.
651651
For example, the distribution **pplpy** provides the top-level package :mod:`ppl`,
652652
which publishes no typing information. We can create a typestub file
653-
``SAGE_ROOT/src/typings/ppl.pyi`` or ``SAGE_ROOT/src/typings/ppl/__init__.pyi``.
653+
:sage_root:`src/typings/ppl.pyi` or :sage_root:`src/typings/ppl/__init__.pyi`.
654654

655655
- When these typestub files are working well, it is preferable from the viewpoint
656656
of the Sage project that they are "upstreamed", i.e., contributed to the
657657
project that maintains the library. If a new version of the upstream library
658658
becomes available that provides the necessary typing information, we can
659659
update the package in the Sage distribution and remove the typestub files again
660-
from ``SAGE_ROOT/src/typings``.
660+
from :sage_root:`src/typings`.
661661

662662
- As a fallback, when neither adding typing annotations to source files
663663
nor adding typestub files is welcomed by the upstream project, it is possible

src/doc/en/developer/doctesting.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ Parallel testing the whole Sage library
499499
=======================================
500500

501501
The main Sage library resides in the directory
502-
``SAGE_ROOT/src/``. We can use the syntax described above
502+
:sage_root:`src/`. We can use the syntax described above
503503
to doctest the main library using multiple threads. When doing release
504504
management or patching the main Sage library, a release manager would
505505
parallel test the library using 10 threads with the following command::
@@ -538,22 +538,22 @@ The differences are:
538538
set of tests. First the Sage standard documentation is tested,
539539
i.e. the documentation that resides in
540540

541-
* ``SAGE_ROOT/src/doc/common``
542-
* ``SAGE_ROOT/src/doc/en``
543-
* ``SAGE_ROOT/src/doc/fr``
541+
* :sage_root:`src/doc/common`
542+
* :sage_root:`src/doc/en`
543+
* :sage_root:`src/doc/fr`
544544

545545
Finally, the commands doctest the Sage library. For more details on
546-
these command, see the file ``SAGE_ROOT/Makefile``.
546+
these command, see the file :sage_root:`Makefile`.
547547

548548
* ``make testlong`` --- This command doctests the standard
549549
documentation:
550550

551-
* ``SAGE_ROOT/src/doc/common``
552-
* ``SAGE_ROOT/src/doc/en``
553-
* ``SAGE_ROOT/src/doc/fr``
551+
* :sage_root:`src/doc/common`
552+
* :sage_root:`src/doc/en`
553+
* :sage_root:`src/doc/fr`
554554

555555
and then the Sage library. Doctesting is run with the optional
556-
argument ``--long``. See the file ``SAGE_ROOT/Makefile`` for further
556+
argument ``--long``. See the file :sage_root:`Makefile` for further
557557
details.
558558

559559
* ``make ptest`` --- Similar to the commands ``make test`` and ``make

src/doc/en/developer/packaging.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Packaging Third-Party Code for Sage
99
One of the mottoes of the Sage project is to not reinvent the wheel: If
1010
an algorithm is already implemented in a well-tested library then
1111
consider incorporating that library into Sage. The current list of
12-
available packages are the subdirectories of ``SAGE_ROOT/build/pkgs/``.
12+
available packages are the subdirectories of :sage_root:`build/pkgs/`.
1313
The installation of packages is done through a bash script located in
14-
``SAGE_ROOT/build/bin/sage-spkg``. This script is typically invoked by
14+
:sage_root:`build/bin/sage-spkg`. This script is typically invoked by
1515
giving the command::
1616

1717
[alice@localhost sage]$ sage -i <options> <package name>...
@@ -25,7 +25,7 @@ options can be:
2525
- -d: only download the package
2626

2727
The section :ref:`section-directory-structure` describes the structure
28-
of each individual package in ``SAGE_ROOT/build/pkgs``. In section
28+
of each individual package in :sage_root:`build/pkgs`. In section
2929
:ref:`section-manual-build` we see how you can install and test a new
3030
spkg that you or someone else wrote. Finally,
3131
:ref:`section-inclusion-procedure` explains how to submit a new package
@@ -168,7 +168,7 @@ Third-party packages in Sage consist of two parts:
168168
instead.
169169

170170
#. The build scripts and associated files are in a subdirectory
171-
``SAGE_ROOT/build/pkgs/<package>``, where you replace ``<package>``
171+
:sage_root:`build/pkgs/<package>`, where you replace ``<package>``
172172
with a lower-case version of the upstream project name. If the
173173
project name contains characters which are not alphanumeric
174174
and are not an underscore, those characters should be removed
@@ -177,7 +177,7 @@ Third-party packages in Sage consist of two parts:
177177

178178
As an example, let us consider a hypothetical FoO project. They
179179
(upstream) distribute a tarball ``FoO-1.3.tar.gz`` (that will be
180-
automatically placed in ``SAGE_ROOT/upstream`` during the installation
180+
automatically placed in :sage_root:`upstream` during the installation
181181
process). To package it in Sage, we create a subdirectory containing as
182182
a minimum the following files:
183183

@@ -336,7 +336,7 @@ Likewise for :envvar:`CXXFLAGS`, :envvar:`FCFLAGS`, and :envvar:`F77FLAGS`.
336336
In more detail: ``sage-bootstrap-python`` runs a version of Python
337337
pre-installed on the machine, which is a build prerequisite of Sage.
338338
Note that ``sage-bootstrap-python`` accepts a wide range of Python
339-
versions, Python >= 2.6 and >= 3.4, see ``SAGE_ROOT/build/tox.ini``
339+
versions, Python >= 2.6 and >= 3.4, see :sage_root:`build/tox.ini`
340340
for details. You should only use ``sage-bootstrap-python`` for
341341
installation tasks that must be able to run before Sage has made
342342
``python3`` available. It must not be used for running ``pip`` or
@@ -1226,7 +1226,7 @@ or::
12261226
[alice@localhost sage]$ sage -f -c package_name
12271227
12281228
If all went fine, open a PR with the code under
1229-
``SAGE_ROOT/build/pkgs``.
1229+
:sage_root:`build/pkgs`.
12301230
12311231
12321232
.. _section-spkg-patching:
@@ -1483,7 +1483,7 @@ License information
14831483
-------------------
14841484
14851485
License information for a package needs to be put both in its
1486-
``SPKG.rst`` file and in the file ``SAGE_ROOT/COPYING.txt``.
1486+
``SPKG.rst`` file and in the file :sage_root:`COPYING.txt`.
14871487
Whenever upgrading a package, check whether the license changed between
14881488
versions.
14891489

0 commit comments

Comments
 (0)