From dd1905454b033fcc1fe5e4b39dbcdac9ce82c68b Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Fri, 14 Jan 2022 11:08:58 -0500 Subject: [PATCH] fix doc building. Thanks to Jonas Smedegaard. --- CHANGELOG.rst | 4 +++- Makefile | 3 +++ gitlab-math.lua | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 gitlab-math.lua diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c953666..c4b8fa9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,5 @@ Changes in `3.2.10 `_ -========================================================================= +=========================================================================== This release includes no change since 3.2.9, but is created to be able to publish again the Android library on MavenCentral. @@ -113,11 +113,13 @@ Changes in `3.1.5 `_ This release includes the following changes since 3.1.4: * Build improvements: + * Fix CMake handling when installing in a non-standard location. Thanks to Alexey Rusakov. * Add support in the Makefile for creating a WASM-ready archive. Thanks to stoically. * Improve support for LLVM is Makefile. Thanks to caywin25 for reporting. + * Add a TypeScript definition file. * Some documentation and example fixes. * Add list of bindings to the README. diff --git a/Makefile b/Makefile index 3995546..ed94974 100644 --- a/Makefile +++ b/Makefile @@ -401,6 +401,9 @@ $(BUILD_DIR)/fuzzers/fuzz_%_msan: fuzzing/fuzzers/fuzz_%.cpp $(FUZZER_MSAN_OBJEC %.html: %.rst rst2html $< $@ +%.html: %.md + pandoc --from markdown --to html5 --standalone --lua-filter gitlab-math.lua --katex -o $@ $< + ### dependencies -include $(RELEASE_OBJECTS:.o=.d) diff --git a/gitlab-math.lua b/gitlab-math.lua new file mode 100644 index 0000000..822eca6 --- /dev/null +++ b/gitlab-math.lua @@ -0,0 +1,17 @@ +function Math(el) + if el.mathtype == "InlineMath" then + if el.text:sub(1,1) == '`' and el.text:sub(#el.text) == '`' then + local text = el.text:sub(2,#el.text-1) + return pandoc.Math(el.mathtype, text) + else + local cont = pandoc.read(el.text) + return { pandoc.Str("$") } .. cont.blocks[1].content .. { pandoc.Str("$") } + end + end +end + +function CodeBlock(el) + if el.classes[1] == "math" then + return pandoc.Para({ pandoc.Math("DisplayMath", el.text) }) + end +end \ No newline at end of file