File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ( function ( ) {
2+ function dedent ( text ) {
3+ const lines = text . replace ( / \s + $ / u, "" ) . split ( "\n" ) ;
4+ const indents = lines
5+ . filter ( ( line ) => line . trim ( ) )
6+ . map ( ( line ) => line . match ( / ^ \s * / u) [ 0 ] . length ) ;
7+
8+ if ( ! indents . length ) {
9+ return text ;
10+ }
11+
12+ const indent = Math . min ( ...indents ) ;
13+ return lines . map ( ( line ) => line . slice ( indent ) ) . join ( "\n" ) ;
14+ }
15+
16+ function normalizeMermaidBlocks ( ) {
17+ document . querySelectorAll ( "pre.mermaid" ) . forEach ( ( block ) => {
18+ block . textContent = dedent ( block . textContent ) ;
19+ } ) ;
20+ }
21+
22+ if ( document . readyState === "loading" ) {
23+ document . addEventListener ( "DOMContentLoaded" , normalizeMermaidBlocks , {
24+ once : true ,
25+ } ) ;
26+ } else {
27+ normalizeMermaidBlocks ( ) ;
28+ }
29+ } ) ( ) ;
Original file line number Diff line number Diff line change 4848pygments_style , pygments_dark_style = "sphinx" , "monokai"
4949html_static_path = ["_static" ]
5050html_css_files = ["custom.css" ]
51- html_js_files = ["rtd-search.js" ]
51+ html_js_files = ["mermaid-normalize.js" , " rtd-search.js" ]
5252html_favicon = "_static/virtualenv.svg"
5353html_theme_options = {
5454 "light_logo" : "virtualenv.png" ,
You can’t perform that action at this time.
0 commit comments