# Makefile for generating "manual.txt" and "manual.pdf" from "manual.pmd" using pandoc # Copyright (C) 2022 # # Requires a recent version of pandoc, plus pandoc-tablenos, xelatex and various other packages - see "README" # .svg images generated by "zint_images.sh" SOURCE = manual.pmd OUT_PDF = manual.pdf OUT_TXT = manual.txt INC_HEADER_PDF = inc_header_pdf.tex INC_BEFORE_BODY_PDF = inc_before_body_pdf.tex INCLUDES_PDF = $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) INC_PDF = --include-in-header $(INC_HEADER_PDF) --include-before-body $(INC_BEFORE_BODY_PDF) INCLUDES_TXT = inc_header_txt.tex INC_TXT = --include-in-header $(INCLUDES_TXT) SOURCE_MAN_PAGE = zint.1.pmd OUT_MAN_PAGE = zint.1 IMAGES = \ images/zint.png \ images/zint-qt.png \ images/gui_main.png \ images/gui_menus.png \ images/gui_composite.png \ images/gui_segs.png \ images/gui_aztec.png \ images/gui_appearance.png \ images/gui_colour.png \ images/gui_data_dialog.png \ images/gui_sequence.png \ images/gui_export.png \ images/gui_cli_equivalent.png \ images/gui_black_eye.png \ images/gui_white_eye.png \ images/gui_swap.png \ images/pdf417_heightperrow.svg \ images/code128_box.svg \ images/qrcode_box.svg \ images/code128_green.svg \ images/code128_green_alpha.svg \ images/code128_rotate90.svg \ images/datamatrix_euro.svg \ images/datamatrix_big5.svg \ images/qrcode_binary_utf8.svg \ images/codeone_s_dotty.svg \ images/aztec_segs.svg \ images/datamatrix_structapp.svg \ images/code128_small_bold.svg \ images/code11.svg \ images/c25standard.svg \ images/c25iata.svg \ images/c25ind.svg \ images/c25inter.svg \ images/c25logic.svg \ images/itf14.svg \ images/itf14_border0.svg \ images/dpleit.svg \ images/dpident.svg \ images/upca.svg \ images/upca_5.svg \ images/upce.svg \ images/eanx13.svg \ images/eanx5.svg \ images/eanx8_5.svg \ images/isbnx.svg \ images/plessey.svg \ images/msi_plessey.svg \ images/telepen.svg \ images/telepen_num.svg \ images/code39.svg \ images/excode39.svg \ images/code93.svg \ images/pzn.svg \ images/logmars.svg \ images/code32.svg \ images/hibc_39.svg \ images/vin.svg \ images/codabar.svg \ images/pharma.svg \ images/code128.svg \ images/code128b.svg \ images/gs1_128.svg \ images/ean14.svg \ images/nve18.svg \ images/hibc_128.svg \ images/dpd.svg \ images/dbar_omn.svg \ images/dbar_truncated.svg \ images/dbar_ltd.svg \ images/dbar_exp.svg \ images/koreapost.svg \ images/channel.svg \ images/code128_stacked.svg \ images/code128_stacked_sep2.svg \ images/codablockf.svg \ images/code16k.svg \ images/pdf417.svg \ images/pdf417comp.svg \ images/micropdf417.svg \ images/dbar_stk.svg \ images/dbar_omnstk.svg \ images/dbar_expstk.svg \ images/code49.svg \ images/eanx_cc_a.svg \ images/eanx_cc_b.svg \ images/gs1_128_cc_c.svg \ images/pharma_two.svg \ images/postnet.svg \ images/planet.svg \ images/auspost.svg \ images/ausroute.svg \ images/ausreply.svg \ images/ausredirect.svg \ images/kix.svg \ images/rm4scc.svg \ images/mailmark.svg \ images/usps_imail.svg \ images/japanpost.svg \ images/hibc_dm.svg \ images/qrcode.svg \ images/microqr.svg \ images/rmqr.svg \ images/upnqr.svg \ images/maxicode.svg \ images/aztec.svg \ images/azrune.svg \ images/codeone.svg \ images/gridmatrix.svg \ images/dotcode.svg \ images/hanxin.svg \ images/ultra.svg \ images/fim.svg \ images/flat.svg \ images/daft_rm4scc.svg MAIN_FONT = mainfont="TeX Gyre Pagella" MONO_FONT = monofont="Liberation Mono" CJK_FONT = CJKmainfont="WenQuanYi Micro Hei Mono" PDF_OPTS = --pdf-engine=xelatex --filter pandoc-tablenos -M tablenos-warning-level=0 \ --highlight-style=haddock -V colorlinks -V geometry:margin=20mm -V papersize=a4 -V csquotes=true --dpi=300 TEX_MAN_PAGE = zint.1.tex TXT_OPTS = --filter pandoc-tablenos -M tablenos-warning-level=0 --columns 80 --eol=lf -t plain MAN_PAGE_OPTS = -s -t man all : $(OUT_PDF) $(OUT_TXT) $(OUT_MAN_PAGE) $(OUT_PDF) : $(SOURCE) $(SOURCE_MAN_PAGE) $(HIGHLIGHT_THEME) $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) $(IMAGES) Makefile pandoc $(SOURCE_MAN_PAGE) -f markdown \ $(PDF_OPTS) \ -o $(TEX_MAN_PAGE) sed -i -e 's/section{/subsection{/' $(TEX_MAN_PAGE) # Convert man page sections to subsections pandoc $(SOURCE) -f markdown $(INC_PDF) --toc --toc-depth=4 \ -V $(MAIN_FONT) -V $(MONO_FONT) -V $(CJK_FONT) -V block-headings \ $(PDF_OPTS) \ --include-after-body $(TEX_MAN_PAGE) \ -o $(OUT_PDF) $(OUT_TXT) : $(SOURCE) $(SOURCE_MAN_PAGE) $(INCLUDES_TXT) Makefile pandoc $(SOURCE) $(SOURCE_MAN_PAGE) -f markdown $(INC_TXT) --toc --toc-depth=4 \ -V $(MAIN_FONT) -V $(MONO_FONT) -V $(CJK_FONT) \ $(TXT_OPTS) \ -o $(OUT_TXT) # Indent Man Page sections in TOC and remove trailing spaces sed -i \ -e 's/^\(- [A-Z][A-Z ]*\)$$/ \1/' \ -e 's/ *$$//' \ $(OUT_TXT) $(OUT_MAN_PAGE) : $(SOURCE_MAN_PAGE) Makefile pandoc $(SOURCE_MAN_PAGE) -f markdown \ $(MAN_PAGE_OPTS) \ -o $(OUT_MAN_PAGE)