-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage-scripts.yml
50 lines (45 loc) · 1.56 KB
/
package-scripts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
scripts:
# Delete then create output directory
setup: rm -rf ./dist && shx mkdir -p ./dist
# Build temporary partial templates, then build final markup
build: nps build:data build:markup
# Build temporary data from source data
# FAQ: Prefix temporary data with underscore, to identify them
# as temporary (also, add underscore pattern to `.gitignore`)
# Via `csvtojson` convert data from `.csv` to `.json`
build:data: nps build:data:presentations
build:data:presentations: >-
csvtojson
--noheader=false
--headers='[
"timestamp",
"submitter",
"webpage",
"name",
"date",
"place",
"authors",
"link",
"event_name",
"event_loc"
]'
assets/presentations.csv > assets/_presentations.json
# Build final markup
# Build all (`nps build:…`)
# Import partial template(s) (`-p ….mustache`)
# Apply data into template, then ouput to… (`….json ….mustache >`)
# Final markup file (`….html`)
build:markup: >-
nps build:markup:presentations:research
&& nps build:markup:presentations:weteachcs
build:markup:presentations:research: >-
mustache
./bin/manipulate-for-research.js ./templates/presentations.mustache >
./dist/presentations-for-research.html
build:markup:presentations:weteachcs: >-
mustache
./bin/manipulate-for-weteachcs.js ./templates/presentations.mustache >
./dist/presentations-for-weteachcs.html
report: echo "Copy relevant markup from './dist/___.html"
# Delete temporary files
clean: rm ./assets/_*.*