Skip to content

Commit

Permalink
Trac #34629: Use the kbd role in the doc
Browse files Browse the repository at this point in the history
in particular to represent the Tab key as can be seen already near the
end of

https://doc.sagemath.org/html/en/installation/launching.html

URL: https://trac.sagemath.org/34629
Reported by: chapoton
Ticket author(s): Frédéric Chapoton, ​John Palmieri
Reviewer(s): Kwankyu Lee
  • Loading branch information
Release Manager committed Oct 11, 2022
2 parents 986fc05 + a0e1d3b commit a6c1e4c
Show file tree
Hide file tree
Showing 40 changed files with 107 additions and 102 deletions.
2 changes: 1 addition & 1 deletion src/doc/en/developer/coding_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ In particular,

- Use 4 spaces for indentation levels. Do not use tabs as they can
result in indentation confusion. Most editors have a feature that
will insert 4 spaces when the tab key is hit. Also, many editors
will insert 4 spaces when the :kbd:`Tab` key is hit. Also, many editors
will automatically search/replace leading tabs with 4 spaces.

- Whitespace before and after assignment and binary operator of the
Expand Down
8 changes: 4 additions & 4 deletions src/doc/en/faq/faq-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ Can I do X in Sage?
"""""""""""""""""""

You are encouraged to use Sage's tab autocompletion. Just type a few
characters, hit the tab key, and see if the command you want appears
characters, hit the :kbd:`Tab` key, and see if the command you want appears
in the list of tab autocompletion. If you have a command called
``mycmd``, then type ``mycmd.`` and hit the tab key to get a list of
``mycmd``, then type ``mycmd.`` and hit the :kbd:`Tab` key to get a list of
functionalities that are supported by that command. To read the
documentation of ``mycmd``, type ``mycmd?`` and press the enter key to
documentation of ``mycmd``, type ``mycmd?`` and press the :kbd:`Enter` key to
read the documentation for that command. Similarly, type ``mycmd??``
and hit the enter key to get the source code of that command. You are
and hit the :kbd:`Enter` key to get the source code of that command. You are
also encouraged to search through the source code and documentation of
the Sage library. To search through the source code of the Sage
library, use the command ``search_src("<search-keyword>")`` where you
Expand Down
7 changes: 4 additions & 3 deletions src/doc/en/prep/Advanced-2DPlotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ following sections:

- :ref:`Saving`

This tutorial assumes that one is familiar with the basics of Sage, such
as evaluating a cell by clicking the "evaluate" link, or by pressing
Shift\-Enter (hold down Shift while pressing the Enter key).
This tutorial assumes that one is familiar with the basics of Sage,
such as evaluating a cell by clicking the "evaluate" link, or by
pressing :kbd:`Shift` + :kbd:`Enter` (hold down :kbd:`Shift` while
pressing the :kbd:`Enter` key).

.. fixme - if log plots are in by the time this makes it in, put them in!!!
Expand Down
8 changes: 4 additions & 4 deletions src/doc/en/prep/Calculus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ the United States; the final section is a checkpoint of sorts.
The tutorial assumes that one is familiar with the basics of Sage, such
as outlined in the previous tutorials.

For a refresher, make sure the syntax below for defining a function and
getting a value makes sense; then evaluate the cell by clicking the
"evaluate" link, or by pressing Shift\-Enter (hold down Shift while
pressing the Enter key).
For a refresher, make sure the syntax below for defining a function
and getting a value makes sense; then evaluate the cell by clicking
the "evaluate" link, or by pressing :kbd:`Shift` + :kbd:`Enter` (hold
down :kbd:`Shift` while pressing the :kbd:`Enter` key).

::

Expand Down
19 changes: 10 additions & 9 deletions src/doc/en/prep/Intro-Tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ To do math in a Jupyter cell, one must do two things.
.. image:: media/RunCellIcon.png
:align: center

Or one can use the keyboard shortcut of holding down the Shift key
while you press the Enter key. We call this "Shift\-Enter".
Or one can use the keyboard shortcut of holding down the :kbd:`Shift` key
while you press the :kbd:`Enter` key.
We call this :kbd:`Shift` + :kbd:`Enter`.

Sage prints out its response just below the cell (that's the ``4``
below, so Sage confirms that :math:`2+2=4`). Note also that Sage has
Expand Down Expand Up @@ -365,7 +366,7 @@ Here's an example.

- Still, it seems reasonable that the command might start with ``pl``.

- Then one can type ``pl`` in an input cell, and then press the tab key
- Then one can type ``pl`` in an input cell, and then press the :kbd:`Tab` key
to see all the commands that start with the letters ``pl``.

Try tabbing after the ``pl`` in the following cell to see all the
Expand All @@ -379,7 +380,7 @@ commands that start with the letters ``pl``. You should see that
sage: pl

To pick one, just click on it; to stop viewing them, press the
Escape/esc key.
:kbd:`Escape` key.

You can also use this to see what you can do to an expression or
mathematical object.
Expand All @@ -399,15 +400,15 @@ defined.

