-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4b3d5a
commit 6c35b3d
Showing
12 changed files
with
42 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/cards/*.pdf | ||
/tmp/*.html | ||
/.sass-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,33 @@ | ||
RECIPES = pancakes | ||
|
||
MDS = $(RECIPES:=.md) | ||
JSONS = $(RECIPES:=.json) | ||
FJSONS = $(RECIPES:=.filtered.json) | ||
HTMLS = $(RECIPES:=.html) | ||
PDFS = $(RECIPES:=.pdf) | ||
|
||
master: test.md | ||
pandoc --standalone --output master.json $< | ||
pandoc --standalone --output master.filtered.json --lua-filter recipe.lua $< | ||
|
||
test: test.md master | ||
pandoc --standalone --output test.json $< | ||
php recipe.php < test.json > test.filtered.json | ||
pandoc --standalone --template recipe.html --to html5 --output test.html test.filtered.json | ||
diff -u master.filtered.json test.filtered.json | ||
ASSET_DIR = assets | ||
RECIPE_DIR = recipes | ||
IMAGES_DIR = images | ||
TEMP_DIR = tmp | ||
CARDS_DIR = cards | ||
|
||
CSS_NAME = recipe | ||
SCSS = $(ASSET_DIR)/$(CSS_NAME).scss | ||
CSS = $(ASSET_DIR)/$(CSS_NAME).css | ||
FILTER = $(ASSET_DIR)/recipe.php | ||
CARD_TEMPLATE = $(ASSET_DIR)/recipe.card.html | ||
IMAGE_PATH = ../$(IMAGES_DIR) | ||
|
||
RECIPES = $(wildcard $(RECIPE_DIR)/*.md) | ||
HTMLS = $(patsubst $(RECIPE_DIR)/%.md,$(TEMP_DIR)/%.html,$(RECIPES)) | ||
PDFS = $(patsubst $(RECIPE_DIR)/%.md,$(CARDS_DIR)/%.pdf,$(RECIPES)) | ||
|
||
all: $(PDFS) | ||
|
||
recipe.css: recipe.scss | ||
$(CSS): $(SCSS) | ||
scss $< $@ | ||
|
||
%.json: %.md | ||
pandoc --standalone --output $@ $< | ||
$(TEMP_DIR)/%.html: $(RECIPE_DIR)/%.md $(FILTER) $(CARD_TEMPLATE) | ||
pandoc --standalone --filter $(FILTER) --template $(CARD_TEMPLATE) --variable image_path:$(IMAGE_PATH) --to html5 --output $@ $< | ||
|
||
%.filtered.json: %.json recipe.php | ||
php recipe.php < $< > $@ | ||
|
||
%.html: %.filtered.json recipe.html | ||
pandoc --standalone --template recipe.html --to html5 --output $@ $< | ||
|
||
%.pdf: %.html recipe.css | ||
prince --style recipe.css --output $@ $< | ||
$(CARDS_DIR)/%.pdf: $(TEMP_DIR)/%.html $(CSS) | ||
prince --style $(CSS) --output $@ $< | ||
|
||
clean: | ||
rm -f $(HTMLS) $(PDFS) $(JSONS) $(FJSONS) | ||
rm -f $(HTMLS) $(PDFS) | ||
|
||
.PRECIOUS: $(TEMP_DIR)/%.html | ||
|
||
.PRECIOUS: %.html %.json %.filtered.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Empty file.
File renamed without changes.
Empty file.