aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Ouellette <oue.paul18@gmail.com>2019-05-21 13:37:10 -0400
committerSmallJoker <SmallJoker@users.noreply.github.com>2019-05-21 19:37:10 +0200
commit920bd3b16fd0aaafd9eeb6d8e40310664d1a06dc (patch)
treed52e99bcd2435b6a4d0fe8b2f54f10aff64eb754
parentcfef466d4ef2eee5586bbd8afacc64e4a1939d88 (diff)
downloadminetest-920bd3b16fd0aaafd9eeb6d8e40310664d1a06dc.tar.gz
minetest-920bd3b16fd0aaafd9eeb6d8e40310664d1a06dc.tar.bz2
minetest-920bd3b16fd0aaafd9eeb6d8e40310664d1a06dc.zip
Fix API site build (#8551)
-rwxr-xr-xdoc/mkdocs/build.sh4
-rw-r--r--doc/mkdocs/code_tag.patch31
-rw-r--r--doc/mkdocs/lua_highlight.patch10
3 files changed, 11 insertions, 34 deletions
diff --git a/doc/mkdocs/build.sh b/doc/mkdocs/build.sh
index 48ffbbad1..f4d946874 100755
--- a/doc/mkdocs/build.sh
+++ b/doc/mkdocs/build.sh
@@ -1,9 +1,7 @@
#!/bin/sh -e
-# Patch Pygments and Python-Markdown
-PYGMENTS_FILE=$(pip show pygments | awk '/Location/ { print $2 }')/pygments/formatters/html.py
+# Patch Python-Markdown
MARKDOWN_FILE=$(pip show markdown | awk '/Location/ { print $2 }')/markdown/extensions/codehilite.py
-patch -N -r - $PYGMENTS_FILE code_tag.patch || true
patch -N -r - $MARKDOWN_FILE lua_highlight.patch || true
# Split lua_api.txt on top level headings
diff --git a/doc/mkdocs/code_tag.patch b/doc/mkdocs/code_tag.patch
deleted file mode 100644
index 3148bc2ae..000000000
--- a/doc/mkdocs/code_tag.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-@@ -691,7 +691,7 @@
- yield tup
- yield 0, '</div>\n'
-
-- def _wrap_pre(self, inner):
-+ def _wrap_pre_code(self, inner):
- style = []
- if self.prestyles:
- style.append(self.prestyles)
-@@ -704,10 +704,10 @@
-
- # the empty span here is to keep leading empty lines from being
- # ignored by HTML parsers
-- yield 0, ('<pre' + (style and ' style="%s"' % style) + '><span></span>')
-+ yield 0, ('<pre' + (style and ' style="%s"' % style) + '><code><span></span>')
- for tup in inner:
- yield tup
-- yield 0, '</pre>'
-+ yield 0, '</code></pre>'
-
- def _format_lines(self, tokensource):
- """
-@@ -815,7 +815,7 @@
- individual lines, in custom generators. See docstring
- for `format`. Can be overridden.
- """
-- return self._wrap_div(self._wrap_pre(source))
-+ return self._wrap_div(self._wrap_pre_code(source))
-
- def format_unencoded(self, tokensource, outfile):
- """
diff --git a/doc/mkdocs/lua_highlight.patch b/doc/mkdocs/lua_highlight.patch
index bd97612e5..034a63a33 100644
--- a/doc/mkdocs/lua_highlight.patch
+++ b/doc/mkdocs/lua_highlight.patch
@@ -7,3 +7,13 @@
self.linenums = linenums
self.guess_lang = guess_lang
self.css_class = css_class
+@@ -119,7 +119,8 @@
+ cssclass=self.css_class,
+ style=self.style,
+ noclasses=self.noclasses,
+- hl_lines=self.hl_lines)
++ hl_lines=self.hl_lines,
++ wrapcode=True)
+ return highlight(self.src, lexer, formatter)
+ else:
+ # just escape and build markup usable by JS highlighting libs