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+ """Strip citation labels ([Aba21]) from bibliography entries."""
2+
3+ import docutils .nodes
4+ from sphinx .transforms .post_transforms import SphinxPostTransform
5+
6+
7+ class StripCitationLabels (SphinxPostTransform ):
8+ default_priority = 6 # runs right after BibliographyTransform (priority 5)
9+
10+ def run (self ):
11+ for node in self .document .findall (docutils .nodes .citation ):
12+ for label in node .findall (docutils .nodes .label ):
13+ label .parent .remove (label )
14+ for para in node .findall (docutils .nodes .paragraph ):
15+ para .insert (0 , docutils .nodes .Text ("\u2022 " ))
16+ break
17+
18+
19+ def setup (app ):
20+ app .add_post_transform (StripCitationLabels )
21+ return {"version" : "0.1" , "parallel_read_safe" : True , "parallel_write_safe" : True }
Original file line number Diff line number Diff line change 1+ /* Hanging indent for bibliography entries with bullet markers */
2+ .citation [role = "doc-biblioentry" ] p {
3+ padding-left : 1em ;
4+ text-indent : -1em ;
5+ }
Original file line number Diff line number Diff line change 1515from causalpy .version import __version__
1616
1717sys .path .insert (0 , os .path .abspath ("../" ))
18+ sys .path .insert (0 , os .path .join (os .path .dirname (__file__ ), "_extensions" ))
1819
1920# autodoc_mock_imports
2021# This avoids autodoc breaking when it can't find packages imported in the code.
7475 "sphinx_design" ,
7576 "sphinx_sitemap" ,
7677 "sphinx_togglebutton" ,
78+ "strip_citation_labels" ,
7779]
7880
7981nb_execution_mode = "off"
154156
155157html_theme = "labs_sphinx_theme"
156158html_static_path = ["_static" ]
159+ html_css_files = ["custom.css" ]
157160html_extra_path = ["robots.txt" ]
158161html_favicon = "_static/favicon_logo.png"
159162# Theme options are theme-specific and customize the look and feel of a theme
You can’t perform that action at this time.
0 commit comments