mirror of https://github.com/rd235/cado
workaround: fix pandoc/groff/man missing font warnings
This commit is contained in:
parent
70744d6390
commit
5d73f49a17
12
man/Makefile
12
man/Makefile
|
@ -1,10 +1,19 @@
|
||||||
|
MAKEFLAGS += --silent
|
||||||
PANDOC=pandoc
|
PANDOC=pandoc
|
||||||
PANDOCOK := $(shell command -v ${PANDOC} 2> /dev/null)
|
PANDOCOK := $(shell command -v ${PANDOC} 2> /dev/null)
|
||||||
|
PANDOCMINVER=3.1.7
|
||||||
|
|
||||||
|
ifdef PANDOCOK
|
||||||
|
PANDOCVER := $(shell ${PANDOC} -v | head -1 | cut -d ' ' -f 2)
|
||||||
|
PANDOCVEROK := $(shell printf '%s\n' ${PANDOCMINVER} ${PANDOCVER} | sort -C -V; echo $$?)
|
||||||
none:
|
none:
|
||||||
|
endif
|
||||||
|
|
||||||
% : %.md
|
% : %.md
|
||||||
ifdef PANDOCOK
|
ifdef PANDOCOK
|
||||||
|
ifeq (${PANDOCVEROK}, 1)
|
||||||
|
echo "${PANDOC} ${PANDOCVER} < ${PANDOCMINVER}. $@ can create font warnings with man/groff" >/dev/stderr >&2
|
||||||
|
endif
|
||||||
# copy copyright notice
|
# copy copyright notice
|
||||||
grep "^\.\\\\\"" $< > $@ || true
|
grep "^\.\\\\\"" $< > $@ || true
|
||||||
# run pandoc
|
# run pandoc
|
||||||
|
@ -13,6 +22,9 @@ ifdef PANDOCOK
|
||||||
$(eval TITLE := $(shell echo "${BASENAME}\(${SECTION}\)" | tr [:lower:] [:upper:]))
|
$(eval TITLE := $(shell echo "${BASENAME}\(${SECTION}\)" | tr [:lower:] [:upper:]))
|
||||||
$(eval HEADER := "$(shell man ${SECTION} intro | head -1 | sed -e 's/^[^[:blank:]]*[[:blank:]]*//' -e 's/[[:blank:]]*[^[:blank:]]*$$//' )")
|
$(eval HEADER := "$(shell man ${SECTION} intro | head -1 | sed -e 's/^[^[:blank:]]*[[:blank:]]*//' -e 's/[[:blank:]]*[^[:blank:]]*$$//' )")
|
||||||
$(PANDOC) -standalone -M title=${TITLE} -M section=${SECTION} -M header=${HEADER} -M footer=${PANDOC_ORG} -M "date=`date +\"%B %Y\"`" --to man $< >> $@
|
$(PANDOC) -standalone -M title=${TITLE} -M section=${SECTION} -M header=${HEADER} -M footer=${PANDOC_ORG} -M "date=`date +\"%B %Y\"`" --to man $< >> $@
|
||||||
|
# workaround for boldface rendering
|
||||||
|
sed -i -e 's/\\f\[CR\]/\\f\[CB\]/g' $@ || true
|
||||||
|
echo "$@ manpage updated" >/dev/stderr >&2
|
||||||
else
|
else
|
||||||
echo "${PANDOC} is not available. Manpage $@ cannot be updated" >/dev/stderr >&2
|
echo "${PANDOC} is not available. Manpage $@ cannot be updated" >/dev/stderr >&2
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue