Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison docs/conf.py @ 68:93ade4c595b7
Reorg conf.py: import globally
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 28 Apr 2026 15:21:03 +0200 |
| parents | 414bf3cbb152 |
| children | a861ac4d11fc |
comparison
equal
deleted
inserted
replaced
| 67:3ccfa7f45044 | 68:93ade4c595b7 |
|---|---|
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| 11 import re | 11 import re |
| 12 | 12 |
| 13 sys.path.insert(0, os.path.dirname(os.path.abspath('.'))) | 13 sys.path.insert(0, os.path.dirname(os.path.abspath('.'))) |
| 14 | |
| 15 from pygments_lexer_pseudocode2.algpseudocode import AlgPseudocodeLexer | |
| 16 | |
| 14 | 17 |
| 15 # -- Project information ----------------------------------------------------- | 18 # -- Project information ----------------------------------------------------- |
| 16 # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | 19 # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
| 17 | 20 |
| 18 project = 'Pygments Pseudocode Lexer' | 21 project = 'Pygments Pseudocode Lexer' |
| 56 #pygments_style = "sphinx" | 59 #pygments_style = "sphinx" |
| 57 pygments_style = "default" | 60 pygments_style = "default" |
| 58 | 61 |
| 59 | 62 |
| 60 def setup(app): | 63 def setup(app): |
| 64 # | |
| 61 # Add a custom lexer: AlgPseudocodeLexer with custom init option "no_end" | 65 # Add a custom lexer: AlgPseudocodeLexer with custom init option "no_end" |
| 62 from pygments_lexer_pseudocode2.algpseudocode import AlgPseudocodeLexer | |
| 63 | |
| 64 # Given lexer must be callable: also use an indirection with "partial" | 66 # Given lexer must be callable: also use an indirection with "partial" |
| 67 # | |
| 65 app.add_lexer("NoEndAlgPseudocode", | 68 app.add_lexer("NoEndAlgPseudocode", |
| 66 functools.partial(AlgPseudocodeLexer, no_end=True)) | 69 functools.partial(AlgPseudocodeLexer, no_end=True)) |
