<commit_before>#
# HTML.MK --Rules for dealing with HTML files.
#
# Contents:
# md-src: --markdown-specific customisations for the "src" target.
# todo:   --Report unfinished work (identified by keyword comments)
#
$(wwwdir)/%.html:	%.html;	$(INSTALL_FILE) $? $@

%.html:	%.md
	if markdown $*.md >$*-body; then \
	    { echo "<html><body>"; cat $*-body; echo "</body></html>"; } >$@ ; \
	    $(RM) $*-body; \
	fi

%.html:	%.mmd
	multimarkdown $*.mmd > $@

build:	$(MD_SRC:%.md=%.html) $(MMD_SRC:%.mmd=%.html)
#
# md-src: --markdown-specific customisations for the "src" target.
#
src:	md-src
.PHONY:	md-src
md-src:
	$(ECHO_TARGET)
	@mk-filelist -qn MD_SRC *.md
	@mk-filelist -qn MMD_SRC *.mmd

#
# todo: --Report unfinished work (identified by keyword comments)
#
.PHONY: md-todo
todo:	md-todo
md-todo:
	$(ECHO_TARGET)
	@$(GREP) -e TODO -e FIXME -e REVISIT $(MD_SRC) $(MMD_SRC) /dev/null || true<commit_msg>lotsa cleanups<commit_after>#
# MARKDOWN.MK --Rules for dealing with markdown files.
#
# Contents:
# %-md.html: --Rule for converting MD to a "full" HTML document.
# build:     --Create HTML documents from MMD_SRC.
# clean:     --Clean up MMD_SRC derived files.
# src:       --Update MD_SRC, MMD_SRC macros.
# todo:      --Report unfinished work in markdown files.
#
# Remarks:
# The markdown module recognises both "original" markdown files
# (".md"), and "multimarkdown" files (".mmd"), defined by MD_SRC and
# MMD_SRC respectively. MMD files are assumed to create full
# documents, and are created by `build`, using multimarkdown. There
# are pattern rules for converting MD src to HTML, but markdown
# doesn't create a full HTML document, and they aren't built by
# default.
#

$(wwwdir)/%.html:	%.html;	$(INSTALL_FILE) $? $@

%.html:	%.md
	$(ECHO_TARGET)
	markdown $*.md >$@
%.html:	%.mmd
	$(ECHO_TARGET)
	multimarkdown $*.mmd > $@

#
# %-md.html: --Rule for converting MD to a "full" HTML document.
#
%-md.html:	%.md %.html
	$(ECHO_TARGET)
	{ echo "<html><body>"; cat $*.html; echo "</body></html>"; } >$@

#
# build: --Create HTML documents from MMD_SRC.
#
build:	$(MMD_SRC:%.mmd=%.html) cmd-exists[multimarkdown]

#
# clean: --Clean up MMD_SRC derived files.
#
clean:	clean-markdown
.PHONY:	clean-markdown
clean-markdown:
	$(ECHO_TARGET)
	$(RM) $(MMD_SRC:%.mmd=%.html) $(MD_SRC:%-md.md=%.html)


#
# src: --Update MD_SRC, MMD_SRC macros.
#
src:	src-markdown
.PHONY:	src-markdown
src-markdown:
	$(ECHO_TARGET)
	@mk-filelist -qn MD_SRC *.md
	@mk-filelist -qn MMD_SRC *.mmd

#
# todo: --Report unfinished work in markdown files.
#
todo:	todo-markdown
.PHONY: todo-markdown
todo-markdown:
	$(ECHO_TARGET)
	@$(GREP) -e TODO -e FIXME -e REVISIT $(MD_SRC) $(MMD_SRC) /dev/null || true
{'fraction_non_alphanumeric': 0.1801634472511144, 'fraction_numerical': 0.0, 'mean_word_length': 3.6753472222222223, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '76441', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1037, 'n_words': 298}