-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start python folder to hold code used in theme. Moved pygments stuff …
…to it. Now pygments changes needed to conf.py are minimal, and any updates to pygments will appear in peoples builds with no conf.py edits needed. May help with #5
- Loading branch information
Showing
6 changed files
with
31 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from pygments.style import Style | ||
from pygments.token import Keyword, Name, Comment, String, Error, \ | ||
Number, Operator, Generic, Whitespace | ||
|
||
# https://stackoverflow.com/questions/48615629/how-to-include-pygments-styles-in-a-sphinx-project | ||
|
||
|
||
class OODSStyle(Style): | ||
background_color = "#fbfbfb" | ||
default_style = "" | ||
styles = { | ||
String: "#d9534f" | ||
} | ||
|
||
|
||
def pygments_monkeypatch_style(mod_name, cls): | ||
import sys | ||
import pygments.styles | ||
cls_name = cls.__name__ | ||
mod = type(__import__("os"))(mod_name) | ||
setattr(mod, cls_name, cls) | ||
setattr(pygments.styles, mod_name, mod) | ||
sys.modules["pygments.styles." + mod_name] = mod | ||
from pygments.styles import STYLE_MAP | ||
STYLE_MAP[mod_name] = mod_name + "::" + cls_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,7 @@ | |
|
||
set -e | ||
|
||
export PYTHONPATH=$PYTHONPATH:/vagrant/python | ||
|
||
sphinx-build -a /vagrant/data-standard/docs /out/ | ||
|