comparison 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
comparison
equal deleted inserted replaced
139:d8ac51cba0ff 140:e424fcdd472f
1 .. -*- coding: utf-8; indent-tabs-mode: nil; -*-
2
3
4 Introduction
5 ============
6
7 The package contains the following lexers:
8
9 .. list-table::
10 :align: left
11 :header-rows: 1
12
13 * - Language Name
14 - Description
15 - Extension(s)
16 - Aliases / Short Name(s)
17 - Lexer Class
18
19 * - AlgPseudocode
20 - Pseudocode lexer heavily inspired by CTAN's "Algpseudocodex"
21 - \*.algpseudocode, \*.algpseudo
22 - algpseudocode, algpseudo
23 - AlgPseudocodeLexer
24
25 * - AlgPseudocodeFR
26 - AlgPseudocode with french keyword expansion
27 - \*.algpseudo-fr, \*.algpseudocode-fr
28 - algpseudocode-fr, algpseudo-fr
29 - AlgPseudocodeLexer_FR
30
31 * - AlgPseudocodeDE
32 - AlgPseudocode with german keyword expansion
33 - \*.algpseudo-de, \*.algpseudocode-de
34 - algpseudocode-de, algpseudo-de
35 - AlgPseudocodeLexer_DE
36
37 * - FrPseudocode
38 - The original lexer (slightly changed) from `pygments-lexer-pseudocode`
39 - \*.fr-algo, \*.fr-pseudocode
40 - fr-pseudocode, fr-pseudo, fr-algorithm, fr-algo
41 - FrPseudocodeLexer
42
43 They may be used in Sphinx by their aliases:
44
45 .. code-block:: none
46
47 .. code-block:: algpseudocode
48
49 \PROGRAM {The Pseudoprogram} \IS
50
51 \END PROGRAM {The Pseudoprogram}
52
53 It will be rendered as:
54
55 .. code-block:: algpseudocode
56
57 \PROGRAM {The Pseudoprogram} \IS
58
59 \END PROGRAM {The Pseudoprogram}
60
61 And the same with the german variant:
62
63 .. code-block:: algpseudocode-de
64
65 \PROGRAM {The Pseudoprogram} \IS
66
67 \END PROGRAM {The Pseudoprogram}
68
69 Expressions:
70
71 - Strings (single-quote, double-quote, triple-single-quote, triple-double-quote)
72 - Numbers (Python style)
73 - ``\TEXT{...}``
74
75 The curly brace can be quoted with ``\}`` to not end the text mode
76
77 - Names (`Name.Entity`)
78
79 .. literalinclude:: example-1.pseudocode
80 :language: algpseudocode
81 :lines: 2-
82
83 With a customized `AlgPseudocodeLexer` and its `no_end`
84 option set to ``True``.
85
86 .. literalinclude:: example-1.pseudocode
87 :language: NoEndAlgPseudocode
88 :lines: 2-
89
90 Python:
91
92 .. code-block:: python
93
94 class HUHU:
95
96 # This is a comment
97 @classmethod
98 def method1(cls_, aparam1, param2):
99 return aparam1 + param2
100
101
102 This is Wikipedia's description of *Dinic's Algorithm*
103 (see https://en.wikipedia.org/wiki/Dinic%27s_algorithm):
104
105 .. literalinclude:: algorithm-dinic.description
106 :language: algpseudocode
107 :lines: 2-
108
109 This is Wikipedia's pseudocode of the *Ford–Fulkerson Algorithm*
110 (see https://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm):
111
112 .. literalinclude:: algorithm-ford-fulkerson.pseudocode
113 :language: algpseudocode
114 :lines: 2-
115
116 This is Wikipedia's pseudocode of the *Edmonds–Karp Algorithm*
117 (see https://en.wikipedia.org/wiki/Edmonds%E2%80%93Karp_algorithm):
118
119 .. literalinclude:: algorithm-edmonds-karp.pseudocode
120 :language: NoEndAlgPseudocode
121 :lines: 2-
122
123 And now the *Edmonds–Karp Algorithm* with french keywords:
124
125 .. literalinclude:: algorithm-edmonds-karp.pseudocode
126 :language: algpseudocode-fr
127 :lines: 2-