asciidoctor-p2e 0.1.1 → 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/LICENSE +674 -0
- data/README.adoc +314 -56
- data/Rakefile +37 -0
- data/lib/asciidoctor-p2e/assets/BXRovF3Pi-DLmzWCKvt80WrNWA.woff2 +0 -0
- data/lib/asciidoctor-p2e/assets/BXRovF3Pi-DLmzWCKvt90Wo.woff2 +0 -0
- data/lib/asciidoctor-p2e/assets/BXRovF3Pi-DLmzWCKvtz0WrNWA.woff2 +0 -0
- data/lib/asciidoctor-p2e/assets/divider.png +0 -0
- data/lib/asciidoctor-p2e/{p2e.css → assets/p2e.css} +126 -3
- data/lib/asciidoctor-p2e/assets/parchment.jpg +0 -0
- data/lib/asciidoctor-p2e/assets/sidebar.png +0 -0
- data/lib/asciidoctor-p2e/assets/toc.png +0 -0
- data/lib/asciidoctor-p2e/{statblock.html.erb → creatureblock.html.erb} +4 -4
- data/lib/asciidoctor-p2e/docinfo.html +1 -0
- data/lib/asciidoctor-p2e/extension.rb +25 -10
- data/lib/asciidoctor-p2e/hazardblock.html.erb +43 -0
- data/lib/asciidoctor-p2e/itemblock.html.erb +86 -0
- metadata +36 -4
data/README.adoc
CHANGED
@@ -1,121 +1,375 @@
|
|
1
1
|
= asciidoctor-p2e
|
2
|
+
:toc: left
|
2
3
|
|
3
|
-
|
4
|
-
https://git.sr.ht/~bosco/asciidoctor-p2e.
|
4
|
+
== Welcome Adventurer!
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
Greetings weary traveller! I trust your journey was safe albeit long. Whether
|
7
|
+
from the storm-tossed seas of _Word_ or the raging wastelands of _Google Docs_,
|
8
|
+
you have finally made your way to the golden shore of
|
9
|
+
https://asciidoctor.org/[Asciidoctor]! asciidoctor-p2e is an
|
10
|
+
https://docs.asciidoctor.org/asciidoctor/latest/extensions/[extension] for
|
11
|
+
AsciiDoctor that makes it easier to create stylized content for the
|
12
|
+
https://paizo.com/pathfinder[Pathfinder Second Edition roleplaying system].
|
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!
|
17
|
+
|
18
|
+
You can find the git repo for this project in the mystical realm of SourceHut:
|
19
|
+
https://git.sr.ht/~bosco/asciidoctor-p2e, a fantastic forge of free software
|
20
|
+
also known to the old ones as
|
21
|
+
https://drewdevault.com/2018/11/15/sr.ht-general-availability.html[Sir Hat].
|
10
22
|
|
11
23
|
== Usage
|
12
24
|
|
13
|
-
|
25
|
+
This extension is archived in the scrolls of
|
26
|
+
https://rubygems.org/gems/asciidoctor-p2e[RubyGems] and can be added to your
|
27
|
+
inventory with the `gem install asciidoctor-p2e` command. Once the
|
28
|
+
`asciidoctor-p2e` gem is installed you can run
|
14
29
|
`asciidoctor -r asciidoctor-p2e <input>` to create your output.
|
15
30
|
|
16
|
-
|
31
|
+
NOTE: Images and assets will be installed/referenced in a `p2e` directory
|
32
|
+
wherever your output is created.
|
33
|
+
|
34
|
+
== Style
|
35
|
+
|
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
|
17
48
|
|
18
|
-
A
|
19
|
-
https://toml.io/en/[TOML input]. For example
|
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:
|
20
51
|
|
21
52
|
[source, asciidoc]
|
22
53
|
----
|
23
|
-
[stat]
|
54
|
+
[stat.center, type=creature]
|
24
55
|
--
|
25
|
-
name = "
|
56
|
+
name = "Hoo Man"
|
26
57
|
level = "1"
|
27
|
-
tags = ["
|
28
|
-
perception = "+
|
29
|
-
senses = "
|
30
|
-
skills = ["
|
58
|
+
tags = ["ce","tiny"]
|
59
|
+
perception = "+1"
|
60
|
+
senses = "scent"
|
61
|
+
skills = ["Intimidation +2", "Thievery +1"]
|
31
62
|
|
32
63
|
[attributes]
|
33
|
-
cha = "-
|
34
|
-
con = "+
|
35
|
-
dex = "+
|
64
|
+
cha = "-2"
|
65
|
+
con = "+1"
|
66
|
+
dex = "+2"
|
36
67
|
int = "-2"
|
37
|
-
str = "
|
38
|
-
wis = "
|
68
|
+
str = "-1"
|
69
|
+
wis = "-1"
|
39
70
|
|
40
71
|
[defense]
|
41
|
-
ac = "
|
42
|
-
fort = "+
|
72
|
+
ac = "10"
|
73
|
+
fort = "+2"
|
43
74
|
ref = "+6"
|
44
|
-
will = "+
|
45
|
-
hp = "
|
75
|
+
will = "+1"
|
76
|
+
hp = "10"
|
46
77
|
immunities = ""
|
47
78
|
reactions = ["Attack of Opportunity"]
|
48
79
|
|
49
80
|
[offense]
|
50
81
|
speed = "25"
|
51
|
-
otherSpeeds = ""
|
82
|
+
otherSpeeds = "Climb Speed 25"
|
52
83
|
|
53
84
|
[[offense.attacks]]
|
54
85
|
actions = 1
|
55
|
-
damage = "
|
86
|
+
damage = "1d4 piercing"
|
56
87
|
name = "Melee"
|
57
|
-
text = "
|
88
|
+
text = "teeth +4"
|
58
89
|
|
59
90
|
[[offense.attacks]]
|
60
91
|
actions = 2
|
61
|
-
name = "
|
92
|
+
name = "Helicopter Dance"
|
62
93
|
text = """\
|
63
|
-
|
64
|
-
|
65
|
-
The dragon cultist can't use Breath Weapon again for 1d4 rounds.\
|
94
|
+
Hoo Man dazzles anyone watching with a unique dance causing anyone who \
|
95
|
+
fails a Will save (DC 15) to become fascinated.\
|
66
96
|
"""
|
67
97
|
--
|
68
98
|
----
|
69
99
|
|
70
|
-
|
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:
|
71
104
|
|
72
|
-
[stat]
|
105
|
+
[stat.center, type=creature]
|
73
106
|
--
|
74
|
-
name = "
|
107
|
+
name = "Hoo Man"
|
75
108
|
level = "1"
|
76
|
-
tags = ["
|
77
|
-
perception = "+
|
78
|
-
senses = "
|
79
|
-
skills = ["
|
109
|
+
tags = ["ce","tiny"]
|
110
|
+
perception = "+1"
|
111
|
+
senses = "scent"
|
112
|
+
skills = ["Intimidation +2", "Thievery +1"]
|
80
113
|
|
81
114
|
[attributes]
|
82
|
-
cha = "-
|
83
|
-
con = "+
|
84
|
-
dex = "+
|
115
|
+
cha = "-2"
|
116
|
+
con = "+1"
|
117
|
+
dex = "+2"
|
85
118
|
int = "-2"
|
86
|
-
str = "
|
87
|
-
wis = "
|
119
|
+
str = "-1"
|
120
|
+
wis = "-1"
|
88
121
|
|
89
122
|
[defense]
|
90
|
-
ac = "
|
91
|
-
fort = "+
|
123
|
+
ac = "10"
|
124
|
+
fort = "+2"
|
92
125
|
ref = "+6"
|
93
|
-
will = "+
|
94
|
-
hp = "
|
126
|
+
will = "+1"
|
127
|
+
hp = "10"
|
95
128
|
immunities = ""
|
96
129
|
reactions = ["Attack of Opportunity"]
|
97
130
|
|
98
131
|
[offense]
|
99
132
|
speed = "25"
|
100
|
-
otherSpeeds = ""
|
133
|
+
otherSpeeds = "Climb Speed 25"
|
101
134
|
|
102
135
|
[[offense.attacks]]
|
103
136
|
actions = 1
|
104
|
-
damage = "
|
137
|
+
damage = "1d4 piercing"
|
105
138
|
name = "Melee"
|
106
|
-
text = "
|
139
|
+
text = "teeth +4"
|
107
140
|
|
108
141
|
[[offense.attacks]]
|
109
142
|
actions = 2
|
110
|
-
name = "
|
143
|
+
name = "Helicopter Dance"
|
111
144
|
text = """\
|
112
|
-
|
113
|
-
|
114
|
-
|
145
|
+
Hoo Man dazzles anyone watching with a unique dance causing anyone who \
|
146
|
+
fails a Will save (DC 15) to become fascinated.\
|
147
|
+
"""
|
148
|
+
--
|
149
|
+
|
150
|
+
== Treasure
|
151
|
+
|
152
|
+
In a similar fashion to creature stat blocks, item stat blocks can be created:
|
153
|
+
|
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
|
+
"""
|
171
|
+
|
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.\
|
115
292
|
"""
|
116
293
|
--
|
117
294
|
|
118
|
-
==
|
295
|
+
== Traps
|
296
|
+
|
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
|
353
|
+
|
354
|
+
When a sidebar is used to display information the background will use a styling
|
355
|
+
from https://pf2.easytool.es/[Pathfinder 2 easy Library].
|
356
|
+
|
357
|
+
Sidebars can especially effective for notes from Wizards with specific details
|
358
|
+
regarding the functioning of dangerous items:
|
359
|
+
|
360
|
+
.Wizard's Note
|
361
|
+
****
|
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!
|
366
|
+
|
367
|
+
Sincerely,
|
368
|
+
|
369
|
+
Roderick the Malevolent
|
370
|
+
****
|
371
|
+
|
372
|
+
== Adventurer's Log
|
119
373
|
|
120
374
|
* The layout, much of the styling, and the demonstration creature come from the
|
121
375
|
https://slanguage.github.io/pf2monster/[Pathfinder 2E Monster Creator]
|
@@ -123,3 +377,7 @@ text = """\
|
|
123
377
|
https://www.reddit.com/r/WorldAnvil/comments/kdzog2/css_for_pathfinder_2nd_edition/[CSS for Pathfinder 2nd Edition]
|
124
378
|
* https://github.com/asciidoctor/asciidoctor-extensions-lab[Asciidoctor Extensions Lab]
|
125
379
|
was used as a reference in creating this extension.
|
380
|
+
* https://www.gmbinder.com/share/-LxQNtitjvBT2eCVkPt1[GM Binder Pathfinder 2nd
|
381
|
+
Edition Homebrew Template] was used for fonts and further styling.
|
382
|
+
* The https://pf2.easytool.es/[Pathfinder 2 easy Library] was used for the
|
383
|
+
Sidebar styling
|
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'asciidoctor'
|
2
|
+
require './lib/asciidoctor-p2e.rb'
|
3
|
+
require 'dotenv/load'
|
4
|
+
require 'rubygems'
|
5
|
+
|
6
|
+
bearer = ENV['BEARER']
|
7
|
+
docdir = 'docs'
|
8
|
+
|
9
|
+
desc 'Build gem'
|
10
|
+
task :gem_build do
|
11
|
+
sh "gem build asciidoctor-p2e.gemspec"
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Pushes gem to RubyGems.org'
|
15
|
+
task :gem_push do
|
16
|
+
spec = Gem::Specification::load('asciidoctor-p2e.gemspec')
|
17
|
+
sh "gem push asciidoctor-p2e-#{spec.version}.gem"
|
18
|
+
end
|
19
|
+
|
20
|
+
desc 'Builds documentation using the local (non-installed) extension'
|
21
|
+
task :doc_build do
|
22
|
+
rm_rf docdir
|
23
|
+
Asciidoctor.convert_file(
|
24
|
+
'README.adoc',
|
25
|
+
to_file: 'asciidoctor-p2e.html',
|
26
|
+
to_dir: docdir,
|
27
|
+
mkdirs: true,
|
28
|
+
safe: :unsafe,
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
desc 'Deploys documentation to SourceHut site'
|
33
|
+
task :doc_deploy do
|
34
|
+
sh 'tar cvzf site.tar.gz -C docs asciidoctor-p2e.html p2e'
|
35
|
+
sh "curl -H 'Authorization: Bearer #{bearer}' -Fcontent=@site.tar.gz https://pages.sr.ht/publish/bosco.srht.site"
|
36
|
+
rm 'site.tar.gz'
|
37
|
+
end
|