Skip to content

Commit d4657b6

Browse files
author
Release Manager
committed
sagemathgh-40742: Improve shell code formatting in docs, second part <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> This is a continuation of sagemath#40609 in order to get a bettert format of code blocks, specially concerning copy buttons; it was the starting point of this PR. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#34567: ... --> URL: sagemath#40742 Reported by: Enrique Manuel Artal Bartolo Reviewer(s): Tobias Diez
2 parents 5fa7c42 + c07fc22 commit d4657b6

22 files changed

+1660
-1249
lines changed

build/bin/sage-print-system-package-command

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ do
3333
PROMPT="${1#--prompt=}"
3434
;;
3535
--prompt)
36-
PROMPT=' $ '
37-
CONTINUATION=' '
36+
PROMPT='$ '
37+
CONTINUATION=' '
3838
;;
3939
--continuation=*)
4040
CONTINUATION="${1#--continuation=}"

src/doc/en/developer/coding_in_other.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The ``gen`` class is defined in
4646
:sage_root:`src/sage/libs/cypari2/gen.pyx`, and this is where we
4747
add the method ``matfrobenius``:
4848

49-
.. CODE-BLOCK:: cython
49+
.. code-block:: cython
5050
5151
def matfrobenius(self, flag=0):
5252
r"""
@@ -102,7 +102,7 @@ class where we call the ``matfrobenius()`` method on the PARI object
102102
associated to the matrix after doing some sanity checking. Then we
103103
convert output from PARI to Sage objects:
104104

105-
.. CODE-BLOCK:: cython
105+
.. code-block:: cython
106106
107107
def frobenius_form(self, flag=0, var='x'):
108108
"""
@@ -171,7 +171,7 @@ For example, suppose we want to make a wrapper for the computation of
171171
the Cartan matrix of a simple Lie algebra. The Cartan matrix of `G_2`
172172
is available in GAP using the commands:
173173

174-
.. CODE-BLOCK:: gap
174+
.. code-block:: gap
175175
176176
gap> L:= SimpleLieAlgebra( "G", 2, Rationals );
177177
<Lie algebra of dimension 14 over Rationals>
@@ -202,7 +202,7 @@ can convert back to sage using the method ``sage`` if it works.
202202

203203
.. skip
204204
205-
.. CODE-BLOCK:: python
205+
.. code-block:: python
206206
207207
def cartan_matrix(typ, rank):
208208
"""
@@ -326,7 +326,7 @@ to carry this out.
326326

327327
Here is an example on how to use this command in Singular:
328328

329-
.. CODE-BLOCK:: text
329+
.. code-block:: text
330330
331331
A Computer Algebra System for Polynomial Computations / version 3-0-0
332332
0<
@@ -449,7 +449,7 @@ just that.
449449

450450
.. skip
451451
452-
.. CODE-BLOCK:: python
452+
.. code-block:: python
453453
454454
def points_parser(string_points, F):
455455
"""
@@ -509,7 +509,7 @@ ourselves to points of degree one.
509509

510510
.. skip
511511
512-
.. CODE-BLOCK:: python
512+
.. code-block:: python
513513
514514
def places_on_curve(f, F):
515515
"""
@@ -593,7 +593,7 @@ Next, we implement the general function (for brevity we omit the
593593
docstring, which is the same as above). Note that the ``point_parser``
594594
function is not required:
595595

596-
.. CODE-BLOCK:: python
596+
.. code-block:: python
597597
598598
def places_on_curve(f, F):
599599
p = F.characteristic()
@@ -634,7 +634,7 @@ For example, here is part of the file
634634
defines an interface between Sage and Octave, an open source program
635635
for doing numerical computations, among other things:
636636

637-
.. CODE-BLOCK:: python
637+
.. code-block:: python
638638
639639
import os
640640
from expect import Expect, ExpectElement
@@ -648,7 +648,7 @@ basic class for interfaces. The third line defines the class
648648
``Octave``; it derives from ``Expect`` as well. After this comes a
649649
docstring, which we omit here (see the file for details). Next comes:
650650

651-
.. CODE-BLOCK:: python
651+
.. code-block:: python
652652
653653
def __init__(self, script_subdirectory="", logfile=None,
654654
server=None, server_tmpdir=None):
@@ -666,7 +666,7 @@ docstring, which we omit here (see the file for details). Next comes:
666666
667667
This uses the class ``Expect`` to set up the Octave interface:
668668

669-
.. CODE-BLOCK:: python
669+
.. code-block:: python
670670
671671
def set(self, var, value):
672672
"""
@@ -692,7 +692,7 @@ These let users type ``octave.set('x', 3)``, after which
692692
``octave.get('x')`` returns ``' 3'``. Running ``octave.console()``
693693
dumps the user into an Octave interactive shell:
694694

695-
.. CODE-BLOCK:: python
695+
.. code-block:: python
696696
697697
def solve_linear_system(self, A, b):
698698
"""

src/doc/en/developer/coding_in_python.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Python language standard
1515
Sage follows the time window-based support policy
1616
`SPEC 0 — Minimum Supported Dependencies <https://scientific-python.org/specs/spec-0000/>`_
1717
for Python versions.
18-
The current minimum supported Python version can be found in the
19-
``pyproject.toml`` file. Accordingly, only language and library features
20-
available in this version can be used. If a feature is deprecated in a newer
18+
The current minimum supported Python version can be found in the
19+
``pyproject.toml`` file. Accordingly, only language and library features
20+
available in this version can be used. If a feature is deprecated in a newer
2121
supported version, it must be ensured that deprecation warnings issued by
2222
Python do not lead to failures in doctests.
2323

@@ -274,9 +274,11 @@ preparsed version of ``foo.sage`` is created with the name
274274
This file was *autogenerated* from the file foo.sage.
275275

276276
You can explicitly preparse a file with the ``--preparse``
277-
command-line option: running ::
277+
command-line option: running
278278

279-
sage --preparse foo.sage
279+
.. code-block:: console
280+
281+
$ sage --preparse foo.sage
280282
281283
creates the file ``foo.sage.py``.
282284

0 commit comments

Comments
 (0)