asciidoctor-p2e

pathfinder

As far as text processors go, I’m a big fan of Asciidoctor. This blog is rendered from it, presentations for my classes are created with it, heck I even wrote a textbook in it. So it should come as no suprise that when I wanted to keep track of things for a Pathfinder roleplaying campaign I turned to Asciidoctor.

Unfortunately I couldn’t really figure out an easy way to get all the stats for an NPC in a reasonable space. Fortunately, Pathfinder already has a really nice looking stat block as shown in this Pathfinder 2E Monster Creator. So after a few reads of the Asciidoctor Extensions Lab documentation and a few fist fights with ERB, I wrote an Asciidoctor extension that parses stat blocks (in TOML) into nice looking Pathfinder-style stat blocks.

With a few quick changes to Hugo and adding the CSS to my theme I can show the extension off right here. Here is the source for a deliquent monkey that one of our party members tags along with:

[stat]
--
name = "Hoo Man"
level = "1"
tags = ["ce","tiny"]
perception = "+1"
senses = "scent"
skills = ["Intimidation +2", "Thievery +1"]

[attributes]
cha = "-2"
con = "+1"
dex = "+2"
int = "-2"
str = "-1"
wis = "-1"

[defense]
ac = "10"
fort = "+2"
ref = "+6"
will = "+1"
hp = "10"
immunities = ""
reactions = ["Attack of Opportunity"]

[offense]
speed = "25"
otherSpeeds = "Climb Speed 25"

[[offense.attacks]]
actions = 1
damage = "1d4 piercing"
name = "Melee"
text = "teeth +4"

[[offense.attacks]]
actions = 2
name = "Helicopter Dance"
text = """\
  Hoo Man dazzles anyone watching with a unique dance causing anyone who \
  fails a Will save (DC 15) to become fascinated.\
  """
--

And here is the resulting stat block:

Hoo Man CREATURE 1
ce
tiny
Perception +1 scent
Skills Intimidation +2,Thievery +1
Str -1, Dex +2, Con +1, Int -2, Wis -1, Cha -2
AC 10; Fort +2, Ref +6, Will +1
HP 10
Attack of Opportunity
Speed 25 Climb Speed 25
teeth +4 Damage 1d4 piercing
Hoo Man dazzles anyone watching with a unique dance causing anyone who fails a Will save (DC 15) to become fascinated.

If you’re interested in learning more you can…​