summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-01-14 12:04:05 +0100
committerache <ache@ache.one>2018-01-14 12:06:07 +0100
commit3bb57d73552635f7884732f5aad878eaf9109672 (patch)
tree26f245b70840ad8c9d88fb0560b50fa42c8c7f35 /makefile
parentCSS optimisation (diff)
New format for the article
Diffstat (limited to 'makefile')
-rw-r--r--makefile55
1 files changed, 19 insertions, 36 deletions
diff --git a/makefile b/makefile
index 0993dd7..bc50fb0 100644
--- a/makefile
+++ b/makefile
@@ -1,53 +1,37 @@
+BASE_HTML=left.htm headers.htm
ALL_ARTICLES=$(wildcard article/*.md)
ALL_ARTICLES_OUT=$(ALL_ARTICLES:.md=.html)
ALL_ARTICLES_INTRO_OUT=$(ALL_ARTICLES:.md=_intro.html)
-BASE_HTML=left.htm headers.htm articles.htm
-all: $(ALL_ARTICLES_OUT) index.html contact/index.html bin/articleFilter bin/introFilter bin/titleFilter
+all: $(ALL_ARTICLES_OUT) $(BASE_HTML) index.html contact/index.html
+article/%.html: article/%.md $(BASE_HTML)
+ cat $< | markdown > ${@:.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 > $@
-bin/titleFilter : src/titleFilter.hs
- mkdir -p bin
- mkdir -p /tmp/titleFilter
- ghc -dynamic $< -isrc -outputdir /tmp/titleFilter -o $@
+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}
+ m4 -D tmpFileNameArticle=${@:.html=.htm} -D linkFileNameArticle=${<:.html=} article/intro.m4 > $@
-
-
-bin/articleFilter: src/articleFilter.hs src/Id.hs
- mkdir -p bin
- mkdir -p /tmp/articleFilter
- ghc -dynamic $< -isrc -outputdir /tmp/articleFilter -o $@
-
-bin/introFilter: src/introFilter.hs src/Id.hs
- mkdir -p bin
- mkdir -p /tmp/introFilter
- ghc -dynamic $< -isrc -outputdir /tmp/introFilter -o $@
-
-
-article/%.html: article/%.md bin/articleFilter bin/titleFilter $(BASE_HTML)
- pandoc --filter bin/articleFilter $< > ${@:.html=.htm}
- m4 -D TITLE_TITLE="`pandoc --filter bin/titleFilter $<`" headers.m4 > ${basename $@}_header.html
- m4 -D tmpFileNameArticle=${@:.html=.htm} -D linkFileNameArticle=${<:.md=.html} -D HEADER_HEADER=${basename $@}_header.html -D CANONIC="/$@" article/article.m4 > $@
-
-contact/index.html: contact/index.md bin/titleFilter
- pandoc $< > ${@:.html=.htm}
- m4 -D TITLE_TITLE="`pandoc --filter bin/titleFilter $<`" headers.m4 > ${basename $@}_header.html
- m4 -D tmpFileNameArticle=${@:.html=.htm} -D linkFileNameArticle=${<:.md=.html} -D HEADER_HEADER=${basename $@}_header.html -D CANONIC="/contact" article/article.m4 > $@
-
-article/%_intro.html: article/%.md bin/introFilter
- pandoc --filter bin/introFilter $< > ${@:.html=.htm}
- m4 -D tmpFileNameArticle=${@:.html=.htm} -D linkFileNameArticle=${<:.md=.html} article/intro.m4 > $@
-
-articles.htm: $(ALL_ARTICLES_INTRO_OUT) bin/introFilter
+articles.htm: $(ALL_ARTICLES_INTRO_OUT)
cat $(ALL_ARTICLES_INTRO_OUT) > $@
+
headers_index.htm:
m4 -D TITLE_TITLE="Licornes, hérissons et renards" -D CANONIC="/" headers.m4 > $@
-index.html: index.m4 $(BASE_HTML) headers_index.htm
+index.html: index.m4 $(BASE_HTML) headers_index.htm articles.htm
m4 $< > $@
+contact/index.html: contact/index.md
+ markdown $< > ${@:.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 > $@
+
left.htm: res/twitterLogo.svg res/mastoLogo.svg res/gitLogo.svg res/acheLogo.svg left.m4
m4 left.m4 > left.htm
@@ -66,7 +50,6 @@ clean:
rm -f headers_index.htm
mrproper: clean
- rm -f bin/*
rm -f index.html
rm -f $(ALL_ARTICLES_OUT)
rm -f $(ALL_ARTICLES_INTRO_OUT)