Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
using the :kbd: role in the documentation (for Tab and other keys)
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Oct 2, 2022
1 parent 54cd6fe commit 75fa0fd
Show file tree
Hide file tree
Showing 28 changed files with 74 additions and 72 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
4 changes: 2 additions & 2 deletions src/doc/en/faq/faq-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ 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
read the documentation for that command. Similarly, type ``mycmd??``
Expand Down
12 changes: 6 additions & 6 deletions src/doc/en/prep/Intro-Tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,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 :kdb:`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 +379,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 +399,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 +437,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 @@ -450,7 +450,7 @@ 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.
: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
4 changes: 2 additions & 2 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,7 +359,7 @@ 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.

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
14 changes: 7 additions & 7 deletions src/sage/combinat/words/word_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
AUTHORS:
- Franco Saliola (2008-12-17): merged into sage
- Sebastien Labbe (2008-12-17): merged into sage
- Sébastien Labbé (2008-12-17): merged into sage
- Arnaud Bergeron (2008-12-17): merged into sage
- Amy Glen (2008-12-17): merged into sage
- Sébastien Labbé (2009-12-19): Added S-adic words (:trac:`7543`)
USE:
To see a list of all word constructors, type ``words.`` and then press the tab
key. The documentation for each constructor includes information about each
word, which provides a useful reference.
To see a list of all word constructors, type ``words.`` and then press
the :kbd:`Tab` key. The documentation for each constructor includes
information about each word, which provides a useful reference.
REFERENCES:
.. [AC03] \B. Adamczewski, J. Cassaigne, On the transcendence of real
numbers with a regular expansion, J. Number Theory 103 (2003)
27--37.
.. [BmBGL07] \A. Blondin-Masse, S. Brlek, A. Glen, and S. Labbe. On the
.. [BmBGL07] \A. Blondin-Massé, S. Brlek, A. Glen, and S. Labbé. On the
critical exponent of generalized Thue-Morse words. *Discrete Math.
Theor. Comput. Sci.* 9 (1):293--304, 2007.
.. [BmBGL09] \A. Blondin-Masse, S. Brlek, A. Garon, and S. Labbe. Christoffel
.. [BmBGL09] \A. Blondin-Massé, S. Brlek, A. Garon, and S. Labbé. Christoffel
and Fibonacci Tiles, DGCI 2009, Montreal, to appear in LNCS.
.. [Loth02] \M. Lothaire, Algebraic Combinatorics On Words, vol. 90 of
Expand Down Expand Up @@ -351,7 +351,7 @@ class WordGenerator():
.. NOTE::
To see a list of all word constructors, type ``words.`` and then
hit the TAB key. The documentation for each constructor
hit the :kbd:`Tab` key. The documentation for each constructor
includes information about each word, which provides a useful
reference.
Expand Down
6 changes: 4 additions & 2 deletions src/sage/databases/sql_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,10 @@ def get_skeleton(self, check=False):

def query(self, *args, **kwds):
"""
Create a ``SQLQuery`` on this database. For full class details,
type ``SQLQuery?`` and press shift+enter.
Create a ``SQLQuery`` on this database.
For full class details,
type ``SQLQuery?`` and press :kbd:`Shift` + :kbd:`Enter`.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/dynamics/cellular_automata/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
this object is an easy way to discover and quickly create the cellular
automata 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
``cellular_automata.<tab>`` to the see the currently implemented
named cellular automata.
Expand Down
3 changes: 2 additions & 1 deletion src/sage/graphs/graph_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,8 @@ def query(self, query_dict=None, display_cols=None, **kwds):
"""
Create a GraphQuery on this database.
For full class details, type ``GraphQuery?`` and press ``shift+enter``.
For full class details, type ``GraphQuery?``
and press :kbd:`Shift` + :kdb:`Enter`.
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/graph_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ class GraphGenerators():
A list of all graphs and graph structures (other than isomorphism class
representatives) in this database is available via tab completion. Type
"graphs." and then hit the tab key to see which graphs are available.
"graphs." and then hit the :kbd:`Tab` key to see which graphs are available.
The docstrings include educational information about each named
graph with the hopes that this class can be used as a reference.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/groups/groups_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Using tab-completion on this object is an easy way to discover and quickly
create the groups 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
``groups.<tab>`` to the see primary divisions, followed by (for example)
``groups.matrix.<tab>`` to access various groups implemented as sets of matrices.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/interfaces/giac.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
Another important feature of giac is its online help. We can
access this through sage as well. After reading the description of
the command, you can press q to immediately get back to your
the command, you can press :kbd:`q` to immediately get back to your
original prompt.
Incidentally you can always get into a giac console by the
Expand Down
4 changes: 3 additions & 1 deletion src/sage/interfaces/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ def set_seed(self, seed=None):
def interact(self):
r"""
This allows you to interactively interact with the child
interpreter. Press Ctrl-D or type 'quit' or 'exit' to exit and
interpreter.
Press :kbd:`Ctrl` + :kbd:`D` or type 'quit' or 'exit' to exit and
return to Sage.
.. note::
Expand Down
Loading

0 comments on commit 75fa0fd

Please sign in to comment.