-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
125 additions
and
2 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
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,73 @@ | ||
+++ | ||
title = "Syntax highlighting" | ||
+++ | ||
|
||
## Some examples | ||
|
||
### TOML | ||
|
||
```toml | ||
[extra] | ||
custom_url = "$BASE_URL/atom.xml" | ||
|
||
[extra.papermod] | ||
custom_url = "$BASE_URL/atom.xml" | ||
title = "PaperMod" | ||
default_theme = "auto" | ||
theme = "light" | ||
language_direction = "auto" | ||
keywords = ["keyword1", "keyword2", "keyword3"] | ||
disable_theme_toggle = false | ||
show_code_copy_buttons = true | ||
show_reading_time = true | ||
show_word_count = false | ||
show_post_nav_links = true | ||
show_post_meta = true | ||
default_toc_open = false | ||
edit_post_url = "https://github.com/cydave/zola-theme-papermod/tree/master" | ||
copyright = "" | ||
date_format = "%Y-%m-%d" | ||
``` | ||
|
||
|
||
### YAML | ||
|
||
```yaml | ||
- martin: | ||
name: Martin D'vloper | ||
job: Developer | ||
skills: | ||
- python | ||
- perl | ||
- pascal | ||
- tabitha: | ||
name: Tabitha Bitumen | ||
job: Developer | ||
skills: | ||
- lisp | ||
- fortran | ||
- erlang | ||
``` | ||
### With Line Numbers | ||
```python,linenos,linenostart=98 | ||
class MockResponse: | ||
"""Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. | ||
...what? Basically, expose the parsed HTTP headers from the server response | ||
the way `cookielib` expects to see them. | ||
""" | ||
|
||
def __init__(self, headers): | ||
"""Make a MockResponse for `cookielib` to read. | ||
:param headers: a httplib.HTTPMessage or analogous carrying the headers | ||
""" | ||
self._headers = headers | ||
|
||
def info(self): | ||
return self._headers | ||
|
||
def getheaders(self, name): | ||
self._headers.getheaders(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.post-content pre, | ||
.post-content code, | ||
.post-content pre code, | ||
.post-content code table, | ||
.post-content pre table, | ||
.post-content table tr, | ||
.post-content table th, | ||
.post-content table td { | ||
width: 100%; | ||
border: 0; | ||
border-spacing: 0; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.post-content pre, | ||
.post-content pre code { | ||
border-radius: 8px; | ||
} | ||
|
||
|
||
.post-content pre { | ||
width: 100%; | ||
overflow-x: auto; | ||
word-break: break-all; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.post-content pre > code { | ||
margin: 0; | ||
padding: 15px; | ||
display: block; | ||
overflow-x: auto; | ||
word-break: break-all; | ||
} | ||
|
||
.post-content pre code > table { | ||
overflow-x: auto; | ||
word-break: break-all; | ||
} | ||
|
||
|
||
.post-content pre table td:nth-of-type(1) { | ||
text-align: right; | ||
user-select: none; | ||
white-space: nowrap; | ||
padding: 0 26px 0 0px; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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