-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_md.jl
executable file
·46 lines (33 loc) · 950 Bytes
/
make_md.jl
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
#!/usr/bin/env julia
"make the markdown file for specified card set"
function make_md(card_set)
path = "cards/$card_set.md"
nrdb_link = "https://netrunnerdb.com/en/card/"
cap_card_set = ucfirst(card_set)
markdown_str = """
---
layout: default
title: $cap_card_set
permalink: /cards/$card_set/
---
# $cap_card_set
{% for card_data in site.data.$card_set %}
## {{ card_data.name }}
[Card #{{ card_data.id }}]($nrdb_link{{ card_data.id }})
{% highlight clojure %}
{{ card_data.code }}
{% endhighlight %}
{% endfor %}
"""
open(path, "w") do f
write(f, markdown_str)
end
end
# Make markdown files for each card set
card_sets = ["agendas", "assets", "operations", "upgrades", "ice",
"events", "programs", "icebreakers", "resources", "hardware",
"identities"]
for card_set in card_sets
make_md(card_set)
end
println("Produced Markdown for $(length(card_sets)) card sets")