summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-02-06 05:27:25 +0100
committerache <ache@ache.one>2018-02-06 05:27:25 +0100
commit2aea371b5eb5b473fbfb5cadeb24d0bdb6a5647d (patch)
treed983ecf67977f37100e3cc7102cf37c630ccda5d /makefile
parentNew format for the article (diff)
HTML5 compatible tools
Diffstat (limited to 'makefile')
-rw-r--r--makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/makefile b/makefile
index bc50fb0..cbc1401 100644
--- a/makefile
+++ b/makefile
@@ -1,4 +1,6 @@
+MD_CMD=remark --rc-path remarkrc
+CATCH_CMD=pup
BASE_HTML=left.htm headers.htm
ALL_ARTICLES=$(wildcard article/*.md)
ALL_ARTICLES_OUT=$(ALL_ARTICLES:.md=.html)
@@ -7,14 +9,14 @@ ALL_ARTICLES_INTRO_OUT=$(ALL_ARTICLES:.md=_intro.html)
all: $(ALL_ARTICLES_OUT) $(BASE_HTML) index.html contact/index.html
article/%.html: article/%.md $(BASE_HTML)
- cat $< | markdown > ${@:.html=.htm}
+ cat $< | ${MD_CMD} > ${@:.html=.htm}
m4 -D TITLE_TITLE="`echo Licornes, hérissons et renards`" headers.m4 > ${basename $@}_header.html
m4 -D tmpFileNameArticle=${@:.html=.htm} -D linkFileNameArticle=${<:.md=} -D HEADER_HEADER=${basename $@}_header.html -D CANONIC="/$@" article/article.m4 > $@
article/%_intro.html: article/%.html
- cat $< | hxselect "h1" > ${@:.html=.htm}
- cat $< | hxselect "h1+p" | sed 's/res\//article\/res\//' >> ${@:.html=.htm}
- cat $< | hxselect "h1+p+p" >> ${@:.html=.htm}
+ cat $< | ${CATCH_CMD} "h1" > ${@:.html=.htm}
+ cat $< | ${CATCH_CMD} "h1 + p" | sed 's/res\//article\/res\//' >> ${@:.html=.htm}
+ cat $< | ${CATCH_CMD} "h1 + p + p" >> ${@:.html=.htm}
m4 -D tmpFileNameArticle=${@:.html=.htm} -D linkFileNameArticle=${<:.html=} article/intro.m4 > $@
articles.htm: $(ALL_ARTICLES_INTRO_OUT)
@@ -28,7 +30,7 @@ index.html: index.m4 $(BASE_HTML) headers_index.htm articles.htm
m4 $< > $@
contact/index.html: contact/index.md
- markdown $< > ${@:.html=.htm}
+ ${MD_CMD} $< > ${@:.html=.htm}
m4 -D TITLE_TITLE="`grep h1 ${@:.html=.htm} | cut -d'>' -f 2 | cut -d'<' -f 1`" headers.m4 > ${basename $@}_header.html
m4 -D tmpFileNameArticle=${@:.html=.htm} -D linkFileNameArticle=${<:.md=} -D HEADER_HEADER=${basename $@}_header.html -D CANONIC="/contact" article/article.m4 > $@