diff options
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 55 |
1 files changed, 19 insertions, 36 deletions
@@ -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) |