Use Pygments for syntax highlighting

This commit is contained in:
Florian Bruhin 2017-10-26 22:42:55 +02:00
parent d7dac40c2c
commit dc01b4eaf0
2 changed files with 6 additions and 2 deletions

View File

@ -37,6 +37,8 @@ Changed
~~~~~~~
- High-DPI favicons are now used when available.
- The `asciidoc2html.py` script now uses Pygments (which is already a dependency
of qutebrowser) instead of `source-highlight` for syntax highlighting.
Fixed
~~~~~

View File

@ -89,6 +89,7 @@ class AsciiDoc:
("http://qutebrowser.org/img/cheatsheet-small.png",
"qute://help/img/cheatsheet-small.png")
]
asciidoc_args = ['-a', 'source-highlighter=pygments']
for src, dst in files:
src_basename = os.path.basename(src)
@ -99,7 +100,7 @@ class AsciiDoc:
for orig, repl in replacements:
line = line.replace(orig, repl)
modified_f.write(line)
self.call(modified_src, dst)
self.call(modified_src, dst, *asciidoc_args)
def _copy_images(self):
"""Copy image files to qutebrowser/html/doc."""
@ -180,7 +181,8 @@ class AsciiDoc:
with open(modified_src, 'w+', encoding='utf-8') as final_version:
final_version.write(title + "\n\n" + header + current_lines)
asciidoc_args = ['--theme=qute', '-a toc', '-a toc-placement=manual']
asciidoc_args = ['--theme=qute', '-a toc', '-a toc-placement=manual',
'-a', 'source-highlighter=pygments']
self.call(modified_src, dst, *asciidoc_args)
def _build_website(self):