sage: f(x)=x^2

Now put your cursor after the period and press your tab key.
Now put your cursor after the period and press your :kbd:`Tab` key.

.. skip
::

sage: f.

Again, Escape should remove the list.
Again, :kbd:`Escape` should remove the list.

One of the things in that list above was ``integrate``. Let's try it.

Expand Down Expand Up @@ -437,7 +438,7 @@ that can illustrate how to use the function.
- Press tab *or* evaluate to see the documentation.

To see how this help works, move your cursor after the question mark
below and press tab.
below and press :kbd:`Tab`.

.. skip
Expand All @@ -449,8 +450,8 @@ The examples illustrate that the syntax requires ``f.integrate(x)`` and
not just ``f.integrate()``. (After all, the latter could be ambiguous
if several variables had already been defined).

To stop viewing the documentation after pressing tab, you can press the
Escape key, just like with the completion of options.
To stop viewing the documentation after pressing :kbd:`Tab`, you can press the
:kbd:`Escape` key, just like with the completion of options.

If you would like the documentation to be visible longer\-term, you can
*evaluate* a command with the question mark (like below) to access the
Expand Down
3 changes: 2 additions & 1 deletion src/doc/en/prep/Symbolics-and-Basic-Plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ and evaluation in Sage. We provide a (very) brief refresher.
value makes sense.

#. Then evaluate the cell by clicking the "evaluate" link, or by
pressing Shift\-Enter (hold down Shift while pressing the Enter key).
pressing :kbd:`Shift` + :kbd:`Enter` (hold down :kbd:`Shift`
while pressing the :kbd:`Enter` key).

::

Expand Down
6 changes: 3 additions & 3 deletions src/doc/en/thematic_tutorials/group_theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ since `\sigma` is an odd permutation.
Many more available functions that can be applied to a permutation can
be found via "tab-completion." With ``sigma`` defined as an element
of a permutation group, in a Sage cell, type ``sigma.`` (Note the
"``.``") and then press the tab key. You will get a list of available
"``.``") and then press the :kbd:`Tab` key. You will get a list of available
functions (you may need to scroll down to see the whole list).
Experiment and explore! It is what Sage is all about. You really
cannot break anything.
Expand Down Expand Up @@ -359,13 +359,13 @@ and then a variety of functions become available.

