Move css.inc in main directory, fix wong .PHONY
This commit is contained in:
2
patrick-markdown/.gitignore
vendored
2
patrick-markdown/.gitignore
vendored
@@ -1,2 +1,2 @@
|
|||||||
/*.html
|
/*.html
|
||||||
/assets/css.inc
|
/css.inc
|
||||||
|
@@ -5,7 +5,7 @@ CSS := assets/ghost.css
|
|||||||
ALTCSS := assets/ghost-dark.css assets/ghost-caca.css
|
ALTCSS := assets/ghost-dark.css assets/ghost-caca.css
|
||||||
|
|
||||||
TARGETS := $(patsubst %.md,%.html,$(wildcard *.md))
|
TARGETS := $(patsubst %.md,%.html,$(wildcard *.md))
|
||||||
CSSINC := assets/css.inc
|
CSSINC := css.inc
|
||||||
|
|
||||||
# our main html5 template, mostly taken from :
|
# our main html5 template, mostly taken from :
|
||||||
# https://github.com/jgm/pandoc-templates/blob/master/default.html5
|
# https://github.com/jgm/pandoc-templates/blob/master/default.html5
|
||||||
@@ -22,7 +22,7 @@ TITLE = $(shell sed -n '0,/^#/ s/^[# ]*//p' $1)
|
|||||||
OPTS = --standalone --include-in-header=$(CSSINC) --template=$(TEMPLATE) \
|
OPTS = --standalone --include-in-header=$(CSSINC) --template=$(TEMPLATE) \
|
||||||
--from=gfm --to=html5
|
--from=gfm --to=html5
|
||||||
|
|
||||||
.PHONY: all html clean $(CSSINC)
|
.PHONY: all html clean
|
||||||
|
|
||||||
all: $(CSSINC) html
|
all: $(CSSINC) html
|
||||||
|
|
||||||
@@ -34,10 +34,11 @@ clean:
|
|||||||
|
|
||||||
$(CSSINC): $(CSS) $(ALTCSS)
|
$(CSSINC): $(CSS) $(ALTCSS)
|
||||||
@echo generating $@
|
@echo generating $@
|
||||||
rm -f $@
|
@#echo deps=$^
|
||||||
$(foreach css,$(CSS),$(call ADD_LINE,$(css),stylesheet,$@))
|
@rm -f $@
|
||||||
$(foreach css,$(ALTCSS),$(call ADD_LINE,$(css),alternate stylesheet,$@))
|
@$(foreach css,$(CSS),$(call ADD_LINE,$(css),stylesheet,$@))
|
||||||
|
@$(foreach css,$(ALTCSS),$(call ADD_LINE,$(css),alternate stylesheet,$@))
|
||||||
|
|
||||||
%.html: %.md $(CSSINC)
|
%.html: %.md $(CSSINC)
|
||||||
@echo generating $@
|
@echo generating $@
|
||||||
pandoc $(OPTS) --metadata=title:"$(call TITLE,$<)" -o $@ $<
|
@pandoc $(OPTS) --metadata=title:"$(call TITLE,$<)" -o $@ $<
|
||||||
|
Reference in New Issue
Block a user