Skip to content
Permalink
Browse files

ENH: Configurable highlight style (#38)

* Refac: Atom One Light hljs style & css tweaks

* Revert: CSS previous changes. Only keep 12px code

* Add: configurable hljs style. Fixes #34

* Rename config.mako option to `hljs_style`
  • Loading branch information...
KyleKing authored and kernc committed Feb 25, 2019
1 parent 24a561c commit 5c3c8b1b6172600359ef5249aa17f6efd1c1cdc9
Showing with 8 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +4 −0 pdoc/templates/config.mako
  3. +1 −0 pdoc/templates/css.mako
  4. +2 −1 pdoc/templates/html.mako
@@ -1,5 +1,6 @@
dist
build
*.eggs/*
*.egg-info
*.py[cod]

@@ -5,4 +5,8 @@
extract_module_toc_into_sidebar = True
list_class_variables_in_index = True
sort_identifiers = True
# Set the style keyword such as 'atom-one-light' or 'github-gist'
# Options: https://github.com/highlightjs/highlight.js/tree/master/src/styles
# Demo: https://highlightjs.org/static/demo/
hljs_style = 'github'
%>
@@ -213,6 +213,7 @@
margin: 0;
}
.source pre code {
font-size: 12px;
overflow: visible;
}
.hlist {
@@ -25,6 +25,7 @@
extract_module_toc_into_sidebar = getattr(config.attr, 'extract_module_toc_into_sidebar', True)
list_class_variables_in_index = getattr(config.attr, 'list_class_variables_in_index', False)
sort_identifiers = getattr(config.attr, 'sort_identifiers', True)
hljs_style = getattr(config.attr, 'hljs_style', 'github')
link = getattr(config.attr, 'link', link)
to_html = getattr(config.attr, 'to_html', to_html)
@@ -350,7 +351,7 @@
<link href='https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css' rel='stylesheet'>
<link href='https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/8.0.0/sanitize.min.css' rel='stylesheet'>
% if show_source_code:
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/${hljs_style}.min.css" rel="stylesheet">
%endif

<%namespace name="css" file="css.mako" />

0 comments on commit 5c3c8b1

Please sign in to comment.
You can’t perform that action at this time.