|
8 | 8 | import pathlib |
9 | 9 | import sys |
10 | 10 |
|
| 11 | +from docutils.parsers.rst import roles |
11 | 12 | from sphinx.util import logging as sphinx_logging |
| 13 | +from sphinx.roles import code_role |
12 | 14 |
|
13 | 15 | # -- Project information ----------------------------------------------------- |
14 | 16 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
|
32 | 34 | ] |
33 | 35 |
|
34 | 36 | highlight_language = 'easycrypt' |
| 37 | +default_role = 'easycrypt' |
35 | 38 |
|
36 | 39 | templates_path = ['_templates'] |
37 | | -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 40 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'global.rst'] |
38 | 41 |
|
39 | 42 | # -- EasyCrypt proofs ------------------------------------------------------- |
40 | 43 |
|
|
56 | 59 |
|
57 | 60 | html_theme = 'sphinx_rtd_theme' |
58 | 61 | html_static_path = ['_static'] |
| 62 | +html_css_files = [ |
| 63 | + 'easycrypt.css', |
| 64 | +] |
| 65 | + |
| 66 | +# -- EasyCrypt role ---------------------------------------------------------- |
| 67 | +def _easycrypt_role(name, rawtext, text, lineno, inliner, options=None, content=()): |
| 68 | + options = {} if options is None else options.copy() |
| 69 | + options['language'] = 'easycrypt' |
| 70 | + return code_role(name, rawtext, text, lineno, inliner, options, content) |
| 71 | + |
| 72 | +# -- Setup app --------------------------------------------------------------- |
| 73 | +def setup(app): |
| 74 | + app.add_role('easycrypt', _easycrypt_role) |
0 commit comments