After trying the examples below, experiment with tab-completion.
Having defined ``H``, type ``H.`` (note the "``.``") and then press
the tab key. You will get a list of available functions (you may need
the :kbd:`Tab` key. You will get a list of available functions (you may need
to scroll down to see the whole list). As before,
*experiment and explore*---it is really hard to break anything.

Here is another couple of ways to experiment and explore. Find a
function that looks interesting, say ``is_abelian()``. Type
``H.is_abelian?`` (note the question mark) followed by the enter key.
``H.is_abelian?`` (note the question mark) followed by the :kbd:`Enter` key.
This will display a portion of the source code for the
``is_abelian()`` function, describing the inputs and output, possibly
illustrated with example uses.
Expand Down
4 changes: 2 additions & 2 deletions src/doc/en/tutorial/interactive_shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ You can also use the following more concise notation:
sage: V = QQ^3

Then it is easy to list all member functions for :math:`V` using tab
completion. Just type ``V.``, then type the ``[tab key]`` key on your
completion. Just type ``V.``, then type the :kbd:`Tab` key on your
keyboard:

.. skip
Expand All @@ -567,7 +567,7 @@ keyboard:
...
V.zero_vector

If you type the first few letters of a function, then ``[tab key]``,
If you type the first few letters of a function, then the :kbd:`Tab` key,
you get only functions that begin as indicated.

.. skip
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/tutorial/latex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Customizing LaTeX Generation
There are several ways to customize the actual LaTeX code generated by
the ``latex()`` command. In the notebook and at the Sage command-line
there is a pre-defined object named ``latex`` which has several methods,
which you can list by typing ``latex.``, followed by the tab key
which you can list by typing ``latex.``, followed by the :kbd:`Tab` key
(note the period).

A good example is the ``latex.matrix_delimiters`` method. It can be
Expand Down
11 changes: 5 additions & 6 deletions src/doc/en/tutorial/tour_help.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,11 @@ question mark:
[6 3 5 1 7 2 8 9 4]
[4 9 1 8 5 6 7 2 3]

Sage also provides 'Tab completion': type the first few letters of
a function and then hit the tab key. For example, if you type ``ta``
followed by ``TAB``, Sage will print
``tachyon, tan, tanh,
taylor``. This provides a good way to find
the names of functions and other structures in Sage.
Sage also provides 'Tab completion': type the first few letters of a
function and then hit the :kbd:`Tab` key. For example, if you type
``ta`` followed by :kbd:`Tab`, Sage will print ``tachyon, tan, tanh,
taylor``. This provides a good way to find the names of functions and
other structures in Sage.


.. _section-functions:
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ja/tutorial/latex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ LaTeXコード生成のカスタマイズ
.. There are several ways to customize the actual LaTeX code generated by
.. the ``latex()`` command. In the notebook and at the Sage command-line
.. there is a pre-defined object named ``latex`` which has several methods,
.. which you can list by typing ``latex.``, followed by the tab key
.. which you can list by typing ``latex.``, followed by the :kbd:`Tab` key
.. (note the period).
ここでは ``latex.matrix_delimiters`` メソッドに注目してみよう.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
easy way to discover and quickly create the algebras that are available
(as listed here).
Let ``<tab>`` indicate pressing the tab key. So begin by typing
Let ``<tab>`` indicate pressing the :kbd:`Tab` key. So begin by typing
``algebras.<tab>`` to the see the currently implemented named algebras.
- :class:`algebras.AlternatingCentralExtensionQuantumOnsager
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/path_tableaux/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
object is an easy way to discover and quickly create the path tableaux that
are available (as listed here).
Let ``<tab>`` indicate pressing the tab key. So begin by typing
Let ``<tab>`` indicate pressing the :kbd:`Tab` key. So begin by typing
``path_tableaux.<tab>`` to the see the currently implemented path tableaux.
- :class:`~sage.combinat.path_tableaux.path_tableau.CylindricalDiagram`
Expand Down
30 changes: 15 additions & 15 deletions src/sage/combinat/words/word.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class FiniteWord_list(WordDatatype_list, FiniteWord_class):
r"""
Finite word represented by a Python list.
For any word `w`, type ``w.`` and hit TAB key to see the list of
For any word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
EXAMPLES::
Expand All @@ -304,7 +304,7 @@ class FiniteWord_str(WordDatatype_str, FiniteWord_class):
r"""
Finite word represented by a Python str.
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
EXAMPLES::
Expand All @@ -325,7 +325,7 @@ class FiniteWord_tuple(WordDatatype_tuple, FiniteWord_class):
r"""
Finite word represented by a Python tuple.
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
EXAMPLES::
Expand All @@ -346,7 +346,7 @@ class FiniteWord_iter_with_caching(WordDatatype_iter_with_caching, FiniteWord_cl
r"""
Finite word represented by an iterator (with caching).
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
EXAMPLES::
Expand All @@ -372,7 +372,7 @@ class FiniteWord_iter(WordDatatype_iter, FiniteWord_class):
r"""
Finite word represented by an iterator.
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
EXAMPLES::
Expand Down Expand Up @@ -400,7 +400,7 @@ class FiniteWord_callable_with_caching(WordDatatype_callable_with_caching, Finit
r"""
Finite word represented by a callable (with caching).
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
EXAMPLES::
Expand Down Expand Up @@ -451,7 +451,7 @@ class FiniteWord_callable(WordDatatype_callable, FiniteWord_class):
r"""
Finite word represented by a callable.
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
EXAMPLES::
Expand Down Expand Up @@ -482,7 +482,7 @@ class InfiniteWord_iter_with_caching(WordDatatype_iter_with_caching, InfiniteWor
r"""
Infinite word represented by an iterable (with caching).
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
Infinite words behave like a Python list : they can be sliced using
Expand Down Expand Up @@ -520,7 +520,7 @@ class InfiniteWord_iter(WordDatatype_iter, InfiniteWord_class):
r"""
Infinite word represented by an iterable.
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
Infinite words behave like a Python list : they can be sliced using
Expand Down Expand Up @@ -558,7 +558,7 @@ class InfiniteWord_callable_with_caching(WordDatatype_callable_with_caching, Inf
r"""
Infinite word represented by a callable (with caching).
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
Infinite words behave like a Python list : they can be sliced using
Expand Down Expand Up @@ -588,7 +588,7 @@ class InfiniteWord_callable(WordDatatype_callable, InfiniteWord_class):
r"""
Infinite word represented by a callable.
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
Infinite words behave like a Python list : they can be sliced using
Expand Down Expand Up @@ -622,7 +622,7 @@ class Word_iter_with_caching(WordDatatype_iter_with_caching, Word_class):
Word of unknown length (finite or infinite) represented by an
iterable (with caching).
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
Words behave like a Python list : they can be sliced using
Expand Down Expand Up @@ -658,7 +658,7 @@ class Word_iter(WordDatatype_iter, Word_class):
Word of unknown length (finite or infinite) represented by an
iterable.
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
Words behave like a Python list : they can be sliced using
Expand Down Expand Up @@ -694,7 +694,7 @@ class FiniteWord_morphic(WordDatatype_morphic, FiniteWord_class):
r"""
Finite morphic word.
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
EXAMPLES::
Expand All @@ -721,7 +721,7 @@ class InfiniteWord_morphic(WordDatatype_morphic, InfiniteWord_class):
r"""
Morphic word of infinite length.
For such word `w`, type ``w.`` and hit TAB key to see the list of
For such word `w`, type ``w.`` and hit :kbd:`Tab` key to see the list of
functions defined on `w`.
Infinite words behave like a Python list : they can be sliced using
Expand Down
Loading

0 comments on commit a6c1e4c

Please sign in to comment.