Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
diff docs/index.rst @ 125:3629bf09b30d
Much more documentation including most details of the AlgPseudocodeLexer
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 06 May 2026 16:59:44 +0200 |
| parents | 1c1985532139 |
| children | e91c9dcbeb77 |
line wrap: on
line diff
--- a/docs/index.rst Wed May 06 16:12:17 2026 +0200 +++ b/docs/index.rst Wed May 06 16:59:44 2026 +0200 @@ -8,9 +8,70 @@ :maxdepth: 2 :caption: Contents: + readme details +.. list-table:: + :align: left + :header-rows: 1 + + * - Language Name + - Description + - Extension(s) + - Aliases / Short Name(s) + - Lexer Class + + * - AlgPseudocode + - Pseudocode with inspirations from CTAN's "Algpseudocodex" + - \*.algpseudocode, \*.algpseudo + - algpseudocode, algpseudo + - AlgPseudocodeLexer + + * - AlgPseudocodeFR + - AlgPseudocode with french keyword expansion + - \*.algpseudo-fr, \*.algpseudocode-fr + - algpseudocode-fr, algpseudo-fr + - AlgPseudocodeLexer_FR + + * - AlgPseudocodeDE + - AlgPseudocode with german keyword expansion + - \*.algpseudo-de, \*.algpseudocode-de + - algpseudocode-de, algpseudo-de + - AlgPseudocodeLexer_DE + + * - FrPseudocode + - The original lexer (slightly changed) from `pygments-lexer-pseudocode` + - \*.fr-algo, \*.fr-pseudocode + - fr-pseudocode, fr-pseudo, fr-algorithm, fr-algo + - FrPseudocodeLexer + +To be used in Sphinx like this: + +.. code-block:: none + + .. code-block:: algpseudocode + + \PROGRAM {The Pseudoprogram} \IS + + \END PROGRAM {The Pseudoprogram} + +would be rendered as: + +.. code-block:: algpseudocode + + \PROGRAM {The Pseudoprogram} \IS + + \END PROGRAM {The Pseudoprogram} + +And the same with the german variant: + +.. code-block:: algpseudocode-de + + \PROGRAM {The Pseudoprogram} \IS + + \END PROGRAM {The Pseudoprogram} + Expressions: - Strings (single-quote, double-quote, triple-single-quote, triple-double-quote) @@ -22,7 +83,7 @@ - Names (`Name.Entity`) .. literalinclude:: example-1.pseudocode - :language: AlgPseudocode + :language: algpseudocode :lines: 2- With a customized `AlgPseudocodeLexer` and its `no_end` @@ -48,14 +109,14 @@ (see https://en.wikipedia.org/wiki/Dinic%27s_algorithm): .. literalinclude:: algorithm-dinic.description - :language: AlgPseudocode + :language: algpseudocode :lines: 2- This is Wikipedia's pseudocode of the *Ford–Fulkerson Algorithm* (see https://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm): .. literalinclude:: algorithm-ford-fulkerson.pseudocode - :language: AlgPseudocode + :language: algpseudocode :lines: 2- This is Wikipedia's pseudocode of the *Edmonds–Karp Algorithm* @@ -63,20 +124,13 @@ .. literalinclude:: algorithm-edmonds-karp.pseudocode :language: NoEndAlgPseudocode - :lines: 2- + :lines: 2- -.. todo:: +And now the *Edmonds–Karp Algorithm* with french keywords: - Note how - https://stackoverflow.com/questions/11413203/sphinx-pygments-lexer-filter-extension - documents dynamic lexer and style creation for Pygments within Sphinx. - - Examples: - - - Load lexers with some custom (init) options - - Dynamically create new lexers, styles, formatters or filters - -.. todolist:: +.. literalinclude:: algorithm-edmonds-karp.pseudocode + :language: algpseudocode-fr + :lines: 2- Indices and tables
