diff options
-rw-r--r-- | pandoc.mk | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -25,6 +25,8 @@ docx_from_md_dest_targets = $(docx_from_md:%=$(dest_dir_md)/%) #PANDOC_PREPROCESSOR_CMD ?= cat #PANDOC_PREPROCESSOR_OPTIONS ?= +STRIP_FIRST_EMPTY_LINES ?= sed '/./,$$!d' + # preprocessor on PANDOC_PREPROCESSOR_CMD ?= gpp PANDOC_PREPROCESSOR_OPTIONS ?= -U "" "" "(" "," ")" "(" ")" "\#" "\\" -M "<\#" "\n" " " " " "\n" "(" ")" @@ -88,16 +90,16 @@ docx_md: $(docx_from_md) $(html_from_md): %.html : %.md $(md_fig_files) $(md_configs) $(md_includes) - $(PANDOC_PREPROCESSOR) $< | $(PANDOC_HTML_METADATA) | $(PANDOC) -t html5 $(PANDOC_HTML_OPTIONS) -o $@ + $(PANDOC_PREPROCESSOR) $< | $(STRIP_FIRST_EMPTY_LINES)| $(PANDOC_HTML_METADATA) | $(PANDOC) -t html5 $(PANDOC_HTML_OPTIONS) -o $@ $(tex_from_md): %.tex : %.md $(md_fig_files) $(md_configs) $(md_includes) - $(PANDOC_PREPROCESSOR) $< | $(PANDOC_TEX_METADATA) | $(PANDOC) -t latex $(PANDOC_TEX_OPTIONS) -o $@ + $(PANDOC_PREPROCESSOR) $< | $(STRIP_FIRST_EMPTY_LINES)| $(PANDOC_TEX_METADATA) | $(PANDOC) -t latex $(PANDOC_TEX_OPTIONS) -o $@ $(pdf_from_md): %.pdf : %.md $(md_fig_files) $(md_configs) $(md_includes) - $(PANDOC_PREPROCESSOR) $< | $(PANDOC_PDF_METADATA) | $(PANDOC) $(PANDOC_PDF_OPTIONS) -o $@ + $(PANDOC_PREPROCESSOR) $< | $(STRIP_FIRST_EMPTY_LINES)| $(PANDOC_PDF_METADATA) | $(PANDOC) $(PANDOC_PDF_OPTIONS) -o $@ $(docx_from_md): %.docx : %.md $(md_fig_files) $(md_configs) $(md_includes) - $(PANDOC_PREPROCESSOR) $< | $(PANDOC_DOCX_METADATA) | $(PANDOC) $(PANDOC_DOCX_OPTIONS) -o $@ + $(PANDOC_PREPROCESSOR) $< | $(STRIP_FIRST_EMPTY_LINES)| $(PANDOC_DOCX_METADATA) | $(PANDOC) $(PANDOC_DOCX_OPTIONS) -o $@ install_md_src: $(md_src_dest_targets) install_md_fig_files |