File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 3232import os
3333import sys
3434
35+ from sphinx .application import Sphinx
36+ from sphinx .highlighting import lexer_classes
37+
3538
3639sys .path .insert (0 , os .path .abspath ("../src/" ))
3740sys .path .append (os .path .abspath ("./_ext" )) # Required for custom extensions
5154 "sphinx.ext.autosummary" ,
5255 "sphinx.ext.napoleon" ,
5356]
57+ autosummary_generate = True # Turn on sphinx.ext.autosummary
58+ napoleon_google_docstring = True
5459
5560templates_path = ["_templates" ]
5661exclude_patterns = []
6368html_static_path = ["_static" ]
6469html_css_files = ["custom.css" ]
6570pygments_style = "styles.VSCodeDarkPlus"
71+
72+
73+ def setup (app : Sphinx ) -> None :
74+ """Custom sphinx application startup setup."""
75+ from lexer import CustomPythonLexer
76+
77+ app .add_lexer ("python" , CustomPythonLexer )
78+ assert "python" in lexer_classes , "python language not found in registry"
79+ assert lexer_classes ["python" ] == CustomPythonLexer , (
80+ "custom Lexer not found in registry."
81+ )
You can’t perform that action at this time.
0 commit comments