Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add pylake themed stylesheet and syntax highlighting
- Loading branch information
Showing
5 changed files
with
222 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,136 @@ | ||
/* Set color of python role cross references to same as color for links */ | ||
/* pylake logo colors */ | ||
:root { | ||
--gray: #404041; | ||
--mediumgray: #666667; | ||
--dimgray: #afafaf; | ||
--lightgray: #d9d9d9; | ||
--lightestgray: #f0f0f0; | ||
--pink: #f08d97; | ||
--green: #84c175; | ||
--blue: #1dabe3; | ||
--orange: #f8ae4b; | ||
--darkpink: #E74555; | ||
--darkgreen: #599F47; | ||
--darkblue: #1686B2; | ||
--darkorange: #E58508; | ||
--lightpink: #F9CED2; | ||
--lightgreen: #A5D19A; | ||
--mediumblue: #92D7F2; | ||
--lightblue: #C4E9F8; | ||
--lightorange: #FCD4A0; | ||
} | ||
|
||
|
||
div.api-sub-header.docutils.container p { | ||
color: var(--dimgray); | ||
font-size: 0.85em; | ||
margin-top: -2em; | ||
font-family: monospace; | ||
} | ||
|
||
/* Links */ | ||
a { | ||
color: var(--blue); | ||
} | ||
|
||
a:visited { | ||
color: var(--darkblue); | ||
} | ||
|
||
.wy-menu a { | ||
color: var(--lightgray); | ||
} | ||
|
||
/* docs build indicator */ | ||
.rst-versions .rst-current-version { | ||
color: var(--pink); | ||
} | ||
|
||
/* Cross references to same as color for links */ | ||
code.xref.py { | ||
color: #2980b9 !important; | ||
color: var(--blue) !important; | ||
} | ||
|
||
code.xref.any.py { | ||
color: #2980b9 !important; | ||
color: var(--blue) !important; | ||
} | ||
|
||
/* Navigation side bar */ | ||
.wy-side-nav-search { | ||
background-color: var(--blue); | ||
} | ||
|
||
.wy-side-nav-search input[type=text] { | ||
border-color: var(--darkblue); | ||
border-width: 1.5px; | ||
} | ||
|
||
.wy-menu-vertical header, .wy-menu-vertical p.caption { | ||
color: var(--blue); | ||
} | ||
|
||
/* Navigation side bar - version label */ | ||
.wy-side-nav-search>div.version { | ||
color: rgba(255,255,255,0.6); | ||
} | ||
|
||
/* API docs, blocks */ | ||
.rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt { | ||
border-top: solid 5px var(--darkblue) !important; | ||
background-color: var(--lightblue) !important; | ||
width: 100%; | ||
border-radius: 3px; | ||
} | ||
|
||
.rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt { | ||
border-left: solid 3px var(--lightgray) !important; | ||
border-top: 0px !important; | ||
background-color: var(--lightestgray) !important; | ||
padding-right: 25px; | ||
} | ||
|
||
/* inline code */ | ||
.rst-content code.literal { | ||
color: var(--gray); | ||
border-color: var(--lightgray); | ||
background-color: #edf0f2; | ||
border-radius: 3px; | ||
} | ||
|
||
.rst-content code.download { | ||
color: var(--blue); | ||
background-color: rgba(0, 0, 0, 0); | ||
} | ||
|
||
/* code block, outer wrapper */ | ||
.rst-content pre.literal-block, .rst-content div[class^='highlight'] { | ||
border-radius: 3px; | ||
} | ||
|
||
/* note box */ | ||
.rst-content .note .admonition-title { | ||
border-top-right-radius: 3px; | ||
border-top-left-radius: 3px; | ||
background-color: var(--blue); | ||
} | ||
|
||
.rst-content .note { | ||
border-radius: 3px; | ||
background-color: var(--mediumblue); | ||
} | ||
|
||
/* warning box */ | ||
.rst-content .warning .admonition-title { | ||
border-top-right-radius: 3px; | ||
border-top-left-radius: 3px; | ||
background-color: var(--darkpink); | ||
} | ||
|
||
.rst-content .warning { | ||
border-radius: 3px; | ||
background-color: var(--lightpink); | ||
} | ||
|
||
.rst-content .warning a { | ||
color: var(--darkpink); | ||
} |
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,77 @@ | ||
from pygments.style import Style | ||
from pygments.token import ( | ||
Comment, | ||
Error, | ||
Generic, | ||
Name, | ||
Number, | ||
Operator, | ||
String, | ||
Text, | ||
Whitespace, | ||
Keyword, | ||
) | ||
|
||
colors = { | ||
"white": "#ffffff", | ||
"gray": "#404041", | ||
"mediumgray": "#929294", | ||
"lightgray": "#d9d9d9", | ||
"lightestgray": "#f0f0f0", | ||
"pink": "#d30359", | ||
"green": "#569a45", | ||
"blue": "#0049a9", | ||
"orange": "#e06700", | ||
"lightpink": "#f9d1d5", | ||
"lightgreen": "#cee6c8", | ||
"lightblue": "#a5ddf4", | ||
"lightorange": "#fcdfb7", | ||
} | ||
|
||
|
||
class PylakeStyle(Style): | ||
""" | ||
Syntax highlighting with the pylake logo colors | ||
""" | ||
|
||
background_color = colors["lightestgray"] | ||
|
||
styles = { | ||
Comment: f'italic {colors["mediumgray"]}', | ||
Comment.Preproc: "noitalic", | ||
Comment.Special: "bold", | ||
Error: f'bg:{colors["pink"]} {colors["white"]}', | ||
Generic.Deleted: f'border:{colors["pink"]} bg:{colors["lightpink"]}', | ||
Generic.Emph: "italic", | ||
Generic.Error: colors["pink"], | ||
Generic.Heading: f'bold {colors["blue"]}', | ||
Generic.Inserted: "border:{} bg:{}".format(colors["green"], colors["lightgreen"]), | ||
Generic.Output: colors["gray"], | ||
Generic.Prompt: f'bold {colors["blue"]}', | ||
Generic.Strong: "bold", | ||
Generic.Subheading: f'bold {colors["blue"]}', | ||
Generic.Traceback: colors["pink"], | ||
Keyword: f'bold {colors["green"]}', | ||
Keyword.Pseudo: "nobold", | ||
Keyword.Type: colors["pink"], | ||
Name.Attribute: f'italic {colors["blue"]}', | ||
Name.Builtin: f'bold {colors["green"]}', | ||
Name.Class: "underline", | ||
Name.Namespace: f'bold {colors["blue"]}', | ||
Name.Constant: colors["orange"], | ||
Name.Decorator: f'bold {colors["orange"]}', | ||
Name.Entity: f'bold {colors["pink"]}', | ||
Name.Exception: f'bold {colors["pink"]}', | ||
Name.Function: f'bold {colors["orange"]}', | ||
Name.Tag: f'bold {colors["blue"]}', | ||
Number: f'{colors["orange"]}', | ||
Operator: colors["blue"], | ||
Operator.Word: f'bold {colors["blue"]}', | ||
String: f'{colors["pink"]}', | ||
String.Doc: "italic", | ||
String.Escape: f'bold {colors["pink"]}', | ||
String.Other: colors["orange"], | ||
String.Symbol: f'bold {colors["pink"]}', | ||
Text: colors["gray"], | ||
Whitespace: colors["lightestgray"], | ||
} |
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
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