asciidoctor-p2e 0.1.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 +7 -0
- data/README.adoc +125 -0
- data/lib/asciidoctor-p2e.rb +6 -0
- data/lib/asciidoctor-p2e/extension.rb +40 -0
- data/lib/asciidoctor-p2e/p2e.css +128 -0
- data/lib/asciidoctor-p2e/statblock.html.erb +87 -0
- metadata +64 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0dff1d42b161edc86e587b3a7bd4f0dca6c994cf7ed46af097d42fafac99b63d
|
4
|
+
data.tar.gz: 7e810b224f6ceffde91e25fe6b5c9385a10dc03d36b6733834c778c37977d5dd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1b32aeead43be454ce70b9d4b503a90b16358527fef12475715d68526b334ecbe634cb70359ff93b55af7f88010f0f010150b0d26529ef6730d002ae7f971fdf
|
7
|
+
data.tar.gz: c575133c2f2bcb8051461aa79d6fe48f59e83ae1e06f57aa6eb533cdeab3e0a7fe82980a0b82c126165aec7c1c932c30f293df64f7800d74a994c803a64c9a74
|
data/README.adoc
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
= asciidoctor-p2e
|
2
|
+
|
3
|
+
You can find the git repo for this project on SourceHut:
|
4
|
+
https://git.sr.ht/~bosco/asciidoctor-p2e.
|
5
|
+
|
6
|
+
This https://docs.asciidoctor.org/asciidoctor/latest/extensions/[extension] for
|
7
|
+
https://asciidoctor.org/[Asciidoctor] is designed to make it easier to create
|
8
|
+
content to work with the https://paizo.com/pathfinder[Pathfinder Second Edition
|
9
|
+
roleplaying system]. Currently it only supports NPC/Creature stat blocks.
|
10
|
+
|
11
|
+
== Usage
|
12
|
+
|
13
|
+
Once the `asciidoctor-p2e` gem is installed you can run
|
14
|
+
`asciidoctor -r asciidoctor-p2e <input>` to create your output.
|
15
|
+
|
16
|
+
== Stat Blocks
|
17
|
+
|
18
|
+
A new block of type `stat` can be used to create a stat block from
|
19
|
+
https://toml.io/en/[TOML input]. For example the following TOML:
|
20
|
+
|
21
|
+
[source, asciidoc]
|
22
|
+
----
|
23
|
+
[stat]
|
24
|
+
--
|
25
|
+
name = "Dragon Cultist"
|
26
|
+
level = "1"
|
27
|
+
tags = ["ne","medium","humaniod"]
|
28
|
+
perception = "+4"
|
29
|
+
senses = "low-light vision"
|
30
|
+
skills = ["Athletics +6","Intimidation +2","Survival +4"]
|
31
|
+
|
32
|
+
[attributes]
|
33
|
+
cha = "-1"
|
34
|
+
con = "+2"
|
35
|
+
dex = "+1"
|
36
|
+
int = "-2"
|
37
|
+
str = "+3"
|
38
|
+
wis = "+1"
|
39
|
+
|
40
|
+
[defense]
|
41
|
+
ac = "16"
|
42
|
+
fort = "+7"
|
43
|
+
ref = "+6"
|
44
|
+
will = "+4"
|
45
|
+
hp = "20"
|
46
|
+
immunities = ""
|
47
|
+
reactions = ["Attack of Opportunity"]
|
48
|
+
|
49
|
+
[offense]
|
50
|
+
speed = "25"
|
51
|
+
otherSpeeds = ""
|
52
|
+
|
53
|
+
[[offense.attacks]]
|
54
|
+
actions = 1
|
55
|
+
damage = "1d10+3 slashing"
|
56
|
+
name = "Melee"
|
57
|
+
text = "claws +8"
|
58
|
+
|
59
|
+
[[offense.attacks]]
|
60
|
+
actions = 2
|
61
|
+
name = "Special"
|
62
|
+
text = """\
|
63
|
+
(fire) The dragon cultist breathes flames in a 15-foot cone that deals 2d6 \
|
64
|
+
fire damage to each creature within the area (DC 14 basic Reflex save). \
|
65
|
+
The dragon cultist can't use Breath Weapon again for 1d4 rounds.\
|
66
|
+
"""
|
67
|
+
--
|
68
|
+
----
|
69
|
+
|
70
|
+
Will create the following output:
|
71
|
+
|
72
|
+
[stat]
|
73
|
+
--
|
74
|
+
name = "Dragon Cultist"
|
75
|
+
level = "1"
|
76
|
+
tags = ["ne","medium","humaniod"]
|
77
|
+
perception = "+4"
|
78
|
+
senses = "low-light vision"
|
79
|
+
skills = ["Athletics +6","Intimidation +2","Survival +4"]
|
80
|
+
|
81
|
+
[attributes]
|
82
|
+
cha = "-1"
|
83
|
+
con = "+2"
|
84
|
+
dex = "+1"
|
85
|
+
int = "-2"
|
86
|
+
str = "+3"
|
87
|
+
wis = "+1"
|
88
|
+
|
89
|
+
[defense]
|
90
|
+
ac = "16"
|
91
|
+
fort = "+7"
|
92
|
+
ref = "+6"
|
93
|
+
will = "+4"
|
94
|
+
hp = "20"
|
95
|
+
immunities = ""
|
96
|
+
reactions = ["Attack of Opportunity"]
|
97
|
+
|
98
|
+
[offense]
|
99
|
+
speed = "25"
|
100
|
+
otherSpeeds = ""
|
101
|
+
|
102
|
+
[[offense.attacks]]
|
103
|
+
actions = 1
|
104
|
+
damage = "1d10+3 slashing"
|
105
|
+
name = "Melee"
|
106
|
+
text = "claws +8"
|
107
|
+
|
108
|
+
[[offense.attacks]]
|
109
|
+
actions = 2
|
110
|
+
name = "Special"
|
111
|
+
text = """\
|
112
|
+
(fire) The dragon cultist breathes flames in a 15-foot cone that deals 2d6 \
|
113
|
+
fire damage to each creature within the area (DC 14 basic Reflex save). \
|
114
|
+
The dragon cultist can't use Breath Weapon again for 1d4 rounds.\
|
115
|
+
"""
|
116
|
+
--
|
117
|
+
|
118
|
+
== Credits
|
119
|
+
|
120
|
+
* The layout, much of the styling, and the demonstration creature come from the
|
121
|
+
https://slanguage.github.io/pf2monster/[Pathfinder 2E Monster Creator]
|
122
|
+
* Action and reaction CSS icons come from
|
123
|
+
https://www.reddit.com/r/WorldAnvil/comments/kdzog2/css_for_pathfinder_2nd_edition/[CSS for Pathfinder 2nd Edition]
|
124
|
+
* https://github.com/asciidoctor/asciidoctor-extensions-lab[Asciidoctor Extensions Lab]
|
125
|
+
was used as a reference in creating this extension.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#Source: https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/emoji-inline-macro/extension.rb
|
2
|
+
#
|
3
|
+
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
|
4
|
+
require 'erb'
|
5
|
+
require 'tomlrb'
|
6
|
+
|
7
|
+
include Asciidoctor
|
8
|
+
|
9
|
+
class P2EDocinfoProcessor < Extensions::DocinfoProcessor
|
10
|
+
use_dsl
|
11
|
+
|
12
|
+
def process doc
|
13
|
+
extdir = ::File.join(::File.dirname __FILE__)
|
14
|
+
stylesheet_name = 'p2e.css'
|
15
|
+
content = doc.read_asset %(#{extdir}/#{stylesheet_name})
|
16
|
+
['<style>', content.chomp, '</style>'] * "\n"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class P2EStatblockProcessor < Extensions::BlockProcessor
|
21
|
+
use_dsl
|
22
|
+
|
23
|
+
named :stat
|
24
|
+
on_context :open
|
25
|
+
parse_content_as :raw
|
26
|
+
|
27
|
+
def process parent, reader, attrs
|
28
|
+
# parse TOML
|
29
|
+
lines = reader.lines
|
30
|
+
creature = Tomlrb.parse(lines * "\n")
|
31
|
+
|
32
|
+
# create HTML from template
|
33
|
+
extdir = ::File.join(::File.dirname __FILE__)
|
34
|
+
template_name = 'statblock.html.erb'
|
35
|
+
template = File.read("#{extdir}/#{template_name}")
|
36
|
+
html = ERB.new(template).result_with_hash(creature)
|
37
|
+
create_pass_block parent, html, attrs, subs: nil
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
@@ -0,0 +1,128 @@
|
|
1
|
+
.statblock {
|
2
|
+
width: 500px;
|
3
|
+
border: 1px solid black;
|
4
|
+
margin: 20px;
|
5
|
+
padding: 20px;
|
6
|
+
font-family: "Roboto", Geneva, sans-serif;
|
7
|
+
font-size: 16px;
|
8
|
+
line-height: 24px;
|
9
|
+
}
|
10
|
+
.statblock-title {
|
11
|
+
font-size: 23px;
|
12
|
+
font-weight: bold;
|
13
|
+
width: 100%;
|
14
|
+
text-transform: uppercase;
|
15
|
+
}
|
16
|
+
.statblock-name {
|
17
|
+
float: left;
|
18
|
+
}
|
19
|
+
.statblock-creature {
|
20
|
+
float: right;
|
21
|
+
text-align: right;
|
22
|
+
}
|
23
|
+
.statblock-tags {
|
24
|
+
height: 26px;
|
25
|
+
/*background-color: BurlyWood;*/
|
26
|
+
width: fit-content;
|
27
|
+
}
|
28
|
+
.statblock-info-block {
|
29
|
+
clear: both;
|
30
|
+
border-top: 2px solid black;
|
31
|
+
padding-top: 5px;
|
32
|
+
}
|
33
|
+
.statblock-tag-alignment,.statblock-tag-size,.statblock-tag-other,.statblock-tag-rarity-uncommon,.statblock-tag-rarity-rare,.statblock-tag-rarity-unique {
|
34
|
+
float: left;
|
35
|
+
height: 22px;
|
36
|
+
margin: 2px;
|
37
|
+
line-height: 22px;
|
38
|
+
font-family: Geneva, sans-serif;
|
39
|
+
font-size: 14px;
|
40
|
+
font-weight: bold;
|
41
|
+
color: white;
|
42
|
+
text-transform: uppercase;
|
43
|
+
}
|
44
|
+
.statblock-tag-rarity-uncommon,.statblock-tag-rarity-rare,.statblock-tag-rarity-unique {
|
45
|
+
padding-left: 5px;
|
46
|
+
padding-right: 5px;
|
47
|
+
}
|
48
|
+
.statblock-tag-rarity-uncommon {
|
49
|
+
background-color: Sienna;
|
50
|
+
}
|
51
|
+
.statblock-tag-rarity-rare {
|
52
|
+
background-color: DarkBlue;
|
53
|
+
}
|
54
|
+
.statblock-tag-rarity-unique {
|
55
|
+
background-color: Indigo;
|
56
|
+
}
|
57
|
+
.statblock-tag-alignment {
|
58
|
+
background-color: SteelBlue;
|
59
|
+
padding-left: 5px;
|
60
|
+
padding-right: 5px;
|
61
|
+
}
|
62
|
+
.statblock-tag-size {
|
63
|
+
background-color: SeaGreen;
|
64
|
+
padding-left: 10px;
|
65
|
+
padding-right: 10px;
|
66
|
+
}
|
67
|
+
.statblock-tag-other {
|
68
|
+
background-color: DarkRed;
|
69
|
+
padding-left: 20px;
|
70
|
+
padding-right: 20px;
|
71
|
+
}
|
72
|
+
.statblock-info-other {
|
73
|
+
clear: both;
|
74
|
+
}
|
75
|
+
.statblock-info-line {
|
76
|
+
padding-left: 18px;
|
77
|
+
text-indent: -18px;
|
78
|
+
}
|
79
|
+
.statblock-line-heavy {
|
80
|
+
font-weight: bold;
|
81
|
+
}
|
82
|
+
|
83
|
+
/* Source: https://www.reddit.com/r/WorldAnvil/comments/kdzog2/css_for_pathfinder_2nd_edition/ */
|
84
|
+
.statblock-reaction {
|
85
|
+
top: 3px;
|
86
|
+
border-radius: 0px;
|
87
|
+
display: inline-block;
|
88
|
+
width: 19px;
|
89
|
+
height: 16px;
|
90
|
+
background-repeat: no-repeat;
|
91
|
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAQCAYAAAD0xERiAAAABHNCSVQICAgIfAhkiAAAAkRJREFUOI2dlM9rE0EUx9+bnf2ZTYLJZtMmVUS0x1ykxaP05kl61LsHpSgieKoHQfBkq/4HCgXxIMUiCIJQRAWhIOJBQdAiVRSzu2l2s5ndnRkvpiwxCdZ3+877vs+892AGYSgIIWbRLp7UNXVB1/QWEjJFKbVSxnxUlJ04jrd6/fhZFEVvAEDmazEHKTjV6kXbtC4gYjOfGxGcC/HO7wQ3drvddSml2IMZhnGsXnMfUEU5xJLkdZql7xOWdBCRGKYxo1I6pyBpIaI+DGVJ8vD7zx/nOOcRqqramGk07/uBf68bho8459GoVnRdP3KgXF6yrcKSlFLN55I03fj6bWcRHcc56/v+Y855OGYkzO+mUCicmHbrT6QQlZxHBt3ueUREKqXMJuznrygViwu1SvUpAOx1KKR8qwCA2A8IAIAlyWfbtucVQmYHZ5RSl+wXNIgw7G7mtUTs/zeMUrWY13Gv9/yfYJZlHW82GqsDjYhqwTJP5yws2O3cnAijCi1PufVb0zX3RZamyYBVqzrXFKK0/ugsjHvLYRS9ouNA5VJp0alU74CUBwEA+oxtEkL0muNct03rKgAgILa9wL/kB8EawIgnYxjGrFt1bquUnsqNxWLGVgxNOwMAhwFxO4yiNc/3VtIsa+/5cgVKveZesUxzGQGKQ3eABNjwAn89zbKtOI4/CCHYsEfJiyRNv2SCv+Q8+4SIjFJaBgANAIgQgvzyvMuMsW0pJR+1mkk/AyCiZhjGUcs05zVVnUvS7GPba98d5/8Nkc/n9eZdAXIAAAAASUVORK5CYII=);
|
92
|
+
}
|
93
|
+
.statblock-free-action {
|
94
|
+
top: 3px;
|
95
|
+
border-radius: 0px;
|
96
|
+
display: inline-block;
|
97
|
+
width: 16px;
|
98
|
+
height: 16px;
|
99
|
+
background-repeat: no-repeat;
|
100
|
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAl9JREFUOI19krFPFFEQxmfmvWXfvsMDBXZvF5Nb2D1yREFKrGhM6G1sBRMTG7CwAhErbFDDHyF2oDZGchTY0plYcdYIJrdcbo89jtt7FrdnFoJM8ZI3+b7ffJkMQKcQLhYiIrcta+NOcfwLY0xP+pTWdP+XzYCIzLas917ebXt5V40Xi9spSNfDIHkwBSFE5DnTeiuFsXjWOv8YRY0SR5qzLGuyEgRbSqk40as0DZPJ3LFyG17ebd92hjcRkQMADQ0Mrnt5tz3mFy4n6cRIzNSZLBYBAJvn57u1MPwKACpqRCXGeKaH83nTtCaCk2A7SdIBICLLmdY7KcSCUqoFANSjadPCENl6vV5SSrVPo9NdznmGE81ZlnWvEnQgLDGvSyGex0od/v5zPMsZG9Y0bUzjfFoX4kYYhjsAoBJIbwK5WwmCT8yx7Q2piwXGGBweHz2Iomj/NIo+92YyDxnRkMb5tDCEDMOwlEBKwhCjpOCRbTuThIABIkIcx9if7VtCRL0/2/eMc+Yn64kbjbMf3V1JQ05IXcwSUfus2dxHACAnZ69IIV4rpaAVxz8ZURERGQA0K9XqfHASfEjMU7Zp7hDRIDB6eVAurzEAoFoY7hmGBI3zGUI0EZEAoFWpVh8HJ8FmyvwtMb86KJfX0ncAAABOzl713RHluyNq4NbAk1TsKS/vHhVGvXbB85cu38E/QC0MvwvDUBrnM6AUhfX6lpRyMhV75eBX+c2Vh5SC7AlDohTiqZTy/s1s3wsiGkTGLsT+L6ADqe0Jw1CGrs8houwu7CrttTVsO6sF31++TvMXOj7bsM8roOMAAAAASUVORK5CYII=)
|
101
|
+
}
|
102
|
+
.statblock-one-action {
|
103
|
+
top: 3px;
|
104
|
+
border-radius: 0px;
|
105
|
+
display: inline-block;
|
106
|
+
width : 15px;
|
107
|
+
height: 16px;
|
108
|
+
background-repeat: no-repeat;
|
109
|
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAYAAADJViUEAAAABHNCSVQICAgIfAhkiAAAAdNJREFUKJGNUz1vE0EQnd3Z27vbu5hgGzuXQ8EoKRAUiI8mQqKgQOmQKKjoEB0NDQ2BlgqJFkWiiGgSFEQqKBBCQuJv4Arh+GKUs3fXDnceihAUX86IV76ZNx+aeQBTIISozTWarxBxdlpOKRCxshCf/rp4pkXxXPSZcx6W5hUJzrmKo2hbCuf6nwlanude1tpsEVA2VcwYE3E0/8Z1nJWjvCPEkivleW3MOwDI/zY6mkRE4zzP2gBAxYmU799u1OtrjDFR7Mzr1dpqluftvTTdVMpfECguFQtIR14UwmloY94DACEAsHq19uzEzMxqGKgVbe3WXppuKBWcE4gXigVcKa8IgYGx9iPWTlafzlYqjwGAccZPBb66MTBmI+33N8MwvIqcLxX0zJXuMuecOABN7Mc59xhjEuj43kWgHQ6/IKLvue61MdG3750fN39lWSeO5l9LIW6VaCgd9J8nvd4TBAAw1n4SAtnuz96j0f5+O46iNU/Ku2Xd+lq/7O4mDwGAWCHGo2bzhfL8BwBQjMHA6PWdJLlHdPAsE3dmjCGiaJUJjbVvd5Lk/qEQ4Ph7jgdabweBWkaOZw9JOxp+6HS7d4hoVLbKBP7XGFNxYMnGPy35G5THnjF7a0U6AAAAAElFTkSuQmCC)
|
110
|
+
}
|
111
|
+
.statblock-two-actions {
|
112
|
+
top: 3px;
|
113
|
+
border-radius: 0px;
|
114
|
+
display: inline-block;
|
115
|
+
width: 24px;
|
116
|
+
height: 16px;
|
117
|
+
background-repeat: no-repeat;
|
118
|
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAQCAYAAAAMJL+VAAAABHNCSVQICAgIfAhkiAAAAuFJREFUOI2NlEtoU0EUhs+dmTv3nebdeJu21qoVBKlSK4qKIIJQxTcUXSjiRlBw48rHzr1LxS5atBSlVfEJakVduBNEEFy40tomaROT2/tM6h0XWrlNbzD/bs588//nnMUANBDGWNEzmRuEkEwjJiCuCWaJudyRzT7t7lzJOrPtHwnGyUZsMpE4o7dmRjiOI6Fe9QWEEM2u0O/yhOz7e84osrLbtK17jDE3yMZj8eOxSMsQIWSjQIUO07Ie/S8AZfW2UUrIIQiMjRHSZUneaVrWOGPMAwCIRaNHE9HobcYYDwDA83yvQGnatK3nAMAaTiCJwg7K036o2yvGuF2WpC2mbU0wxhayuj7GfKYHGcrzm3meKJZtv6oPQKlk8jJjrFCuVO4IAs1Snt9UH04w7pIlqc+0rXHTNO9HItp+AEgEGYHSbYRgajvO5GIAl0okrkVU7YqmqAccz31UMYxRKgidlPC9ISHdkihuKBvGsO04DyOqdhAAoktDhO0YY992nHc4GU9cbdG0SwCAAKBFU5QB23XGDcMYEwVxHU/I+mUhhPSIgthTNoxhx3WfqKp6lAPQAggnCsIuhJCBKKVa/b6bEAPuzxtKaTdCKBbCuJ7nfcamZU2KohTnCelnAN+nC/k9Vc+bak2nb8mSdCLM3fW8JzP5/KCmqtvTieQDxphch3iF4tygaVnPMAAw07JeCKIozJWKF13X/ZpJp28qknw6zNyrVV/O5PJHVEXpa02mHjPGtDqkOlsqnpw3zQmA5atBranUdVVWzoXcgVervp7O5Q74vm+tWdX9xf/1a+3SvbGFYunnqcq8MfrPsN5EkqTVYZ1Xa7X307ncId/3TQBgP3IzxziOmw0gfqlcPhs0Dwvwv01NHfYZexMs1hYWPkzncwO+7xuLNdu2P83MFvZyiCsBgF+qlC+UK5WhsOaWCWOsdXV0vm3ms1NVdWs8FjvflHFQhJCWrN420uR33VC/Aa8NFknPxGqgAAAAAElFTkSuQmCC)
|
119
|
+
}
|
120
|
+
.statblock-three-actions {
|
121
|
+
top: 3px;
|
122
|
+
border-radius: 0px;
|
123
|
+
display: inline-block;
|
124
|
+
width: 32px;
|
125
|
+
height: 16px;
|
126
|
+
background-repeat: no-repeat;
|
127
|
+
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==)
|
128
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
<div class="statblock">
|
2
|
+
<div class="statblock-title">
|
3
|
+
<span class="statblock-name"><%= name %></span>
|
4
|
+
<span class="statblock-creature"> CREATURE <%= level %></span>
|
5
|
+
</div>
|
6
|
+
<div class="statblock-info-block">
|
7
|
+
<div class="statblock-tags">
|
8
|
+
<% tags.each do |tag| %>
|
9
|
+
<% if tag == "lg" or tag == "ng" or tag == "cg" or tag == "ln" or tag == "n" or tag == "cn" or tag == "le" or tag == "ne" or tag == "ce" %>
|
10
|
+
<div class="statblock-tag-alignment"><%= tag %></div>
|
11
|
+
<% elsif tag == "tiny" or tag == "small" or tag == "medium" or tag == "large" or tag == "huge" or tag == "gargantuan" %>
|
12
|
+
<div class="statblock-tag-size"><%= tag %></div>
|
13
|
+
<% elsif tag == "uncommon" %>
|
14
|
+
<div class="statblock-tag-rarity-uncommon"><%= tag %></div>
|
15
|
+
<% elsif tag == "rare" %>
|
16
|
+
<div class="statblock-tag-rarity-rare"><%= tag %></div>
|
17
|
+
<% elsif tag == "unique" %>
|
18
|
+
<div class="statblock-tag-rarity-unique"><%= tag %></div>
|
19
|
+
<% else %>
|
20
|
+
<div class="statblock-tag-other"><%= tag %></div>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
<div class="statblock-info-other">
|
25
|
+
<div class="statblock-info-line">
|
26
|
+
<span class="statblock-line-heavy">Perception </span><%= perception %> <%= senses %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="statblock-info-line">
|
30
|
+
<span class="statblock-line-heavy">Skills </span><% skills * "," %>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div class="statblock-info-line">
|
34
|
+
<span class="statblock-line-heavy">Str </span><%= attributes['str'] %>,
|
35
|
+
<span class="statblock-line-heavy">Dex </span><%= attributes['dex'] %>,
|
36
|
+
<span class="statblock-line-heavy">Con </span><%= attributes['con'] %>,
|
37
|
+
<span class="statblock-line-heavy">Int </span><%= attributes['int'] %>,
|
38
|
+
<span class="statblock-line-heavy">Wis </span><%= attributes['wis'] %>,
|
39
|
+
<span class="statblock-line-heavy">Cha </span><%= attributes['cha'] %>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div> <!-- statistics -->
|
43
|
+
<div class="statblock-info-block">
|
44
|
+
<div class="statblock-info-line">
|
45
|
+
<span class="statblock-line-heavy">AC </span><%= defense['ac'] %>;
|
46
|
+
<span class="statblock-line-heavy">Fort </span><%= defense['fort'] %>,
|
47
|
+
<span class="statblock-line-heavy">Ref </span><%= defense['ref'] %>,
|
48
|
+
<span class="statblock-line-heavy">Will </span><%= defense['will'] %>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div class="statblock-info-line">
|
52
|
+
<span class="statblock-line-heavy">HP </span><%= defense['hp'] %><%= defense['immunities'] %>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<% defense['reactions'].each do |reaction| %>
|
56
|
+
<div class="statblock-info-line">
|
57
|
+
<span class="statblock-line-heavy"><%= reaction %></span>
|
58
|
+
<span class="statblock-reaction"></span>
|
59
|
+
</div>
|
60
|
+
<% end %>
|
61
|
+
|
62
|
+
</div>
|
63
|
+
<div class="statblock-info-block">
|
64
|
+
<div class="statblock-info-line">
|
65
|
+
<span class="statblock-line-heavy">Speed </span><%= offense['speed'] %><%= offense['otherSpeeds'] %>
|
66
|
+
</div>
|
67
|
+
|
68
|
+
<% offense['attacks'].each do |attack| %>
|
69
|
+
<div class="statblock-info-line">
|
70
|
+
<span class="statblock-line-heavy"><%= attack[:name] %></span>
|
71
|
+
<% if attack['actions'] == 0 %>
|
72
|
+
<span class="statblock-free-action"></span>
|
73
|
+
<% elsif attack['actions'] == 1 %>
|
74
|
+
<span class="statblock-one-action"></span>
|
75
|
+
<% elsif attack['actions'] == 2 %>
|
76
|
+
<span class="statblock-two-actions"></span>
|
77
|
+
<% elsif attack['actions'] == 3 %>
|
78
|
+
<span class="statblock-three-actions"></span>
|
79
|
+
<% end %>
|
80
|
+
<%= attack['text'] %>
|
81
|
+
<% if attack.key?('damage') %>
|
82
|
+
<span class="statblock-line-heavy">Damage</span> <%= attack['damage'] %>
|
83
|
+
<% end %>
|
84
|
+
</div>
|
85
|
+
<% end %>
|
86
|
+
</div>
|
87
|
+
</div>
|
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: asciidoctor-p2e
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan Tolboom
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-02-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tomlrb
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Asciidoctor Pathfinder 2E Extension
|
28
|
+
email:
|
29
|
+
- ryan@using.tech
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- README.adoc
|
35
|
+
- lib/asciidoctor-p2e.rb
|
36
|
+
- lib/asciidoctor-p2e/extension.rb
|
37
|
+
- lib/asciidoctor-p2e/p2e.css
|
38
|
+
- lib/asciidoctor-p2e/statblock.html.erb
|
39
|
+
homepage: https://sr.ht/bosco/asciidoctor-p2e
|
40
|
+
licenses:
|
41
|
+
- GPL-3.0
|
42
|
+
metadata: {}
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
requirements: []
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 2.7.6
|
60
|
+
signing_key:
|
61
|
+
specification_version: 4
|
62
|
+
summary: An Asciidoctor extension for creating content for the Pathfinder 2E roleplaying
|
63
|
+
system.
|
64
|
+
test_files: []
|