Skip to content
Snippets Groups Projects
Commit 95304d35 authored by Damien Pollet's avatar Damien Pollet :coffee:
Browse files

Check HTML with tidy

Not very useful since we can assume pandoc generates valid HTML, and
tidy's pretty-printer won't do like I want…
parent 785756c4
No related branches found
No related tags found
No related merge requests found
.tidyrc 0 → 100644
# -*- mode: conf-colon; -*-
char-encoding: utf8
doctype: html5
enclose-text: yes
indent-spaces: 2
indent: yes
input-encoding: utf8
logical-emphasis: yes
newline: lf
output-encoding: utf8
output-html: yes
show-body-only: yes
tab-size: 2
tidy-mark: no
uppercase-tags: no
vertical-space: yes
wrap: 0
......@@ -15,13 +15,19 @@ OUT_MARKUP := $(SRC_MARKUP:$(SRC)/%.md=$(OUT)/%.php)
OUT_OTHERS := $(SRC_OTHERS:$(SRC)/%=$(OUT)/%)
OUT_DIRS := $(SRC_DIRS:$(SRC)/%=$(OUT)/%)
.PHONY: build publish clean
.PHONY: build validate publish clean
.DEFAULT_GOAL := build
# Main entry point targets
build : $(OUT_MARKUP) $(OUT_OTHERS) ## Generate publishable files, converting *.md to *.php
validate : ## Validate HTML-like files
for f in $(OUT)/*.php; do \
echo "$$f" ;\
tidy -config .tidyrc -errors -quiet "$$f" ;\
done
publish : | $(OUT)/.git build ## Build then push to the 'public' branch if there are changes
if [ -n "$$(git -C $(OUT) status --porcelain)" ]; then \
cd $(OUT) ;\
......@@ -59,7 +65,11 @@ $(OUT)/% : $(SRC)/% | $$(@D)
cp $< $@
$(OUT)/%.php : $(SRC)/%.md signature.html | $$(@D)
pandoc --output $@ --template signature --from markdown --to html $<
pandoc --template signature --from markdown --to html $< \
| tidy -config .tidyrc -quiet -output $@
$(OUT)/%.tidy : $(OUT)/%.php
tidy -config .tidyrc -quiet -file $@ $<
# Some shell magic to auto-document the main targets. To have a target appear in
# the output, add a short, one-line comment with a double ## on the same line as
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment