From 1892cd9a603e1eda206c40efb576bd75b7532be6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 23 Feb 2016 06:32:03 +0100 Subject: md2html: Do syntax highlighting too --- filters/html-converters/md2html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'filters') 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(''' ''') print("
") # 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("
") -- cgit v1.2.3 From d88ec849c4f7af41a8a41af1a4f79a2b4d41717a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 24 Feb 2016 18:01:42 +0100 Subject: Hosted on HTTPS now --- filters/gentoo-ldap-authentication.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'filters') diff --git a/filters/gentoo-ldap-authentication.lua b/filters/gentoo-ldap-authentication.lua index fce5632..6d8eb3e 100644 --- a/filters/gentoo-ldap-authentication.lua +++ b/filters/gentoo-ldap-authentication.lua @@ -4,7 +4,7 @@ -- luacrypto >= 0.3 -- -- lualdap >= 1.2 --- +-- -- -- cgit v1.2.3 From 7d51120440346108aad74f007431ad65b307f6d7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 17 Jun 2016 12:27:10 +0200 Subject: md2html: use utf-8 and flush output buffer Otherwise we get the classic Python UTF-8 errors, and the text is all out of order. While we're at it, switch to python3 so we only have to support one set of oddball semantics. Signed-off-by: Jason A. Donenfeld Suggested-by: Daniel Campbell --- filters/html-converters/md2html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'filters') diff --git a/filters/html-converters/md2html b/filters/html-converters/md2html index c8ee7d9..ebf3856 100755 --- a/filters/html-converters/md2html +++ b/filters/html-converters/md2html @@ -1,7 +1,11 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import markdown +import sys +import io from pygments.formatters import HtmlFormatter -print(''' +sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') +sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') +sys.stdout.write(''' ''') -print("
") +sys.stdout.write("
") +sys.stdout.flush() # Note: you may want to run this through bleach for sanitization 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("
") +sys.stdout.write("
") -- cgit v1.2.3