63 $1_$2_CSS := $$(strip $$(call RelativePath, $$($1_CSS), $$($1_$2_TARGET_DIR)))
64 $1_$2_CSS_OPTION := --css '$$($1_$2_CSS)'
65 endif
66 endif
67
68 $1_$2_OPTIONS := $$(shell $$(GREP) _pandoc-options_: $3/$2 | $$(CUT) -d : -f 2-)
69
70 ifneq ($$($1_FILTER), )
71 $1_$2_OPTIONS += --filter $$($1_FILTER)
72 endif
73
74 $1_$2_VARDEPS := $$($1_OPTIONS) $$($1_$2_OPTIONS) $$($1_CSS) \
75 $$($1_REPLACEMENTS) $$($1_POST_PROCESS)
76 $1_$2_VARDEPS_FILE := $$(call DependOnVariable, $1_$2_VARDEPS, \
77 $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER).vardeps)
78
79 $$($1_$2_PANDOC_OUTPUT): $$($1_$2_PANDOC_INPUT) $$($1_$2_VARDEPS_FILE) $$($1_EXTRA_DEPS)
80 $$(call LogInfo, Converting $2 to $$($1_FORMAT))
81 $$(call MakeDir, $$(SUPPORT_OUTPUTDIR)/markdown $$(dir $$($1_$2_PANDOC_OUTPUT)))
82 $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER), \
83 $$(PANDOC) $$($1_OPTIONS) -f markdown-smart -t $$($1_FORMAT) --standalone \
84 $$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS) '$$($1_$2_PANDOC_INPUT)' \
85 -o '$$($1_$2_PANDOC_OUTPUT)')
86 ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
87 TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
88 if [ "x$$$$TOO_LONG_LINES" != x ]; then \
89 $$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \
90 $$(ECHO) "The following lines are longer than 80 characters:" ; \
91 $$(GREP) -E -n -e '^.{80}.+$$$$' $$< || true ; \
92 fi
93 endif
94
95 # If we have no post processing, PANDOC_OUTPUT is set to OUTPUT_FILE. Otherwise
96 # PANDOC_OUTPUT is a temporary file, and we must now create the real OUTPUT_FILE.
97 ifneq ($$($1_POST_PROCESS), )
98 $$($1_$2_OUTPUT_FILE): $$($1_$2_PANDOC_OUTPUT)
99 $$(call LogInfo, Post-processing markdown file $2)
100 $$(call MakeDir, $$(SUPPORT_OUTPUTDIR)/markdown $$($1_$2_TARGET_DIR))
101 $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER)_post, \
102 $$($1_POST_PROCESS) < $$($1_$2_PANDOC_OUTPUT) > $$($1_$2_OUTPUT_FILE))
103 endif
|
63 $1_$2_CSS := $$(strip $$(call RelativePath, $$($1_CSS), $$($1_$2_TARGET_DIR)))
64 $1_$2_CSS_OPTION := --css '$$($1_$2_CSS)'
65 endif
66 endif
67
68 $1_$2_OPTIONS := $$(shell $$(GREP) _pandoc-options_: $3/$2 | $$(CUT) -d : -f 2-)
69
70 ifneq ($$($1_FILTER), )
71 $1_$2_OPTIONS += --filter $$($1_FILTER)
72 endif
73
74 $1_$2_VARDEPS := $$($1_OPTIONS) $$($1_$2_OPTIONS) $$($1_CSS) \
75 $$($1_REPLACEMENTS) $$($1_POST_PROCESS)
76 $1_$2_VARDEPS_FILE := $$(call DependOnVariable, $1_$2_VARDEPS, \
77 $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER).vardeps)
78
79 $$($1_$2_PANDOC_OUTPUT): $$($1_$2_PANDOC_INPUT) $$($1_$2_VARDEPS_FILE) $$($1_EXTRA_DEPS)
80 $$(call LogInfo, Converting $2 to $$($1_FORMAT))
81 $$(call MakeDir, $$(SUPPORT_OUTPUTDIR)/markdown $$(dir $$($1_$2_PANDOC_OUTPUT)))
82 $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER), \
83 $$(PANDOC) $$($1_OPTIONS) -f markdown$$(PANDOC_DISABLE_EXTENSIONS_FLAG) \
84 -t $$($1_FORMAT) --standalone \
85 $$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS) '$$($1_$2_PANDOC_INPUT)' \
86 -o '$$($1_$2_PANDOC_OUTPUT)')
87 ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
88 TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
89 if [ "x$$$$TOO_LONG_LINES" != x ]; then \
90 $$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \
91 $$(ECHO) "The following lines are longer than 80 characters:" ; \
92 $$(GREP) -E -n -e '^.{80}.+$$$$' $$< || true ; \
93 fi
94 endif
95
96 # If we have no post processing, PANDOC_OUTPUT is set to OUTPUT_FILE. Otherwise
97 # PANDOC_OUTPUT is a temporary file, and we must now create the real OUTPUT_FILE.
98 ifneq ($$($1_POST_PROCESS), )
99 $$($1_$2_OUTPUT_FILE): $$($1_$2_PANDOC_OUTPUT)
100 $$(call LogInfo, Post-processing markdown file $2)
101 $$(call MakeDir, $$(SUPPORT_OUTPUTDIR)/markdown $$($1_$2_TARGET_DIR))
102 $$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/markdown/$$($1_$2_MARKER)_post, \
103 $$($1_POST_PROCESS) < $$($1_$2_PANDOC_OUTPUT) > $$($1_$2_OUTPUT_FILE))
104 endif
|