Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/_static/easycrypt.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* Keep EasyCrypt inline role neutral (inherit text color). */
code.easycrypt,
code.code.easycrypt,
code.code.highlight.easycrypt,
span.easycrypt,
span.code.easycrypt,
span.code.highlight.easycrypt {
color: inherit;
}
16 changes: 16 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import pathlib
import sys

from docutils.parsers.rst import roles
from sphinx.util import logging as sphinx_logging
from sphinx.roles import code_role

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Expand All @@ -32,6 +34,7 @@
]

highlight_language = 'easycrypt'
default_role = 'easycrypt'

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
Expand All @@ -56,3 +59,16 @@

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_css_files = [
'easycrypt.css',
]

# -- EasyCrypt role ----------------------------------------------------------
def _easycrypt_role(name, rawtext, text, lineno, inliner, options=None, content=()):
options = {} if options is None else options.copy()
options['language'] = 'easycrypt'
return code_role(name, rawtext, text, lineno, inliner, options, content)

# -- Setup app ---------------------------------------------------------------
def setup(app):
app.add_role('easycrypt', _easycrypt_role)