comparison make/common/ProcessMarkdown.gmk @ 2615:9c70f25ca307

8180472: Pandoc should generate html5 from markdown Reviewed-by: erikj
author ihse
date Wed, 17 May 2017 12:42:58 +0200
parents 481bd01358a9
children
comparison
equal deleted inserted replaced
0:7c8e5661cfd9 1:b43b2e442d0f
34 $1_$2_TARGET_DIR := $$(dir $$($1_$2_OUTPUT_FILE)) 34 $1_$2_TARGET_DIR := $$(dir $$($1_$2_OUTPUT_FILE))
35 ifneq ($$($1_CSS), ) 35 ifneq ($$($1_CSS), )
36 ifneq ($$(findstring http:/, $$($1_CSS)), ) 36 ifneq ($$(findstring http:/, $$($1_CSS)), )
37 $1_$2_CSS_OPTION := --css '$$($1_CSS)' 37 $1_$2_CSS_OPTION := --css '$$($1_CSS)'
38 else 38 else
39 $1_$2_CSS := $$(call RelativePath, $$($1_CSS), $$($1_$2_TARGET_DIR)) 39 $1_$2_CSS := $$(strip $$(call RelativePath, $$($1_CSS), $$($1_$2_TARGET_DIR)))
40 $1_$2_CSS_OPTION := --css '$$($1_$2_CSS)' 40 $1_$2_CSS_OPTION := --css '$$($1_$2_CSS)'
41 endif 41 endif
42 endif 42 endif
43 $1_$2_OPTIONS = $$(shell $$(GREP) _pandoc-options_: $$($1_SRC)/$2 | $$(CUT) -d : -f 2-) 43 $1_$2_OPTIONS = $$(shell $$(GREP) _pandoc-options_: $$($1_SRC)/$2 | $$(CUT) -d : -f 2-)
44 $1_$2_MARKER := $$(subst /,_,$1_$2) 44 $1_$2_MARKER := $$(subst /,_,$1_$2)
49 49
50 $$($1_$2_OUTPUT_FILE): $$($1_SRC)/$2 $$($1_$2_VARDEPS_FILE) 50 $$($1_$2_OUTPUT_FILE): $$($1_SRC)/$2 $$($1_$2_VARDEPS_FILE)
51 $$(call LogInfo, Converting $2 to html) 51 $$(call LogInfo, Converting $2 to html)
52 $$(call MakeDir, $$($1_$2_TARGET_DIR) $$(SUPPORT_OUTPUTDIR)/markdown) 52 $$(call MakeDir, $$($1_$2_TARGET_DIR) $$(SUPPORT_OUTPUTDIR)/markdown)
53 $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER), \ 53 $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER), \
54 $$(PANDOC) $$($1_OPTIONS) -f markdown -t html --standalone \ 54 $$(PANDOC) $$($1_OPTIONS) -f markdown -t html5 --standalone \
55 $$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS) '$$<' -o '$$@') 55 $$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS) '$$<' -o '$$@')
56 ifneq ($$(findstring $$(LOG_LEVEL), debug trace),) 56 ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
57 TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \ 57 TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
58 if [ "x$$$$TOO_LONG_LINES" != x ]; then \ 58 if [ "x$$$$TOO_LONG_LINES" != x ]; then \
59 $$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \ 59 $$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \