Eval

Provide setup() to sphinx.

sphinxcontrib.eval.eval_bash(input: str) str[source]

Eval bash.

Parameters:

input (str) –

Return type:

str

sphinxcontrib.eval.eval_python(input: str) str[source]

Eval python.

Parameters:

input (str) –

Return type:

str

sphinxcontrib.eval.eval_sh(input: str) str[source]

Eval sh.

Parameters:

input (str) –

Return type:

str

sphinxcontrib.eval.setup(app: Sphinx) dict[str, Any][source]

Set up.

Parameters:

app (Sphinx) –

Return type:

dict[str, Any]

MyST

Provide MystEvalParser.

RST

Provide RSTEvalParser.

Utilities

sphinxcontrib.eval.utils.get_lang_map(template: str, eval_funcs: dict[str, Callable[[str], str]]) dict[str, tuple[Pattern, Callable[[str], str]]][source]

Get lang map.

Parameters:
  • template (str) –

  • eval_funcs (dict[str, Callable[[str], str]]) –

Return type:

dict[str, tuple[re.Pattern, Callable[[str], str]]]

sphinxcontrib.eval.utils.patch_parser(template: str, parser: type[Parser]) type[Parser][source]

Patch parser.

Parameters:
  • template (str) –

  • parser (Type[Parser]) –

Return type:

Type[Parser]

sphinxcontrib.eval.utils.replace(inputstring: str, pat: Pattern, eval_func: Callable[[str], str]) str[source]

Replace.

Parameters:
  • inputstring (str) –

  • pat (re.Pattern) –

  • eval_func (Callable[[str], str]) –

Return type:

str