Lines Matching +full:sphinx +full:- +full:build

1 """ Sphinx extension for custom HTML processing for PETSc docs """
11 from sphinx import version_info as sphinx_version_info
12 from sphinx.writers.html5 import HTML5Translator
13 from sphinx.application import Sphinx
20 def setup(app: Sphinx) -> None: argument
23 app.connect('builder-inited', _setup_translators)
27 def _check_version(app: Sphinx) -> None: argument
31 print('A custom extension duplicates code from Sphinx %s ' % (sphinx_version_info_source,),
36 def _setup_translators(app: Sphinx) -> None: argument
37 """ Use a mixin strategy to add to the Sphinx HTML translator without overriding
41 Duplicates the approach used here in sphinx-hoverref:
42 https://github.com/readthedocs/sphinx-hoverxref/pull/42
71 A custom HTML translator which overrides methods to add PETSc-specific
78 depending on if the Sphinx build is html or dirhtml
81 def __init__(self, *args: Any) -> None:
87 def _get_manpage_map(self) -> Dict[str,str]:
100 def _add_manpage_links(self, string: str) -> str:
112 # This method consists mostly of code duplicated from Sphinx:
114 def visit_Text(self, node: Text) -> None:
133 self.body.append(' ' * (len(token) - 1) + ' ')
139 # This method consists mostly of code duplicated from Sphinx:
141 def visit_literal_block(self, node: Element) -> None:
143 # most probably a parsed-literal block -- don't highlight
165 CLASS='highlight-%s notranslate' % lang)
169 # This method consists mostly of code duplicated from Sphinx:
172 def visit_literal(self, node: Element) -> None:
191 CLASS="docutils literal highlight highlight-%s" % lang,
196 def htmlmap_to_dict(htmlmap_filename: str) -> Dict[str,str]:
201 …pattern = re.compile(r'man:\+([a-zA-Z_0-9]*)\+\+([a-zA-Z_0-9 .:]*)\+\+\+\+man\+([a-zA-Z_0-9…
212 def dict_complete_links(string_to_link: Dict[str,str], prefix: str = '') -> Dict[str,str]:
214 Prepend a prefix to any links not starting with 'http' so Sphinx will recognize them as URLs
216 def link_string(name: str, link: str, prefix: str) -> str: