Compare commits
No commits in common. "6e96d785030eb35b568e3b1b1ef5d5e689bed83e" and "67b2aa6e457d641e134f2e491153f4d9da09d353" have entirely different histories.
6e96d78503
...
67b2aa6e45
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
*/
|
|
33
Makefile
33
Makefile
@ -1,33 +0,0 @@
|
|||||||
INFILES := $(shell find ./ -name '*.md' -type f)
|
|
||||||
OUTFILES := $(patsubst %.md,%.html,$(INFILES))
|
|
||||||
CLEANFILES = $(shell find ./ -mindepth 2 -name '*.html' -type f)
|
|
||||||
INDEXFILES := $(patsubst %navigation.md,%index.html,$(filter %navigation.md,$(INFILES)))
|
|
||||||
NAVFILES := $(patsubst %navigation.md,%navigation.html,$(filter %navigation.md,$(INFILES)))
|
|
||||||
HEADFILES := $(patsubst %navigation.html,%header.html,$(NAVFILES))
|
|
||||||
SPACE := $(eval) $(eval)
|
|
||||||
|
|
||||||
|
|
||||||
all: $(OUTFILES) $(INDEXFILES) $(HEADFILES) header.txt footer.html
|
|
||||||
|
|
||||||
%navigation.html: %navigation.md
|
|
||||||
sed s/".md"/".html"/ $^ |pandoc -o $*navigation.html
|
|
||||||
|
|
||||||
%header.html: header.txt $(NAVFILES)
|
|
||||||
cat header.txt $(filter ./$(@D)%, $(NAVFILES)) > $@
|
|
||||||
|
|
||||||
%index.html: $(HEADFILES) footer.html
|
|
||||||
cat $(filter ./$(@D)%, $(HEADFILES)) footer.html > $@
|
|
||||||
|
|
||||||
%.html: %.md $(HEADFILES) footer.html
|
|
||||||
sed 's|href="|href="$(subst $(SPACE),,$(patsubst %,../,$(wordlist 2,3,$(subst /, ,$(@D)))))|g' $(filter ./$(word 1, $(subst /, ,$(@D)))/%, $(HEADFILES)) > $(@D)/tmpnav.html
|
|
||||||
cat endnav.txt >> $(@D)/tmpnav.html
|
|
||||||
pandoc --toc -s $(filter %.md,$^) -H head.txt -B $(@D)/tmpnav.html -A footer.html -o $*.html
|
|
||||||
|
|
||||||
header.txt:
|
|
||||||
|
|
||||||
footer.html:
|
|
||||||
|
|
||||||
cleanhtml:
|
|
||||||
rm $(CLEANFILES)
|
|
||||||
|
|
||||||
|
|
14
README.md
14
README.md
@ -1,16 +1,4 @@
|
|||||||
# mdmake
|
# mdmake
|
||||||
|
|
||||||
Petit test en Makefile pour générer un site web statique.
|
Petit test en Makefile pour générer un site web statique.
|
||||||
Utilise pandoc et make
|
Utilise pandoc et make
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## howto
|
|
||||||
```
|
|
||||||
mkdir sitename
|
|
||||||
vi sitename/page.md
|
|
||||||
vi sitename/nav.md
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
pour un peu de custom, ne pas hésiter a changer les fichiers .txt
|
|
@ -1 +0,0 @@
|
|||||||
</nav>
|
|
@ -1,5 +0,0 @@
|
|||||||
</nav>
|
|
||||||
<footer>
|
|
||||||
<p>jeanjack was here</p>
|
|
||||||
</footer>
|
|
||||||
</body></html>
|
|
13
header.txt
13
header.txt
@ -1,13 +0,0 @@
|
|||||||
<header>
|
|
||||||
<div style="font-family: monospace, fixed; font-weight: bold;">
|
|
||||||
<span style="">                                                                      </span><br />
|
|
||||||
<span style="">m     m mmmmm  m    m mmmmm  m    m mmmm   m    m   mm   m    m mmmmmm</span><br />
|
|
||||||
<span style="">#  #  #   #    #  m"    #    ##  ## #   "m ##  ##   ##   #  m"  #     </span><br />
|
|
||||||
<span style="">" #"# #   #    #m#      #    # ## # #    # # ## #  #  #  #m#    #mmmmm</span><br />
|
|
||||||
<span style=""> ## ##"   #    #  #m    #    # "" # #    # # "" #  #mm#  #  #m  #     </span><br />
|
|
||||||
<span style=""> #   #  mm#mm  #   "m mm#mm  #    # #mmm"  #    # #    # #   "m #mmmmm</span><br />
|
|
||||||
<span style="">                                                                      </span><br />
|
|
||||||
<span style="">                                                                      </span><br />
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<nav>
|
|
Loading…
Reference in New Issue
Block a user