Hi Volker,
On Fri, 7 Oct 2022 11:56:41 +0200, Volker Schlecht wrote:
>> I could add difftastic documentation in your port :
>> - files README.md, manual/src/*.md
>> - generate Markdown book (HTML) from md files with mdBook https://
>> github.com/rust-lang/mdBook (needs to create a port first)
>> - install HTML files in do-install section
>
> Sure thing! I planned to look into converting the markdown documentation
> with lowdown, but in a later step - perhaps upstream would even accept a
> patch for a man page.
mdbook tool is already in ports (textproc/mdbook).
You could generate difftastic HTML manual from Markdown files with it.
Could you add this code to your Makefile ?
BUILD_DEPENDS = textproc/mdbook
DOCDIR = ${PREFIX}/share/doc/difftastic/
WRKTMP = ${WRKDIR}/manual_html
# Prepare directory for HTML manual
post-extract:
rm -rf ${WRKTMP}
mkdir ${WRKTMP}
sed -i 's/DFT_VERSION_HERE/${GH_TAGNAME}/g' \
${WRKSRC}/manual/src/introduction.md
sed -i '18,20d' ${WRKSRC}/manual/book.toml
# Build HTML manual with mdBook
post-build:
mdbook build -d ${WRKTMP} ${WRKSRC}/manual
do-install:
${INSTALL_PROGRAM} ${MODCARGO_TARGET_DIR}/release/difft ${PREFIX}/bin/
${INSTALL_DATA_DIR} ${DOCDIR}
cp -r ${WRKTMP}/* ${DOCDIR}
chown -R ${SHAREOWN}:${SHAREGRP} ${DOCDIR}
Laurent