annotate docs/intro.rst @ 140:e424fcdd472f

REFACTOR: Change the structure of the documentation: make the README the first page. Make the old "index" an intro.
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 07 May 2026 10:03:32 +0200
parents docs/index.rst@69283c05ba48
children acd9073cbbe3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
86
0c05dc09c9e2 Customize documentation index and prepare for a "Details" documentation page.
Franz Glasner <fzglas.hg@dom66.de>
parents: 45
diff changeset
1 .. -*- coding: utf-8; indent-tabs-mode: nil; -*-
0c05dc09c9e2 Customize documentation index and prepare for a "Details" documentation page.
Franz Glasner <fzglas.hg@dom66.de>
parents: 45
diff changeset
2
45
6ac1ea5d2d4a Begin documentation: add the Sphinx generated configuration as-is
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
3
140
e424fcdd472f REFACTOR: Change the structure of the documentation: make the README the first page.
Franz Glasner <fzglas.hg@dom66.de>
parents: 138
diff changeset
4 Introduction
e424fcdd472f REFACTOR: Change the structure of the documentation: make the README the first page.
Franz Glasner <fzglas.hg@dom66.de>
parents: 138
diff changeset
5 ============
107
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
6
137
d43d66060819 Wording in docs
Franz Glasner <fzglas.hg@dom66.de>
parents: 127
diff changeset
7 The package contains the following lexers:
d43d66060819 Wording in docs
Franz Glasner <fzglas.hg@dom66.de>
parents: 127
diff changeset
8
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
9 .. list-table::
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
10 :align: left
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
11 :header-rows: 1
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
12
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
13 * - Language Name
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
14 - Description
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
15 - Extension(s)
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
16 - Aliases / Short Name(s)
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
17 - Lexer Class
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
18
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
19 * - AlgPseudocode
138
69283c05ba48 Make the table of lexers in the docs identical again.
Franz Glasner <fzglas.hg@dom66.de>
parents: 137
diff changeset
20 - Pseudocode lexer heavily inspired by CTAN's "Algpseudocodex"
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
21 - \*.algpseudocode, \*.algpseudo
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
22 - algpseudocode, algpseudo
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
23 - AlgPseudocodeLexer
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
24
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
25 * - AlgPseudocodeFR
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
26 - AlgPseudocode with french keyword expansion
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
27 - \*.algpseudo-fr, \*.algpseudocode-fr
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
28 - algpseudocode-fr, algpseudo-fr
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
29 - AlgPseudocodeLexer_FR
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
30
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
31 * - AlgPseudocodeDE
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
32 - AlgPseudocode with german keyword expansion
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
33 - \*.algpseudo-de, \*.algpseudocode-de
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
34 - algpseudocode-de, algpseudo-de
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
35 - AlgPseudocodeLexer_DE
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
36
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
37 * - FrPseudocode
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
38 - The original lexer (slightly changed) from `pygments-lexer-pseudocode`
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
39 - \*.fr-algo, \*.fr-pseudocode
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
40 - fr-pseudocode, fr-pseudo, fr-algorithm, fr-algo
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
41 - FrPseudocodeLexer
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
42
140
e424fcdd472f REFACTOR: Change the structure of the documentation: make the README the first page.
Franz Glasner <fzglas.hg@dom66.de>
parents: 138
diff changeset
43 They may be used in Sphinx by their aliases:
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
44
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
45 .. code-block:: none
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
46
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
47 .. code-block:: algpseudocode
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
48
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
49 \PROGRAM {The Pseudoprogram} \IS
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
50
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
51 \END PROGRAM {The Pseudoprogram}
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
52
140
e424fcdd472f REFACTOR: Change the structure of the documentation: make the README the first page.
Franz Glasner <fzglas.hg@dom66.de>
parents: 138
diff changeset
53 It will be rendered as:
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
54
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
55 .. code-block:: algpseudocode
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
56
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
57 \PROGRAM {The Pseudoprogram} \IS
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
58
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
59 \END PROGRAM {The Pseudoprogram}
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
60
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
61 And the same with the german variant:
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
62
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
63 .. code-block:: algpseudocode-de
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
64
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
65 \PROGRAM {The Pseudoprogram} \IS
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
66
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
67 \END PROGRAM {The Pseudoprogram}
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
68
107
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
69 Expressions:
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
70
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
71 - Strings (single-quote, double-quote, triple-single-quote, triple-double-quote)
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
72 - Numbers (Python style)
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
73 - ``\TEXT{...}``
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
74
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
75 The curly brace can be quoted with ``\}`` to not end the text mode
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
76
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
77 - Names (`Name.Entity`)
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
78
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
79 .. literalinclude:: example-1.pseudocode
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
80 :language: algpseudocode
107
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
81 :lines: 2-
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
82
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
83 With a customized `AlgPseudocodeLexer` and its `no_end`
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
84 option set to ``True``.
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
85
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
86 .. literalinclude:: example-1.pseudocode
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
87 :language: NoEndAlgPseudocode
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
88 :lines: 2-
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
89
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
90 Python:
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
91
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
92 .. code-block:: python
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
93
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
94 class HUHU:
86
0c05dc09c9e2 Customize documentation index and prepare for a "Details" documentation page.
Franz Glasner <fzglas.hg@dom66.de>
parents: 45
diff changeset
95
107
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
96 # This is a comment
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
97 @classmethod
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
98 def method1(cls_, aparam1, param2):
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
99 return aparam1 + param2
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
100
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
101
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
102 This is Wikipedia's description of *Dinic's Algorithm*
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
103 (see https://en.wikipedia.org/wiki/Dinic%27s_algorithm):
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
104
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
105 .. literalinclude:: algorithm-dinic.description
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
106 :language: algpseudocode
107
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
107 :lines: 2-
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
108
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
109 This is Wikipedia's pseudocode of the *Ford–Fulkerson Algorithm*
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
110 (see https://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm):
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
111
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
112 .. literalinclude:: algorithm-ford-fulkerson.pseudocode
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
113 :language: algpseudocode
107
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
114 :lines: 2-
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
115
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
116 This is Wikipedia's pseudocode of the *Edmonds–Karp Algorithm*
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
117 (see https://en.wikipedia.org/wiki/Edmonds%E2%80%93Karp_algorithm):
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
118
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
119 .. literalinclude:: algorithm-edmonds-karp.pseudocode
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
120 :language: NoEndAlgPseudocode
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
121 :lines: 2-
107
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
122
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
123 And now the *Edmonds–Karp Algorithm* with french keywords:
107
1c1985532139 A couple of real pseudocode examples.
Franz Glasner <fzglas.hg@dom66.de>
parents: 86
diff changeset
124
125
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
125 .. literalinclude:: algorithm-edmonds-karp.pseudocode
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
126 :language: algpseudocode-fr
3629bf09b30d Much more documentation including most details of the AlgPseudocodeLexer
Franz Glasner <fzglas.hg@dom66.de>
parents: 107
diff changeset
127 :lines: 2-