asciidoctor-p2e 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.adoc +231 -24
- data/lib/asciidoctor-p2e/assets/divider.png +0 -0
- data/lib/asciidoctor-p2e/assets/p2e.css +62 -7
- data/lib/asciidoctor-p2e/assets/parchment.jpg +0 -0
- data/lib/asciidoctor-p2e/{statblock.html.erb → creatureblock.html.erb} +2 -2
- data/lib/asciidoctor-p2e/extension.rb +19 -6
- data/lib/asciidoctor-p2e/hazardblock.html.erb +43 -0
- data/lib/asciidoctor-p2e/itemblock.html.erb +86 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a103cf94f96f6ae10dd251af9eb40aa7ad2f2ec45b1d01de2155b0d3cf7d013c
|
4
|
+
data.tar.gz: 71a7dbc42f3a8de6befa20b0a234dac79f13867afa36057497d24e8fcf1f9ef8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dcb56644246651eb48fc1fc9309623fbaf2a3b582b3d58be4de5b6ebc1c88ff7daa18adb9b94e71a9c5f491de4afbfed5ef9612f3540833174fb7167e8d6a1e
|
7
|
+
data.tar.gz: c9ed56689d67652e6c68f3de7b20b74b32336fe786fbee7faa4842c6b8a158815edb36d409b92251fac84a262ddc053669f4c2b9bb21c3df04a2c15eb3a1cbec
|
data/README.adoc
CHANGED
@@ -10,16 +10,17 @@ https://asciidoctor.org/[Asciidoctor]! asciidoctor-p2e is an
|
|
10
10
|
https://docs.asciidoctor.org/asciidoctor/latest/extensions/[extension] for
|
11
11
|
AsciiDoctor that makes it easier to create stylized content for the
|
12
12
|
https://paizo.com/pathfinder[Pathfinder Second Edition roleplaying system].
|
13
|
-
Your years of searching are at an end, for this extension supports
|
14
|
-
stat blocks,
|
15
|
-
Pathfinder-style headers. All of which will
|
13
|
+
Your years of searching are at an end, for this extension supports creature
|
14
|
+
stat blocks, item stat blocks, hazard stat blocks, a stylized Table of
|
15
|
+
Contents, decorated Sidebars, and Pathfinder-style headers. All of which will
|
16
|
+
be demonstrated in cloying detail!
|
16
17
|
|
17
18
|
You can find the git repo for this project in the mystical realm of SourceHut:
|
18
19
|
https://git.sr.ht/~bosco/asciidoctor-p2e, a fantastic forge of free software
|
19
20
|
also known to the old ones as
|
20
21
|
https://drewdevault.com/2018/11/15/sr.ht-general-availability.html[Sir Hat].
|
21
22
|
|
22
|
-
==
|
23
|
+
== Usage
|
23
24
|
|
24
25
|
This extension is archived in the scrolls of
|
25
26
|
https://rubygems.org/gems/asciidoctor-p2e[RubyGems] and can be added to your
|
@@ -30,14 +31,27 @@ inventory with the `gem install asciidoctor-p2e` command. Once the
|
|
30
31
|
NOTE: Images and assets will be installed/referenced in a `p2e` directory
|
31
32
|
wherever your output is created.
|
32
33
|
|
33
|
-
==
|
34
|
+
== Style
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
Zero level headers will use a yellow outline Eczar font and first level headers
|
37
|
+
will use the Eczar font. This styling is from the
|
38
|
+
https://www.gmbinder.com/share/-LxQNtitjvBT2eCVkPt1[GM Binder Pathfinder 2nd
|
39
|
+
Edition Homebrew Template]. Fonts are included with `asciidoctor-p2e` and will
|
40
|
+
be installed in the `p2e` directory when your output is created. The body of
|
41
|
+
the document uses a parchment background.
|
42
|
+
|
43
|
+
As you can see on the left, if the Table of Contents is used (`:toc: left`) a
|
44
|
+
burnt parchment edge will be show with Pathfinder style header fonts for each
|
45
|
+
section.
|
46
|
+
|
47
|
+
== Enemies
|
48
|
+
|
49
|
+
A block of type `stat` can be used to create a creature stat block from
|
50
|
+
https://toml.io/en/[TOML input]. For example:
|
37
51
|
|
38
52
|
[source, asciidoc]
|
39
53
|
----
|
40
|
-
[stat]
|
54
|
+
[stat.center, type=creature]
|
41
55
|
--
|
42
56
|
name = "Hoo Man"
|
43
57
|
level = "1"
|
@@ -83,9 +97,12 @@ text = """\
|
|
83
97
|
--
|
84
98
|
----
|
85
99
|
|
86
|
-
|
100
|
+
Notice that a role can be passed: in this case 'center'. If the block is floated
|
101
|
+
(left right) a 20px margin will be set on the opposite side. If a type is not
|
102
|
+
specified, 'creature' is assumed. The above listing creates the following stat
|
103
|
+
block:
|
87
104
|
|
88
|
-
[stat]
|
105
|
+
[stat.center, type=creature]
|
89
106
|
--
|
90
107
|
name = "Hoo Man"
|
91
108
|
level = "1"
|
@@ -130,21 +147,209 @@ text = """\
|
|
130
147
|
"""
|
131
148
|
--
|
132
149
|
|
133
|
-
==
|
150
|
+
== Treasure
|
134
151
|
|
135
|
-
|
136
|
-
will use the Eczar font. This styling is from the
|
137
|
-
https://www.gmbinder.com/share/-LxQNtitjvBT2eCVkPt1[GM Binder Pathfinder 2nd
|
138
|
-
Edition Homebrew Template]. Fonts are included with `asciidoctor-p2e` and will
|
139
|
-
be installed in the `p2e` directory when your output is created.
|
152
|
+
In a similar fashion to creature stat blocks, item stat blocks can be created:
|
140
153
|
|
141
|
-
|
154
|
+
[source, asciidoctor]
|
155
|
+
----
|
156
|
+
[stat.center, type=item]
|
157
|
+
--
|
158
|
+
name = "Pear of Silence"
|
159
|
+
level = "6+"
|
160
|
+
tags = ["uncommon"]
|
161
|
+
price = "100 gp" # optional
|
162
|
+
usage = "held in 1 hand"
|
163
|
+
bulk = "L"
|
164
|
+
description = """\
|
165
|
+
A cruel device famed to be designed by Roderick the Malevolent. A seemingly \
|
166
|
+
delicious fruit, when placed in someone's mouth it expands to render them \
|
167
|
+
unable to speak. A magical phrase that disables the effect is bound to the \
|
168
|
+
fruit at the time of creation (not that the victim would be able to utter \
|
169
|
+
it).\
|
170
|
+
"""
|
142
171
|
|
143
|
-
|
144
|
-
|
145
|
-
|
172
|
+
[hardness] # optional
|
173
|
+
hardness = "9"
|
174
|
+
hp = "10"
|
175
|
+
bp = "5"
|
176
|
+
|
177
|
+
[[activations]] # optional
|
178
|
+
actions = 1
|
179
|
+
actionText = "Interact" # optional
|
180
|
+
trigger = "The pear is placed inside someone's mouth" # optional
|
181
|
+
# effect is optional too
|
182
|
+
effect = """\
|
183
|
+
The pear rapidly expands, filling the victims mouth and rendering them \
|
184
|
+
unable to speak until the pear is destroyed or disabled.\
|
185
|
+
"""
|
186
|
+
|
187
|
+
[[activations]]
|
188
|
+
actions = 2
|
189
|
+
actionText = "Interact"
|
190
|
+
trigger = """\
|
191
|
+
The magic phrase that disables the pear is spoken loudly at a distance of \
|
192
|
+
less than five feet from the pear.\
|
193
|
+
"""
|
194
|
+
effect = """\
|
195
|
+
The pear resumes its normal shape and form. It can be spit out by the \
|
196
|
+
victim.\
|
197
|
+
"""
|
198
|
+
|
199
|
+
[[types]] #optional
|
200
|
+
type = "lesser"
|
201
|
+
level = "6"
|
202
|
+
price = "100 gp" # optional
|
203
|
+
description = """\
|
204
|
+
Can be destroyed by the victim with a DC 20 Fortitude saving throw.\
|
205
|
+
"""
|
206
|
+
|
207
|
+
[[types]]
|
208
|
+
type = "greater"
|
209
|
+
level = "10"
|
210
|
+
price = "200 gp"
|
211
|
+
description = """\
|
212
|
+
Can be destroyed by the victim with a DC 25 Fortitude saving throw.\
|
213
|
+
"""
|
214
|
+
|
215
|
+
[[types]]
|
216
|
+
type = "major"
|
217
|
+
level = "12"
|
218
|
+
price = "300 gp"
|
219
|
+
description = """\
|
220
|
+
Can be destroyed by the victim with a DC 30 Fortitude saving throw.\
|
221
|
+
"""
|
222
|
+
--
|
223
|
+
----
|
224
|
+
|
225
|
+
The above block yields:
|
226
|
+
|
227
|
+
[stat.center, type=item]
|
228
|
+
--
|
229
|
+
name = "Pear of Silence"
|
230
|
+
level = "6+"
|
231
|
+
tags = ["uncommon"]
|
232
|
+
price = "100 gp" # optional
|
233
|
+
usage = "held in 1 hand"
|
234
|
+
bulk = "L"
|
235
|
+
description = """\
|
236
|
+
A cruel device famed to be designed by Roderick the Malevolent. A seemingly \
|
237
|
+
delicious fruit, when placed in someone's mouth it expands to render them \
|
238
|
+
unable to speak. A magical phrase that disables the effect is bound to the \
|
239
|
+
fruit at the time of creation (not that the victim would be able to utter \
|
240
|
+
it).\
|
241
|
+
"""
|
242
|
+
|
243
|
+
[hardness] # optional
|
244
|
+
hardness = "9"
|
245
|
+
hp = "10"
|
246
|
+
bp = "5"
|
247
|
+
|
248
|
+
[[activations]] # optional
|
249
|
+
actions = 1
|
250
|
+
actionText = "Interact" # optional
|
251
|
+
trigger = "The pear is placed inside someone's mouth" # optional
|
252
|
+
# effect is optional too
|
253
|
+
effect = """\
|
254
|
+
The pear rapidly expands, filling the victims mouth and rendering them \
|
255
|
+
unable to speak until the pear is destroyed or disabled.\
|
256
|
+
"""
|
257
|
+
|
258
|
+
[[activations]]
|
259
|
+
actions = 2
|
260
|
+
actionText = "Interact"
|
261
|
+
trigger = """\
|
262
|
+
The magic phrase that disables the pear is spoken loudly at a distance of \
|
263
|
+
less than five feet from the pear.\
|
264
|
+
"""
|
265
|
+
effect = """\
|
266
|
+
The pear resumes its normal shape and form. It can be spit out by the \
|
267
|
+
victim.\
|
268
|
+
"""
|
269
|
+
|
270
|
+
[[types]] #optional
|
271
|
+
type = "lesser"
|
272
|
+
level = "6"
|
273
|
+
price = "100 gp" # optional
|
274
|
+
description = """\
|
275
|
+
Can be destroyed by the victim with a DC 20 Fortitude saving throw.\
|
276
|
+
"""
|
277
|
+
|
278
|
+
[[types]]
|
279
|
+
type = "greater"
|
280
|
+
level = "10"
|
281
|
+
price = "200 gp"
|
282
|
+
description = """\
|
283
|
+
Can be destroyed by the victim with a DC 25 Fortitude saving throw.\
|
284
|
+
"""
|
285
|
+
|
286
|
+
[[types]]
|
287
|
+
type = "major"
|
288
|
+
level = "12"
|
289
|
+
price = "300 gp"
|
290
|
+
description = """\
|
291
|
+
Can be destroyed by the victim with a DC 30 Fortitude saving throw.\
|
292
|
+
"""
|
293
|
+
--
|
294
|
+
|
295
|
+
== Traps
|
146
296
|
|
147
|
-
|
297
|
+
Hazard stat blocks can also be created:
|
298
|
+
|
299
|
+
[source, asciidoctor]
|
300
|
+
----
|
301
|
+
[stat.center, type=hazard]
|
302
|
+
====
|
303
|
+
name = "Bed Spike"
|
304
|
+
level = "1"
|
305
|
+
tags = ["mechanical", "trap"]
|
306
|
+
stealth = "DC 15 (or 0 if they look under the bed)"
|
307
|
+
description = """\
|
308
|
+
The support ropes for a bed are cut almost completely through. Under the bed \
|
309
|
+
are several sharpened wooded spikes. Typically the sheets are hung over the \
|
310
|
+
edge of the bed to disguise the spikes.\
|
311
|
+
"""
|
312
|
+
disable = """\
|
313
|
+
Crafting DC 10 to remove the spikes. The bed will still not support weight \
|
314
|
+
but there will be no damage caused by falling through.\
|
315
|
+
"""
|
316
|
+
|
317
|
+
[[triggers]]
|
318
|
+
name = "Fall Through"
|
319
|
+
text = """\
|
320
|
+
A creature lays on the bed, causing the ropes to snap and dealing 1D6 piercing
|
321
|
+
damage.\
|
322
|
+
"""
|
323
|
+
====
|
324
|
+
----
|
325
|
+
|
326
|
+
The above block yields:
|
327
|
+
|
328
|
+
[stat.center, type=hazard]
|
329
|
+
====
|
330
|
+
name = "Bed Spike"
|
331
|
+
level = "1"
|
332
|
+
tags = ["mechanical", "trap"]
|
333
|
+
stealth = "DC 15 (or 0 if they look under the bed)"
|
334
|
+
description = """\
|
335
|
+
The support ropes for a bed are cut almost completely through. Under the bed \
|
336
|
+
are several sharpened wooded spikes. Typically the sheets are hung over the \
|
337
|
+
edge of the bed to disguise the spikes.\
|
338
|
+
"""
|
339
|
+
disable = """\
|
340
|
+
Crafting DC 10 to remove the spikes. The bed will still not support weight \
|
341
|
+
but there will be no damage caused by falling through.\
|
342
|
+
"""
|
343
|
+
|
344
|
+
[[triggers]]
|
345
|
+
name = "Fall Through"
|
346
|
+
text = """\
|
347
|
+
A creature lays on the bed, causing the ropes to snap and dealing 1D6 piercing
|
348
|
+
damage.\
|
349
|
+
"""
|
350
|
+
====
|
351
|
+
|
352
|
+
== Cryptic Texts
|
148
353
|
|
149
354
|
When a sidebar is used to display information the background will use a styling
|
150
355
|
from https://pf2.easytool.es/[Pathfinder 2 easy Library].
|
@@ -154,15 +359,17 @@ regarding the functioning of dangerous items:
|
|
154
359
|
|
155
360
|
.Wizard's Note
|
156
361
|
****
|
157
|
-
|
158
|
-
|
362
|
+
To Whom it May Concern,
|
363
|
+
|
364
|
+
Reading this note will curse you for all time with a constant stone in your
|
365
|
+
shoe. No take backs!
|
159
366
|
|
160
367
|
Sincerely,
|
161
368
|
|
162
369
|
Roderick the Malevolent
|
163
370
|
****
|
164
371
|
|
165
|
-
== Adventurer's Log
|
372
|
+
== Adventurer's Log
|
166
373
|
|
167
374
|
* The layout, much of the styling, and the demonstration creature come from the
|
168
375
|
https://slanguage.github.io/pf2monster/[Pathfinder 2E Monster Creator]
|
Binary file
|
@@ -24,16 +24,23 @@
|
|
24
24
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
25
25
|
}
|
26
26
|
|
27
|
-
/*
|
27
|
+
/* Stat blocks */
|
28
28
|
.statblock {
|
29
29
|
width: 500px;
|
30
30
|
border: 1px solid black;
|
31
|
-
margin: 20px
|
31
|
+
/* margin: 20px;*/
|
32
32
|
padding: 20px;
|
33
33
|
font-family: "Roboto", Geneva, sans-serif;
|
34
34
|
font-size: 16px;
|
35
35
|
line-height: 24px;
|
36
|
-
display:
|
36
|
+
display: block;
|
37
|
+
background: #f7f7f8;
|
38
|
+
}
|
39
|
+
.statblock.left {
|
40
|
+
margin-right: 20px;
|
41
|
+
}
|
42
|
+
.statblock.right {
|
43
|
+
margin-left: 20px;
|
37
44
|
}
|
38
45
|
.statblock-title {
|
39
46
|
font-size: 23px;
|
@@ -44,7 +51,7 @@
|
|
44
51
|
.statblock-name {
|
45
52
|
float: left;
|
46
53
|
}
|
47
|
-
.statblock-
|
54
|
+
.statblock-type {
|
48
55
|
float: right;
|
49
56
|
text-align: right;
|
50
57
|
}
|
@@ -154,7 +161,28 @@
|
|
154
161
|
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAYAAAB3AH1ZAAAABHNCSVQICAgIfAhkiAAAA8BJREFUSImdlUlsHEUUht/rWrp6lp7unnHPjJ2MgxNWgyKWA6AEC5BsQUBRpCAOKBcIAoGPIG7ABS4sEgpwgguXnBIPxgbFCOUQcQBFiVgiDnC3PYsjHHdVLzNdXGxr0p6QOP/x1d/1Vb3X7xXADYSI1HPcDznjB27kGbTfgmdXIhXPOzXRGE8bY2N/M8YmbmRkjO2tV2sLlNK9twMyhsXKrvuRXSi+iYjIKDtQH/EXGWONrJFSWqv71XM5IY7U/eoPhJD6MAgiskK+8NIwHskGPMf9wLHttxBxO62EkIolrGml1Hyapuub8OqoX/2RMTa56fFzljUdSHlGax0MwkfK5a/cUuk9NIycCsOf/jcD/X7/H611ko1zxiZrI/4ipbQKAFAsFF5kjN1/vYc/UPer3xNCKlv8ilf+spgvnEBEwynab7uO8z4M/DPbGSgV7dcBQQVSLmnQbWGaM4h4XYYIIVVLiCelUk2p5HnKqGNy/uighxIyKkwxFUh5Vmsd5S3rOc75Q7gpYZqHAbAfRuGF7QOUbHu27LmfFXL5YzJUC1LKJQC4KoSYRkRjJ8A8LJVqbgTBt4wz32T8kcFbUUr3WEIcCqQ8I5VqUkoanPGDA4eY0hrCMIp+JnaxeLLieacQkBqIdj6Xe14p9V2g5DkEDCwhZrLloJTuEab5uFTqbBAETcbYHZzxgxlPQ5jmY0EQnJZKzXPO7uGMTwIAIKJhCfFUmqZdA3b2MAcAsVXDLBwAQGutt5YMwygwxu4cZot7yZVU65AQUuaU3Z3Z41oUJ5dJFMeXUq2vWpaYTvtpZ7m1OhMnyZ+OXZp1HefjbAm01jqK419W2q2jWut4tFpbMDk/lIWvb1z7uttdm6WEVmq+v2hy/uDWYpqm6yvt1rEwCi9QAIB/19c/B4B+GEa/xnH8e8m2X3NLpU8NRJqFx0lyabXTPqq1VnW/2jQ5fyLr2ZDBN521tTcAQdf8kTmT84e34TrdWOm0j6swPA8w0AVRFF3s9/vLpaL9suc4XxiGwbM5TZLkj5V265ler9dyHeedYj5/MnvzQMrT7W73lc1W1ohG3xLiCCISrbVabbePK6WWtj7YMYjyudwLlhBTg4MIACBOkisr7dazvV5vGQAgjKKLpmnexyi7dwA+1+p2TgzOkSiOftMaVi0hnm51O68GUs5lmVkZZdf7ZKIxnu4f36cnGuNpY3Tsr2GjGBH5aK02v398X1ob8ZuIKIZtCADAOb/rZuBB3fJjZBiG5bnuu4iY2w3gptrlc3zb+g/DZ3c9xGiesQAAAABJRU5ErkJggg==)
|
155
162
|
}
|
156
163
|
|
157
|
-
/* Headings and
|
164
|
+
/* Headings, TOC, dividers, and background */
|
165
|
+
body {
|
166
|
+
background: url("parchment.jpg");
|
167
|
+
background-repeat: repeat-y;
|
168
|
+
background-size: contain;
|
169
|
+
}
|
170
|
+
body.toc2 #header > h1:nth-last-child(2) {
|
171
|
+
border-bottom: none;
|
172
|
+
text-align: center;
|
173
|
+
}
|
174
|
+
body.toc2 #header > h1:nth-last-child(2)::after, .sect1 + .sect1::before {
|
175
|
+
content: "";
|
176
|
+
display: block;
|
177
|
+
height: 40px;
|
178
|
+
background-image: url("divider.png");
|
179
|
+
background-repeat: no-repeat;
|
180
|
+
background-position: center bottom;
|
181
|
+
background-size: cover;
|
182
|
+
}
|
183
|
+
.sect1 + .sect1 {
|
184
|
+
border-top: none;
|
185
|
+
}
|
158
186
|
h1, h2, #toctitle, #toc a {
|
159
187
|
font-family: 'Eczar', sans-serif !important;
|
160
188
|
color:#4E0707 !important;
|
@@ -165,10 +193,10 @@ h1, #toctitle {
|
|
165
193
|
text-shadow: 1px 1px 0 #EFCD98, -1px 1px 0 #EFCD98, 1px -1px 0 #EFCD98, -1px -1px 0 #EFCD98, 0px 1px 0 #EFCD98, 0px -1px 0 #EFCD98, -1px 0px 0 #EFCD98, 1px 0px 0 #EFCD98, 2px 2px 0 #EFCD98, -2px 2px 0 #EFCD98, 2px -2px 0 #EFCD98, -2px -2px 0 #EFCD98, 0px 2px 0 #EFCD98, 0px -2px 0 #EFCD98, -2px 0px 0 #EFCD98, 2px 0px 0 #EFCD98, 1px 2px 0 #EFCD98, -1px 2px 0 #EFCD98, 1px -2px 0 #EFCD98, -1px -2px 0 #EFCD98, 2px 1px 0 #EFCD98, -2px 1px 0 #EFCD98, 2px -1px 0 #EFCD98, -2px -1px 0 #EFCD98;
|
166
194
|
}
|
167
195
|
h1 {
|
168
|
-
font-size:
|
196
|
+
font-size: 6em;
|
169
197
|
}
|
170
198
|
h2 {
|
171
|
-
font-size: 5em;
|
199
|
+
font-size: 3.5em;
|
172
200
|
}
|
173
201
|
h3 {
|
174
202
|
color:#02256E;
|
@@ -194,3 +222,30 @@ h3 {
|
|
194
222
|
background-repeat: no-repeat;
|
195
223
|
background-size: cover;
|
196
224
|
}
|
225
|
+
|
226
|
+
/* Tables */
|
227
|
+
table {
|
228
|
+
background-color: #F5EFE0;
|
229
|
+
margin-bottom:0px;
|
230
|
+
}
|
231
|
+
table tr th {
|
232
|
+
background-color: #5E0000;
|
233
|
+
color: white !important;
|
234
|
+
padding-top:4px;
|
235
|
+
}
|
236
|
+
table tbody tr:nth-child(odd) {
|
237
|
+
background-color: #EDE3C8
|
238
|
+
}
|
239
|
+
table tbody, table th {
|
240
|
+
font-family: 'Roboto Condensed', sans-serif;
|
241
|
+
}
|
242
|
+
.tablefooter {
|
243
|
+
background-color:#E6D8B0 !important;
|
244
|
+
}
|
245
|
+
table.left {
|
246
|
+
margin-right: 35px;
|
247
|
+
}
|
248
|
+
table.right {
|
249
|
+
margin-left: 35px;
|
250
|
+
}
|
251
|
+
|
Binary file
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<div class="statblock">
|
1
|
+
<div class="statblock <%= defined?(role) ? role : '' %>">
|
2
2
|
<div class="statblock-title">
|
3
3
|
<span class="statblock-name"><%= name %></span>
|
4
|
-
<span class="statblock-
|
4
|
+
<span class="statblock-type"> CREATURE <%= level %></span>
|
5
5
|
</div>
|
6
6
|
<div class="statblock-info-block">
|
7
7
|
<div class="statblock-tags">
|
@@ -23,20 +23,33 @@ class P2EStatblockProcessor < Extensions::BlockProcessor
|
|
23
23
|
use_dsl
|
24
24
|
|
25
25
|
named :stat
|
26
|
-
on_context :open
|
26
|
+
on_context :open, :example
|
27
27
|
parse_content_as :raw
|
28
28
|
|
29
29
|
def process parent, reader, attrs
|
30
30
|
# parse TOML
|
31
31
|
lines = reader.lines
|
32
|
-
|
32
|
+
data = Tomlrb.parse(lines * "\n")
|
33
|
+
|
34
|
+
# get/set attributes
|
35
|
+
if attrs.key?('type')
|
36
|
+
type = attrs['type']
|
37
|
+
else
|
38
|
+
type = 'creature'
|
39
|
+
end
|
40
|
+
if attrs.key?('role')
|
41
|
+
data['role'] = attrs['role']
|
42
|
+
end
|
33
43
|
|
34
44
|
# create HTML from template
|
35
45
|
extdir = ::File.join(::File.dirname __FILE__)
|
36
|
-
|
37
|
-
|
38
|
-
|
46
|
+
templates = {
|
47
|
+
'creature' => "#{extdir}/creatureblock.html.erb",
|
48
|
+
'item' => "#{extdir}/itemblock.html.erb",
|
49
|
+
'hazard' => "#{extdir}/hazardblock.html.erb"
|
50
|
+
}
|
51
|
+
template = File.read(templates[type])
|
52
|
+
html = ERB.new(template).result_with_hash(data)
|
39
53
|
create_pass_block parent, html, attrs, subs: nil
|
40
54
|
end
|
41
55
|
end
|
42
|
-
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div class="statblock <%= defined?(role) ? role : '' %>">
|
2
|
+
<div class="statblock-title">
|
3
|
+
<span class="statblock-name"><%= name %></span>
|
4
|
+
<span class="statblock-type">HAZARD <%= level %></span>
|
5
|
+
</div>
|
6
|
+
<div class="statblock-info-block">
|
7
|
+
<div class="statblock-tags">
|
8
|
+
<% tags.each do |tag| %>
|
9
|
+
<% if tag == "uncommon" %>
|
10
|
+
<div class="statblock-tag-rarity-uncommon"><%= tag %></div>
|
11
|
+
<% elsif tag == "rare" %>
|
12
|
+
<div class="statblock-tag-rarity-rare"><%= tag %></div>
|
13
|
+
<% elsif tag == "unique" %>
|
14
|
+
<div class="statblock-tag-rarity-unique"><%= tag %></div>
|
15
|
+
<% else %>
|
16
|
+
<div class="statblock-tag-other"><%= tag %></div>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
<div class="statblock-info-other">
|
21
|
+
<div class="statblock-info-line">
|
22
|
+
<span class="statblock-line-heavy">Stealth </span><%= stealth %>
|
23
|
+
</div>
|
24
|
+
<div class="statblock-info-line">
|
25
|
+
<span class="statblock-line-heavy">Description </span><%= description %>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<div class="statblock-info-block">
|
30
|
+
<div class="statblock-info-line">
|
31
|
+
<span class="statblock-line-heavy">Disable </span><%= disable %>
|
32
|
+
</div>
|
33
|
+
<% if defined?(triggers) %>
|
34
|
+
<% triggers.each do |trigger| %>
|
35
|
+
<div class="statblock-info-line">
|
36
|
+
<span class="statblock-line-heavy"><%= trigger['name'] %></span>
|
37
|
+
<span class="statblock-reaction"></span>
|
38
|
+
<span class="statblock-line-heavy">Trigger </span><%= trigger['text'] %>
|
39
|
+
</div>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
43
|
+
</div>
|
@@ -0,0 +1,86 @@
|
|
1
|
+
<div class="statblock <%= defined?(role) ? role : '' %>">
|
2
|
+
<div class="statblock-title">
|
3
|
+
<span class="statblock-name"><%= name %></span>
|
4
|
+
<span class="statblock-type">ITEM <%= level %></span>
|
5
|
+
</div>
|
6
|
+
<div class="statblock-info-block">
|
7
|
+
<div class="statblock-tags">
|
8
|
+
<% tags.each do |tag| %>
|
9
|
+
<% if tag == "uncommon" %>
|
10
|
+
<div class="statblock-tag-rarity-uncommon"><%= tag %></div>
|
11
|
+
<% elsif tag == "rare" %>
|
12
|
+
<div class="statblock-tag-rarity-rare"><%= tag %></div>
|
13
|
+
<% elsif tag == "unique" %>
|
14
|
+
<div class="statblock-tag-rarity-unique"><%= tag %></div>
|
15
|
+
<% else %>
|
16
|
+
<div class="statblock-tag-other"><%= tag %></div>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
<div class="statblock-info-other">
|
21
|
+
<% if defined?(price) %>
|
22
|
+
<div class="statblock-info-line">
|
23
|
+
<span class="statblock-line-heavy">Price </span><%= price %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
26
|
+
<div class="statblock-info-line">
|
27
|
+
<span class="statblock-line-heavy">Usage </span><%= usage %>;
|
28
|
+
<span class="statblock-line-heavy"> Bulk </span><%= bulk %>;
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
<% if defined?(activations) %>
|
32
|
+
<div class="statblock-info-other">
|
33
|
+
<% activations.each do |activation| %>
|
34
|
+
<div class="statblock-info-line">
|
35
|
+
<span class="statblock-line-heavy"> Activate </span>
|
36
|
+
<% if activation['actions'] == 0 %>
|
37
|
+
<span class="statblock-free-action"></span>
|
38
|
+
<% elsif activation['actions'] == 1 %>
|
39
|
+
<span class="statblock-one-action"></span>
|
40
|
+
<% elsif activation['actions'] == 2 %>
|
41
|
+
<span class="statblock-two-actions"></span>
|
42
|
+
<% elsif activation['actions'] == 3 %>
|
43
|
+
<span class="statblock-three-actions"></span>
|
44
|
+
<% end %>
|
45
|
+
<% if activation.key?('actionText') %>
|
46
|
+
<%= activation['actionText'] %>
|
47
|
+
<% end %>
|
48
|
+
<% if activation.key?('frequency') %>
|
49
|
+
<span class="statblock-line-heavy"> Frequency </span><%= activation['frequency'] %>
|
50
|
+
<% end %>
|
51
|
+
<% if activation.key?('trigger') %>
|
52
|
+
<span class="statblock-line-heavy"> Trigger </span><%= activation['trigger'] %>
|
53
|
+
<% end %>
|
54
|
+
<% if activation.key?('effect') %>
|
55
|
+
<span class="statblock-line-heavy"> Effect </span><%= activation['effect'] %>
|
56
|
+
<% end %>
|
57
|
+
</div>
|
58
|
+
<% end %>
|
59
|
+
</div>
|
60
|
+
<% end %>
|
61
|
+
</div>
|
62
|
+
<div class="statblock-info-block">
|
63
|
+
<% if defined?(hardness) %>
|
64
|
+
<div class="statblock-info-line">
|
65
|
+
<span class="statblock-line-heavy">Hardness </span><%= hardness['hardness'] %>;
|
66
|
+
<span class="statblock-line-heavy">HP </span><%= hardness['hp'] %>;
|
67
|
+
<span class="statblock-line-heavy">BT </span><%= hardness['bt'] %>;
|
68
|
+
</div>
|
69
|
+
<% end %>
|
70
|
+
<div><%= description %></div>
|
71
|
+
</div>
|
72
|
+
<% if defined?(types) %>
|
73
|
+
<% types.each do |type| %>
|
74
|
+
<div class="statblock-info-block">
|
75
|
+
<div class="statblock-info-line">
|
76
|
+
<span class="statblock-line-heavy">Type </span><em><%= type['type'] %></em>
|
77
|
+
<span class="statblock-line-heavy">Level </span><%= type['level'] %>
|
78
|
+
<% if type.key?('price') %>
|
79
|
+
<span class="statblock-line-heavy">Price </span><%= type['price'] %>
|
80
|
+
<% end %>
|
81
|
+
</div>
|
82
|
+
<div><%= type['description'] %></div>
|
83
|
+
</div>
|
84
|
+
<% end %>
|
85
|
+
<% end %>
|
86
|
+
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-p2e
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Tolboom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tomlrb
|
@@ -64,12 +64,16 @@ files:
|
|
64
64
|
- lib/asciidoctor-p2e/assets/BXRovF3Pi-DLmzWCKvt80WrNWA.woff2
|
65
65
|
- lib/asciidoctor-p2e/assets/BXRovF3Pi-DLmzWCKvt90Wo.woff2
|
66
66
|
- lib/asciidoctor-p2e/assets/BXRovF3Pi-DLmzWCKvtz0WrNWA.woff2
|
67
|
+
- lib/asciidoctor-p2e/assets/divider.png
|
67
68
|
- lib/asciidoctor-p2e/assets/p2e.css
|
69
|
+
- lib/asciidoctor-p2e/assets/parchment.jpg
|
68
70
|
- lib/asciidoctor-p2e/assets/sidebar.png
|
69
71
|
- lib/asciidoctor-p2e/assets/toc.png
|
72
|
+
- lib/asciidoctor-p2e/creatureblock.html.erb
|
70
73
|
- lib/asciidoctor-p2e/docinfo.html
|
71
74
|
- lib/asciidoctor-p2e/extension.rb
|
72
|
-
- lib/asciidoctor-p2e/
|
75
|
+
- lib/asciidoctor-p2e/hazardblock.html.erb
|
76
|
+
- lib/asciidoctor-p2e/itemblock.html.erb
|
73
77
|
homepage: https://bosco.srht.site/asciidoctor-p2e.html
|
74
78
|
licenses:
|
75
79
|
- GPL-3.0
|