Skip to content
Snippets Groups Projects
Commit 4e912b32 authored by Albert Gräf's avatar Albert Gräf
Browse files

gendoc: Add a test to figure out how to invoke python-markdown.

parent ce76b2d0
No related branches found
No related tags found
1 merge request!839Gem on the Mac
...@@ -8,6 +8,12 @@ $(addprefix Welcome-, Linux Darwin MINGW) ...@@ -8,6 +8,12 @@ $(addprefix Welcome-, Linux Darwin MINGW)
markdown = $(addsuffix .md, $(targets)) markdown = $(addsuffix .md, $(targets))
html = $(addsuffix .html, $(targets)) html = $(addsuffix .html, $(targets))
# python -m markdown setup. We may need to invoke python as python3 on systems
# which still have python2 as the default. You can also set this manually by
# passing python-markdown=python-markdown-command to make if python-markdown
# gets invoked in an unusual way.
python-markdown = $(shell python3 -m markdown 2>/dev/null < /dev/null && echo python3 -m markdown || echo python -m markdown)
# Note: This requires special tools (python-markdown, awk). # Note: This requires special tools (python-markdown, awk).
all: html all: html
...@@ -20,7 +26,7 @@ ReadMe-%.md: ReadMe.md ...@@ -20,7 +26,7 @@ ReadMe-%.md: ReadMe.md
ReadMe-%.html: osname = $(patsubst ReadMe-%.html,%,$@) ReadMe-%.html: osname = $(patsubst ReadMe-%.html,%,$@)
ReadMe-%.html: ReadMe-%.md pandoc-template.html ReadMe-%.html: ReadMe-%.md pandoc-template.html
python -m markdown $< > ReadMe-body.html $(python-markdown) $< > ReadMe-body.html
sed -e "s/@version@/$(version) ($(osname))/g" -e '/--stylesheet--/r gh-pandoc.css' -e '/--body--/r ReadMe-body.html' pandoc-template.html > $@ sed -e "s/@version@/$(version) ($(osname))/g" -e '/--stylesheet--/r gh-pandoc.css' -e '/--body--/r ReadMe-body.html' pandoc-template.html > $@
rm -f ReadMe-body.html rm -f ReadMe-body.html
...@@ -30,7 +36,7 @@ Welcome-%.md: Welcome.md ...@@ -30,7 +36,7 @@ Welcome-%.md: Welcome.md
Welcome-%.html: osname = $(patsubst Welcome-%.html,%,$@) Welcome-%.html: osname = $(patsubst Welcome-%.html,%,$@)
Welcome-%.html: Welcome-%.md pandoc-template.html Welcome-%.html: Welcome-%.md pandoc-template.html
python -m markdown $< > Welcome-body.html $(python-markdown) $< > Welcome-body.html
sed -e "s/@version@/$(version) ($(osname))/g" -e '/--stylesheet--/r gh-pandoc.css' -e '/--body--/r Welcome-body.html' pandoc-template.html > $@ sed -e "s/@version@/$(version) ($(osname))/g" -e '/--stylesheet--/r gh-pandoc.css' -e '/--body--/r Welcome-body.html' pandoc-template.html > $@
rm -f Welcome-body.html rm -f Welcome-body.html
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment