about summary refs log tree commit diff
path: root/filters/html-converters/md2html
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-02-23 06:32:03 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-02-23 15:00:05 +0100
commit1892cd9a603e1eda206c40efb576bd75b7532be6 (patch)
tree05d6ad5f434cbe2493fb2625b9bd0d34912b0a9c /filters/html-converters/md2html
parentgit: update to v2.7.2 (diff)
downloadcgit-pink-1892cd9a603e1eda206c40efb576bd75b7532be6.tar.gz
cgit-pink-1892cd9a603e1eda206c40efb576bd75b7532be6.zip
md2html: Do syntax highlighting too
Diffstat (limited to 'filters/html-converters/md2html')
-rwxr-xr-xfilters/html-converters/md2html6
1 files changed, 5 insertions, 1 deletions
diff --git a/filters/html-converters/md2html b/filters/html-converters/md2html
index 67141ba..c8ee7d9 100755
--- a/filters/html-converters/md2html
+++ b/filters/html-converters/md2html
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 import markdown
+from pygments.formatters import HtmlFormatter
 print('''
 <style>
 .markdown-body {
@@ -277,9 +278,12 @@ print('''
     background-color: transparent;
     border: none;
 }
+''')
+print(HtmlFormatter(style='pastie').get_style_defs('.highlight'))
+print('''
 </style>   
 ''')
 print("<div class='markdown-body'>")
 # Note: you may want to run this through bleach for sanitization
-markdown.markdownFromFile(output_format="html5")
+markdown.markdownFromFile(output_format="html5", extensions=["markdown.extensions.fenced_code", "markdown.extensions.codehilite", "markdown.extensions.tables"], extension_configs={"markdown.extensions.codehilite":{"css_class":"highlight"}})
 print("</div>")
02Split tile access and modifyJune McEnroe 2017-08-01Madvise RANDOM and NOSYNCJune McEnroe 2017-07-31Fix removing clients from clientCastJune McEnroe 2017-07-31Build with debug infoJune McEnroe 2017-07-31Don't dump tiles in coreJune McEnroe 2017-07-31Use designated initializers for messagesJune McEnroe I did not realize this syntax was so powerful. 2017-07-31Show other clients' cursorsJune McEnroe Also unfuck removing on send failure. 2017-07-31Perform enter as two moves rather than a loopJune McEnroe 2017-07-31Track tile access countsJune McEnroe 2017-07-31Adjust move speed in clientJune McEnroe 2017-07-31Handle large movesJune McEnroe 2017-07-30Optimize builds for chrootJune McEnroe 2017-07-30Persist bright across color changesJune McEnroe 2017-07-30Add index.htmlJune McEnroe 2017-07-30Add snapshot.shJune McEnroe 2017-07-30Fix termcap patch for background colorsJune McEnroe 2017-07-30Update helpJune McEnroe 2017-07-30Fix help to track colorJune McEnroe 2017-07-30Support background colorsJune McEnroe 2017-07-30Track color only client-sideJune McEnroe 2017-07-30Add ostensible support for background colorsJune McEnroe 2017-07-30Add tile create and access timestampsJune McEnroe 2017-07-30Assert stable struct Tile field offsetsJune McEnroe 2017-07-30Add chroot.shJune McEnroe 2017-07-30Add ` commandJune McEnroe 2017-07-30Add sshd_configJune McEnroe 2017-07-30Add termcap patchJune McEnroe