Skip to content

Commit

Permalink
Merge pull request #12 from pganssle/custom_highlighting
Browse files Browse the repository at this point in the history
Custom syntax highlighting
  • Loading branch information
dploeger authored Jul 10, 2018
2 parents 582835b + 8460dd7 commit fa2ad92
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ You can configure almost any reveal.js setting using the _config.yml-settings fi
You can also further customize the presentation:

* extra_css: Additional CSS files added after the reveal theme []
* highlight_style_sheet: CSS theme for highlight.js [reveal.js/lib/css/zenburn.css]

## Custom reveal.js-themes

Expand Down
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ reveal_theme_path: reveal.js/css/theme/
# Additional custom CSS paths
extra_css:

# Custom CSS for highlighting (defaults to reveal.js/lib/css/zenburn.css)
highlight_style_sheet:

# Embed Server-side speaker notes?
reveal_notes_server: false

Expand Down
7 changes: 6 additions & 1 deletion _layouts/reveal.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
{% endif %}

<!-- For syntax highlighting -->
<link rel="stylesheet" href="{{ site.reveal_path }}lib/css/zenburn.css">
{% if site.highlight_style_sheet %}
{% assign highlight_style_sheet = site.highlight_style_sheet %}
{% else %}
{% capture highlight_style_sheet %}{{ site.reveal_path }}lib/css/zenburn.css {% endcapture %}
{% endif %}
<link rel="stylesheet" href="{{ highlight_style_sheet }}">

<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
Expand Down
17 changes: 17 additions & 0 deletions _posts/0000-01-06-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
With syntax highlighting for your code:

```python
import pprint

class MyClass(object):
def __init__(self):
self.a = 1

@classmethod
def some_classmethod(cls, a):
self.a = a

if __name__ == "__main__":
# This is a comment
pprint.pprint({'Key1': 0x34, 'Key2': 'Hi'})
```
File renamed without changes.

0 comments on commit fa2ad92

Please sign in to comment.