Coder Social home page Coder Social logo

ebullient / ttrpg-convert-cli Goto Github PK

View Code? Open in Web Editor NEW
150.0 7.0 34.0 3.08 MB

Utility to convert JSON data (for content you own) from 5etools or pf2etools into Obsidian-friendly Markdown.

Home Page: https://www.ebullient.dev/projects/ttrpg-convert-cli/

License: Apache License 2.0

Java 93.60% SCSS 6.40%
5e-tools java obsidian-md picocli quarkus hacktoberfest 5etools dnd5e dungeons-and-dragons pathfinder-2e

ttrpg-convert-cli's Introduction

TTRPG convert CLI

GitHub all releases

A Command-Line Interface designed to convert TTRPG data from 5eTools and Pf2eTools into crosslinked, tagged, and formatted markdown optimized for Obsidian.md.

Jump ⬇ Download ⚙️ Configuration 🎨 Examples 🎨 Templates
🚜 Changelog 🗺️ Source Map 📖 5eTools 📖 Pf2eTools 📖 Homebrew

I use Obsidian to keep track of my campaign notes. This project parses json sources for materials that I own from the 5etools mirror to create linked and formatted markdown that I can reference in my notes.

Tip

Using the Command Line

This tool works in the command line, which is a text-based way to give instructions to your computer. If you're new to it, we have resources to help you get started below.

If you don't have a favorite method already, or you don't know what those words mean, here are some resources to get you started:

Install the TTRPG Convert CLI

There are several (many!) options for running ttrpg-convert. Choose whichever you are the most comfortable with:

Platform Options
Linux jbang, brew, bin, jar, src
Mac (Arm) brew, jbang, bin, jar, src
Mac (Intel) brew, jbang, bin, jar, src
Windows 📝, jbang, bin, jar, src
Windows (Old) 📝, jbang, jar, src
Windows (WSL) brew, jbang, jar, src

Recommendations for using the CLI

  • 🔐 Treat generated content as a big ball of mud. Stick it in a corner of your vault treat it as read-only.

    Trust us, you will want to regenerate content from time to time. It is cheap and easy to do if you don't have your own edits to worry about.

  • 🔎 Have the CLI generate output into a separate directory and use a comparison tool to preview changes.

    You can use git diff to compare arbitrary directories, for example:

    git diff --no-index vault/compendium/bestiary generated/compendium/bestiary
  • 📑 Use a copy tool that only updates modified files, like rsync, to avoid unnecessary file copying when updating your vault. Use the checksum option (-c) to compare file contents; the file modification date is meaningless given generated files are recreated when the tool is run. We have some suggestions in discussion #220, but it is very much a work in progress.

Required plugins

  • Admonitions (git/obsidian): The admonitions plugin supports a codeblock style that is used for more complicated content like statblocks. See Admonition plugin notes for more recommendations.

Recommended plugins

  • Force note view mode by front matter (git/obsidian): I use this plugin to treat these generated notes as essentially read-only. See Force note view mode plugin settings for recommendations.

  • Fantasy Statblocks (git/obsidian): Templates for rendering monsters can define a statblock in the document body or provide a full or abridged yaml monster in the document header to update monsters in the plugin's bestiary.

  • Initiative Tracker (git/obsidian): Templates for rendering monsters can include information in the header to define monsters that initiative tracker can use when constructing encounters. See Initiative Tracker plugin settings for recommendations.

  • Dataview (git/obsidian): This plugin can be used to create custom views of the data, and to create custom queries to find and display data in your vault. See Working with dataview for recommendations.

Conventions

  • Links. Documents generated by this plugin will use markdown links rather than wiki links. A css snippet can make these links less invasive in edit mode by hiding the URL portion of the string.

  • File names. To avoid conflicts and issues with different operating systems, all file names are slugified (all lower case, symbols stripped, and spaces replaced by dashes). This is a familiar convention for those used to jekyll, hugo, or other blogging systems.

    • File names for resources outside of the core books (PHB, MM, and DMG) have the abbreviated source name appended to the end to avoid file collisions.
    • All files have an aliases attribute that contains the original name of the resource.
  • Organization. Files are generated in two roots: compendium and rules. The location of these roots is configurable. These directories will be populated depending on the sources you have enabled.

    • compendium contains files for items, spells, monsters, etc. The compendium directory is further organized into subdirectories for each type of content. For example, all items are in the compendium/items directory.

    • rules contains files for conditions, weapon properties, variant rules, etc.

    • css-snippets will contain CSS files for special fonts used by some content. You will need to copy these snippets into your vault (.obsidian/snippets) and enable them (Appearance -> Snippets) to ensure all content in your vault is styled correctly.

  • Styles. Every document has a cssclasses attribute that assigns a CSS class. We have some CSS snippets that you can use to customize elements of the compendium.

    • 5e tools: json5e-background, json5e-class, json5e-deck, json5e-deity, json5e-feat, json5e-hazard, json5e-item, json5e-monster, json5e-note, json5e-object, json5e-psionic, json5e-race, json5e-reward, json5e-spell, and json5e-vehicle.
    • pf2e tools: pf2e, pf2e-ability, pf2e-action, pf2e-affliction, pf2e-archetype, pf2e-background, pf2e-book, pf2e-delity, pf2e-feat, pf2e-hazard, pf2e-index, pf2e-item, pf2e-note, pf2e-ritual, pf2e-sleep, pf2e-trait.
  • Admonitions. Generated content uses code-block-style Admonitions in addition to Obsidian callouts. We have Admonition definitions that you can import to ensure these admonition/callout types are defined.

    • ad-statblock
    • 5e tools: ad-flowchart, ad-gallery, ad-embed-action, ad-embed-feat, ad-embed-monster, ad-embed-object, ad-embed-race, ad-embed-spell, ad-embed-table
    • pf2e tools: ad-embed-ability, ad-embed-action, ad-embed-affliction, ad-embed-avatar, ad-embed-disease, ad-embed-feat, ad-embed-item, ad-pf2-note, ad-pf2-ritual.

Convert 5eTools JSON data

Note

Instructions here use backslashes to wrap lines for readability (a common practice for linux-based command shells). If you are using Windows, you will need to remove the backslashes and put the command on a single line. You may also need to append .exe to the command name (though it should work without).

  1. Create a shallow clone of the 5eTools mirror repo (which can/should be deleted afterwards):

    git clone --depth 1 https://github.com/5etools-mirror-2/5etools-mirror-2.github.io.git
  2. Invoke the CLI. In this first example, let's generate indexes and markdown for SRD content:

    ttrpg-convert \
      --index \
      -o dm \
      5etools-mirror-2.github.io/data
    • --index generates two index files: all-index.json and src-index.json.

      🚀 TIP:

      • Use all-index.json to see the reference keys for all discovered content. This can confirm that an included source was actually read.
      • Use src-index.json to see the reference keys for content that was included in the generated output. This can confirm that your source selection is working as expected.
    • -o dm The target output directory (dm in this case). Files will be created in this directory.

    The rest of the command-line specifies input files:

    • 5etools-mirror-2.github.io/data Path to the 5etools data directory (from a clone or release of the repo)

    This should produce a set of markdown files in the dm directory that contains only SRD content.

  3. Invoke the command again and include additional sources:

    ttrpg-convert \
        --index \
        -o dm \
        -s PHB,DMG,SCAG \
        5etools-mirror-2.github.io/data
    • -s PHB,DMG,SCAG will include reference material from the Player's Handbook, the Dungeon Master's Guide, and the Sword Coast Adventurer's Guide.

      🚀 Note: Only include content you own. Find the identifier for your sources in the Source Map.

We now know that the CLI is working!

Specifying sources on the command line with the -s option gets messy in a hurry. Configuration beyond this basic example should use a configuration file, specified with the -c option, like this:

ttrpg-convert \
    --index \
    -o dm \
    -c my-config.json \
    5etools-mirror-2.github.io/data

Next step:

Convert Pf2eTools JSON data

🚜 🚧 🚜 🚧 🚜 🚧 🚜 🚧

Note

Instructions here use backslashes to wrap lines for readability (a common practice for linux-based command shells). If you are using Windows, you will need to remove the backslashes and put the command on a single line. You may also need to append .exe to the command name (though it should work without).

  1. Download a release of the Pf2eTools mirror, or create a shallow clone of the repo (which can/should be deleted afterwards):

    git clone --depth 1 https://github.com/Pf2eToolsOrg/Pf2eTools.git
  2. Invoke the CLI. In this first example, let's generate indexes and markdown for default content:

    ttrpg-convert \
      -g pf2e \
      --index \
      -o dm \
      Pf2eTools/data
    • -g pf2e The game system! Pathfinder 2e!

    • --index generates two index files: all-index.json and src-index.json.

      🚀 TIP:

      • Use all-index.json to see the reference keys for all discovered content. This can confirm that an included source was actually read.
      • Use src-index.json to see the reference keys for content that was included in the generated output. This can confirm that your source selection is working as expected.
    • -o dm The target output directory. Files will be created in this directory.

    The rest of the command-line specifies input files:

    • Pf2eTools/data Path to the Pf2eTools data directory (from a clone or release of the repo)
  3. Invoke the command again and include additional sources:

    ttrpg-convert \
        -g pf2e \
        --index \
        -o dm \
        -s AV1,GMG \
        Pf2eTools/data
    • -s AV1,GMG will include reference material from the Abomination Vaults #1: Ruins of Gauntlight, and the Gamemastery Guide.

      🚀 Note: Only include content you own. Find the identifier for your sources in the Source Map.

We now know that the CLI is working!

Specifying sources on the command line with the -s option gets messy in a hurry. Configuration beyond this basic example should use a configuration file, specified with the -c option, like this:

ttrpg-convert \
    -g pf2e \
    --index \
    -o dm \
    -c my-config.json \
    Pf2eTools/data

Next step:

Convert Homebrew JSON data

The CLI tool also has the ability to import homebrewed content, though this content must still fit the json standards that are set by in the 5eTools json spec or the PF2eTools json spec (coming soon, similar to 5eTools).

Perhaps the simplest thing to do to import homebrew is to use already existing homebrew data from the 5etools homebrew github repo: https://github.com/TheGiddyLimit/homebrew.

Tip

🍺 You only need the particular file you wish to import.

Homebrew data is different from the 5etools data. Each homebrew file is a complete reference. If you compare it to cooking: the 5etools mirror repo is organized by ingredient (all of the carrots, all of the onions, ... ); homebrew data is organized by prepared meal / complete receipe.

Adding homebrew content is easiest if you use a configuration file, we will assume a file named my-config.json for the example below, but you can use any name you like.

Important

🚀 Respect copyrights and support content creators; use only the sources you own.

For example, if you wanted to use Benjamin Huffman's popular homebrewed Pugilist class:

  1. Download a copy of the Pugilist json file.

    Save this file to a well-known location on your computer. It is probably easiest if it sits next your 5eTools or Pf2eTools directory.

  2. Update your configuration file to add a homebrew section under full-source:

    {
      "full-source": {
        "homebrew": [
            "path/to/Benjamin Huffman; Pugilist.json"
        ]
      }
    }
    • path/to/ is a placeholder for a relative or absolute path to the file1. There are a few ways to figure out the path to a file.
      • You may be able to drag and drop the file into the terminal window.
      • You may have the ability to right-click on the file and select "Copy Path".
      • Windows users: When pasting the path into a text editor, use find/replace to replace all \ with /.
  3. Run the command like so (for 5e homebrew):

    ttrpg-convert \
        --index \
        -o hb-compendium \
        -c my-config.json
        5etools-mirror-2.github.io/data
    • -o hb-compendium is the output directory for generated content.
    • -c my-config.json' is the name and/or path to your configuration file.

See configuration for more details on how to configure the CLI.

The process is similar for other homebrew, including your own, so long as it is broadly compatible with the 5e-tools json spec.

Where to find help

  • There is a #cli-support thread in the #tabletop-games channel of the Obsidian Discord.
  • There is a TTRPG-convert-help post in the obsidian-support forum of the Obsidian TTRPG Community Discord.
  • There is a TTRPG-convert tutorial (currently aimed at Windows users, but much of it is helpful no matter your OS) at Obsidian TTRPG Tutorials.
  • If you open an issue for an error, run with the --debug and --log options, and attach the log file to the issue.

Want to help fix it?

  • If you're familiar with the command line and are comfortable running the tool, I hope you'll consider running unreleased snapshots and reporting issues.
  • If you want to contribute, I'll take help of all kinds: documentation, examples, sample templates, stylesheets are just as important as Java code. See CONTRIBUTING.

Other notes

This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its website: https://quarkus.io/.

This project is a derivative of fc5-convert-cli, which focused on working to and from FightClub5 Compendium XML files. It has also stolen some bits and pieces from pockets-cli.

Buy Me A Coffee

Footnotes

  1. Description of relative vs absolute file paths: https://stackoverflow.com/a/10288252 . If you use a relative path, it will be resolved relative to the current working directory, as described here: https://en.wikipedia.org/wiki/Working_directory.

ttrpg-convert-cli's People

Contributors

caedis avatar dependabot[bot] avatar ebullient avatar failwiz avatar github-actions[bot] avatar jathok avatar mcdevnagh avatar mclearc avatar miscoined avatar mkouba avatar oneradreddad avatar paulsnoops avatar sigrunixia avatar step-security-bot avatar steveax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ttrpg-convert-cli's Issues

dsotdq Deity conflict

Source DSotDQ is unknown
Writing files to G:\OneDrive\Documents\ObsidianScripts\5e-convert\dm

deity|sirrion|phb
deity|sirrion|dsotdq

deity|takhisis|dsotdq
deity|takhisis|phb

deity|sargonnas|phb
deity|sargonnas|dsotdq

deity|kiri-jolith|dsotdq
deity|kiri-jolith|phb

deity|habbakuk|dsotdq
deity|habbakuk|phb

deity|hiddukel|dsotdq
deity|hiddukel|phb

deity|nuitari|dsotdq
deity|nuitari|phb

deity|zeboim|phb
deity|zeboim|dsotdq

deity|zivilyn|dsotdq
deity|zivilyn|phb

deity|branchala|phb
deity|branchala|dsotdq

deity|shinare|dsotdq
deity|shinare|phb

deity|gilean|phb
deity|gilean|dsotdq

deity|lunitari|dsotdq
deity|lunitari|phb

deity|solinari|phb
deity|solinari|dsotdq

deity|chemosh|phb
deity|chemosh|dsotdq

deity|chislev|phb
deity|chislev|dsotdq

deity|majere|phb
deity|majere|dsotdq

deity|reorx|dsotdq
deity|reorx|phb

deity|mishakal|dsotdq
deity|mishakal|phb

deity|morgion|phb
deity|morgion|dsotdq

deity|paladine|dsotdq
deity|paladine|phb

monster2md-yamlStatblock-body.txt not providing actions/traits correctly

I use this command: 5e-convert --index -o dm --monster monster.template 5etools-mirror-1.github.io/data, where monster.template is a copy of monster2md-yamlStatblock-body.txt. Looking at the generated code of thug.md (dm/compendium/bestiary/humanoid/thug.md), it has this

"traits":
- !!dev.ebullient.json5e.qute.Trait {
  }
"actions":
- !!dev.ebullient.json5e.qute.Trait {
  }
- !!dev.ebullient.json5e.qute.Trait {
  }
- !!dev.ebullient.json5e.qute.Trait {
  }

So, while it has the correct number of actions and traits, it doesn't have the correct content for these items.

Import fluff images for monsters (beyond tokens)

{
    "name": "Ancient Deep Crow",
...
    "images": [
        {
            "type": "image",
            "href": {
                "type": "internal",
                "path": "bestiary/AI/Deep Crow.jpg"
            }
        }
    ]
},

Something like this to read images from monster fluff and pass to QuteTemplate:

https://github.com/ebullient/json5e-convert-cli/blob/7f6a600c5727e928e5a80b28576c8a95cb05d337/src/main/java/dev/ebullient/json5e/tools5e/Json2QuteMonster.java#L464

These should be separate from the token image for rendering, but all images need to be together for copying. This is the internal method called when the file is written to fetch images to copy (note that it is not a getter..)

https://github.com/ebullient/json5e-convert-cli/blob/7f6a600c5727e928e5a80b28576c8a95cb05d337/src/main/java/dev/ebullient/json5e/qute/QuteMonster.java#L111

✨ Add Level Up: Advanced 5th Edition compendium

With all the good work going on to add pf2e to this wonderful tool, I would like to ask if you could also try to do the same for Advanced 5th Edition (a5e) at https://a5e.tools. With that I would have to change my mechanics altogether, but could use the new monsters/npcs, spells, items, etc. from those source books:

"Level Up: Advanced 5th Edition tools site. Here you will find the rules of the game, along with searchable directories of spells, combat maneuvers, magic items, monsters, and more. Level Up is a deeper, more flexible version of the 5E ruleset which you know and love. If you love 5E but would like a little more depth to the ruleset, Level Up is the game for you! Developed by a diverse team of 5th Edition experts, and a two-year public playtest of thousands of people, this is the ultimate expression of the 5E ruleset."

Dice Roller in Statblocks

Discussed in #121

Originally posted by XintakXVI April 25, 2023
Is there any way to get dice roller functionality in the monster statblocks?
Thanks!

Latest 5e-convert.exe gives error when indexing.

g:\OneDrive\Documents\ObsidianScripts\5e-convert>5e-convert.exe --index -o dm 5etools-mirror-1.github.io/data
ÔÅ▒ Reading g:\OneDrive\Documents\ObsidianScripts\5e-convert\5etools-mirror-1.github.io\data
 finished reading 5etools data.
java.lang.IllegalArgumentException: argument "in" is null
at com.fasterxml.jackson.databind.ObjectMapper._assertNotNull(ObjectMapper.java:4829)
at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:3055)
at dev.ebullient.json5e.io.Json5eTui.readResource(Json5eTui.java:254)
at dev.ebullient.json5e.io.Json5eTui_ClientProxy.readResource(Unknown Source)
at dev.ebullient.json5e.tools5e.JsonIndex.prepare(JsonIndex.java:221)
at dev.ebullient.json5e.Json5eConvertCli.call(Json5eConvertCli.java:163)
at dev.ebullient.json5e.Json5eConvertCli.call(Json5eConvertCli.java:37)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at dev.ebullient.json5e.Json5eConvertCli.executionStrategy(Json5eConvertCli.java:191)
at picocli.CommandLine.execute(CommandLine.java:2078)
at dev.ebullient.json5e.Json5eConvertCli.run(Json5eConvertCli.java:211)
at dev.ebullient.json5e.Json5eConvertCli_ClientProxy.run(Unknown Source)
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:131)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:43)
at io.quarkus.runner.GeneratedMain.main(Unknown Source)

Monster names as links for 5e Statblocks?

If the name of the monster in the YAML is a link to the monster note, then it would be helpful for accessing the relevant monster file quickly from the initiative tracker Combatant window or from the Statblocks itself. Currently it is not a link and I don't think I can easily make that change in the template for my monsters.

Items have issues with displaying the tier

Here's an example of the output

---
obsidianUIMode: preview
cssclass: json5e-item
tags:
- compendium/src/dmg
- item/wondrous
- item/rarity/minor
- item/rarity/rare
aliases: ["Quaal's Feather Token, Tree"]
---
# Quaal's Feather Token, Tree
*Wondrous Item, minor, minor, rare*  

Note that there are two item/rarity tags. The first of those (minor) should be item/tier instead of item/rarity.
This can be corrected by changing the tagvalue of MAJOR and MINOR in PropertyEnum.java.

Also, resource.detail lists the tier twice (as in the above example: Wondrous Item, minor, minor, rare ).
I can't offer a suggestion how to fix that.

"At Higher Levels" text is missing from spells

When generating spells, the "At higher levels" text is missing from the markdown:

---
obsidianUIMode: preview
cssclass: json5e-spell
tags:
- compendium/src/phb
- spell/school/evocation
- spell/level/1
- spell/class/artificer/alchemist
- spell/class/bard
- spell/class/cleric
- spell/class/druid
aliases: ["Healing Word"]
---
# Healing Word
*1st-level, Evocation*  

- **Casting time:** 1 bonus
- **Range:** 60 feet
- **Components:** V
- **Duration:** Instantaneous

A creature of your choice that you can see within range regains hit points equal to 1d4 + your spellcasting ability modifier. This spell has no effect on undead or constructs.

**Classes**: Artificer (Alchemist), Bard, Cleric, Druid

Source: Player's Handbook p. 250

image

Running release 1.0.15

Thanks <3

I keep getting a java.lang.NullPointerException when trying to run the basic CLI

I was trying to run this line as is:
5e-convert
--index
-o dm
-s PHB,DMG,SCAG
5etools-mirror-1.github.io/data
5etools-mirror-1.github.io/data/adventure/adventure-lox.json
5etools-mirror-1.github.io/data/book/book-aag.json
my-items.json dm-sources.json
and I have limited knowledge of how this works but I know that I have made a mirror of the 5e-tools github. I figured that it would just make a folder titled DM within the folder then populate it with the base books information. I don't know why but I keep getting this error:

java.lang.NullPointerException
at java.base/java.util.TreeMap.compare(TreeMap.java:1291)
at java.base/java.util.TreeMap.put(TreeMap.java:536)
at java.base/java.util.TreeSet.add(TreeSet.java:255)
at dev.ebullient.convert.io.Tui.readToolsDir(Tui.java:401)
at dev.ebullient.convert.io.Tui_ClientProxy.readToolsDir(Unknown Source)
at dev.ebullient.convert.RpgDataConvertCli.call(RpgDataConvertCli.java:198)
at dev.ebullient.convert.RpgDataConvertCli.call(RpgDataConvertCli.java:39)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at dev.ebullient.convert.RpgDataConvertCli.executionStrategy(RpgDataConvertCli.java:253)
at picocli.CommandLine.execute(CommandLine.java:2170)
at dev.ebullient.convert.RpgDataConvertCli.run(RpgDataConvertCli.java:273)
at dev.ebullient.convert.RpgDataConvertCli_ClientProxy.run(Unknown Source)
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:129)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
at io.quarkus.runner.GeneratedMain.main(Unknown Source)

I have also installed quarkus and run the quarkus build function prior to getting this error. I will also attach my folder structure for reference. Any help would be greatly appreciated, I just want to get the data files in obsidian so that I can have the references for the dnd campaign I am in.

java lang NullPointerException

Support `include` of specific key

For example, buying a single element from a book via D&D Beyond.

include should be read from config (alongside exclude rules), and applied first (quick return) when testing whether or not a key is included.

Will need to double check for the key and not just the source in some places.

Tables generated from PHB have missing row data

To reproduce

Run the tool with PHB as the source and passing in book-phb.json:

docker run -v ~/code/personal/5etools-mirror-1.github.io:/5etools -v `pwd`:/ws --workdir=/ws -ti jbangdev/jbang-action https://jitpack.io/dev/ebullient/json5e-convert-cli/1.0.14/json5e-convert-cli-1.0.14-runner.jar --index -o dm -s PHB /5etools/data /5etools/img /5etools/data/book/book-phb.json

(replace ~/code/personal/5etools-mirror-1.github.io with the directory of your 5etools content)

Expected

Populated tables

Actual

Tables that are partially filled:

| Item | Cost | Weight |
|------|------|--------|
| _Artisan's tools_ |  |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| [Disguise Kit](/compendium/items/disguise-kit.md) | 25 gp | 3 lb. |
| [Forgery kit](/compendium/items/forgery-kit.md) | 15 gp | 5 lb. |
| _Gaming sets_ |  |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| [Herbalism kit](/compendium/items/herbalism-kit.md) | 5 gp | 3 lb. |
| _Musical instruments_ |  |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| row | row-indent-first |  |
| [Navigator's tools](/compendium/items/navigators-tools.md) | 25 gp | 2 lb. |
| [Poisoner's kit](/compendium/items/poisoners-kit.md) | 50 gp | 2 lb. |
| [Thieves' tools](/compendium/items/thieves-tools.md) | 25 gp | 1 lb. |
| Vehicles (land or water) | * | * |
^item-cost-weight

Thank you for this tool!!! 🙏

Provide just the path for resource.image

Currently resource.image returns an image.
eg:
![](/z_Compendium/deities/img/symbol-of-tempus.jpg#symbol)

While this is logical, it makes it impossible to do any formatting on the image via a custom template.
If it just returned the path: /z_Compendium/deities/img/symbol-of-tempus.jpg, formatting can be done in the template, like this:

{#if resource.image}![symbol|200]({resource.image}){/if}

Support flowcharts

Unknown entry object type flowchart from sources[note|infernal machine rebuild|imr]: {
  "type" : "flowchart",
  "blocks" : [ {
    "type" : "flowBlock",
    "name" : "Chapter 1: The Unicorn and the Hags",
    "page" : 4,

Support optfeature

Unknown entry object type optfeature from sources[note|the tortle package|ttp]: {
  "type" : "optfeature",
  "name" : "Kwilgok",

✨ 5e: Support/include Generic Items

Unconverted text in Markdown files

Hello! First off, thanks for such a great tool!

I noticed that in many of the resulting Markdown files, there are instances of text of the form {@something somethingelse} which I believe were supposed to be converted to links. For example, the file conjure-elemental.md in /compendium/spells has {@status concentration}, instead of linking to /rules/status.md##Concentration (I think).
I have no experience with Java, but after a long search, maybe it could be related to the JsonSource.java file, as I don't see a pattern to match for {@status concentration}.

✨ Convert Open5e website to Obsidian

What is Open5e?
Open5e is an open resource of 5th edition Dungeons & Dragons rules and tools that serves over 125,000 players, DMs, and content-creators every month. (Fun fact: you guys really love reading about monks!)

We are firmly ad-free. You will never see an ad or a link to a store on Open5e. Frustration with advertising is a big part of why we started the site; that's why we're asking for your support to make this resource better.

I would love to see this tool also use the SRDs from all the other projects like KoboldPress, Level Up: Advanced 5th Edition, etc.

setting 'paths' in json sourcefile doesn't work correctly

Version: 1.0.11
Using the attached json-files:

  1. When using paths.json with the following command:
    5e-convert.cmd --index -o iwd2 -s SCAG .\5etools-mirror-1.github.io\data .\paths.json
    All output (deities, items, races... and tables and variant-rules) is put in the directory z_rules. There is no compendium directory.

  2. When using paths2.json with the following command:
    5e-convert.cmd --index -o iwd2 -s SCAG .\5etools-mirror-1.github.io\data .\paths.json
    All rules are in the directory z_rules. (correct)
    The compendium entry in the json file is ignored and instead, it created a rules directory and put all deities, items, etc there.

In both cases though, the deity files that refer to an image do so using the paths that were requested in the json-file.
eg

# Cyric
*Source: Sword Coast Adventurer's Guide p. 21* 
![](/z_Compendium/deities/img/symbol-of-cyric.jpg#symbol) 

paths2.zip

"Alternate Names" are missing from deity files

Eg: Auril as listed on 5e.tools

Auril, Goddess of Winter
--
Alignment: neutral evil
Alternate Names: The Frostmaiden, Lady Frostkiss, Icedawn
Category: None
Domains: Nature, Tempest
Pantheon: Faerûnian
Symbol: Six-pointed snowflake

Auril.md output:

# Auril
*Source: Sword Coast Adventurer's Guide p. 21* 
![](/compendium/deities\img\symbol-of-auril.jpg#symbol) 

- **Alignment**: Neutral Evil
- **Domains**: Nature, Tempest
- **Pantheon**: Faerûnian
- **Symbol**: Six-pointed snowflake

5eTools Homebrew JSON Support

5eTools has a well established homebrew community hosted: https://github.com/TheGiddyLimit/homebrew
This includes personal small homebrews and larger format 3rd party sources converted at similar quality to the main site but not from WotC.

The data structure is slightly different in that rather than property specific files, the homebrew repository hosts standalone files with multiple properties stored together following the following top level schema where the source information is also defined: https://github.com/TheGiddyLimit/5etools-utils/blob/master/schema/brew/homebrew.json

Add support for importing homebrew files standalone, or paired with main site content.

✨ Passing through custom .json files

Scope

Documentation
.json Files
Handlebar Templates
Possible CLI alteration

Description

Per our conversation this morning, here is a Feature Request asking for documentation on how to compile .json files for individual things such as:
Custom Adventure Books
Custom Spells
Custom Monsters
Custom Npc
And More...

So that the TTRPG community can share home-brew content with each other in a different way besides the .csv/handlebar template method with your lovely tool.

Additionally, because this may include content that is not limited to the dungeons and dragons system, documentation of how to set up matching handlebar templates may be necessary as some systems use many more variables, and some use much less.

[Bug] Setting paths in json config does not link properly

Version: 1.1.1

Issue:
Perhaps I am just misunderstanding the configuration steps. I would like to move all generated content into /References/Compendium/ and /References/Rules, as i have a particualr organization structure for my vault. When I use the following configuration, the files are generated in the appropriate directory, but the links still point at /Compendium/ and /Rules/ respectively instead of as subdirectories under /References/.

{
  "from": [
    "PHB",
    "EGW"
  ],
  "paths": {
    "compendium": "/References/Compendium/",
    "rules": "/References/Rules/"
  }
}

If I then open up a bestiary note of a monster that causes a condition, the links for that condition are to /Rules/conditions.md

Any help would be greatly appreciated. Wonderful work on this!

Add two spaces to the beginning of any tags

The YAML format is very strict with regards to formatting, afaiu. I have been told I should use only a set number of spaces versus anything else. It seems to me that even starting a tag at the beginning of the line is also not YAML conform. Such as the following:

tags:
- tag1
- tag2

Can I make a suggestion to modify this so that there are always two spaces (or however many the actual format requires) before the - sign? Such as:

tags:
  - tag1
  - tag2

TTRPG-CLI Callouts

I recall yesterday you asked me to make an issue on this. Since I know you are busy with the pocket generator, and this is a lower priority issue, here is a topic.

The following callouts will need to be renamed with a pf2 prefix added.

  • Quote
  • Note
  • Example
  • Tip

Additionally the following callouts will need to take on a different name when inside an Admonition:

  • Note

Finally, the following two admonitions need new names:
ad-note
ad-summary

Deity files use a mix of forward and backward slashes

Version: 1.0.9
Command : 5e-convert.cmd --index -o ttt -s SCAG 5etools-mirror-1.github.io/data

Here's the output for auril.md

# Auril
*Source: Sword Coast Adventurer's Guide p. 21* 
![](/compendium/deities\img\symbol-of-auril.jpg#symbol) 

I think this should be:

# Auril
*Source: Sword Coast Adventurer's Guide p. 21* 
![](/compendium/deities/img/symbol-of-auril.jpg#symbol) 

How to individually access stat scores in template.

How to individually access stat scores in template (including the bonus's).

So for example:
If I want to use an info box to reformat and add in Dice Roller functionality:

[!infobox]

Stats
Type Stat
STR 19 (+3) dice: 1d20 +3

Ideally I could access this with

|STR|{resource.str} ({resource.strbonus}) dice: 1d20 {resource.strbonus}|

Thoughts?
C

Some links are broken

Some of the links in the Markdown files have a missing /, so it points to a file that doesn't exist.
As an example, the conjure-elemental.md file in /compendium/spells has the link [fire elemental](/compendium/bestiaryelemental/fire-elemental.md), which doesn't exist because it's missing a slash to separate bestiary and elemental. The correct link would be /compendium/bestiary/elemental/fire-elemental.md), which points to an actually existing file.

This problem seems to have occurred exclusively with links to the bestiary.

Template exception error

Hi -- it looks like there are further template issues when using the TTRPG statblock templates. I'm getting versions of the following:

io.quarkus.qute.TemplateException: Rendering error: Property "description" not found on the base object "dev.ebullient.convert.tools.dnd5e.qute.QuteBackground" in expression {resource.description}

This happens with basically any conversion from 5etools JSON with a TTRPG statblock template.
Unfortunately I am completely new to quarkus, et. al, so I'm not sure how to proceed. If there is further info you need from me please just let me know.

Class data is missing: 5e-convert 1.1.0

Debug output:

🔧 classtype|sorcerer|phb: subclassfeature|wild magic|sorcerer||wild||1 not found or excluded
🔧 classtype|sorcerer|phb: subclassfeature|bend luck|sorcerer||wild||6 not found or excluded
🔧 classtype|sorcerer|phb: subclassfeature|controlled chaos|sorcerer||wild||14 not found or excluded
🔧 classtype|sorcerer|phb: subclassfeature|spell bombardment|sorcerer||wild||18 not found or excluded
🔧 classtype|sorcerer|phb: subclassfeature|clockwork soul|sorcerer||clockwork soul|tce|1 not found or excluded
🔧 classtype|sorcerer|phb: subclassfeature|bastion of law|sorcerer||clockwork soul|tce|6 not found or excluded
🔧 classtype|sorcerer|phb: subclassfeature|trance of order|sorcerer||clockwork soul|tce|14 not found or excluded

and on and on and on. Revisions to 5e data over the holiday, could be key construction changes.

output 'Wrote x files to yyyy.' reports x incorrect.

Version: 1.0.9
Command: 5e-convert.cmd --index -o ttt -s SCAG 5etools-mirror-1.github.io/data

Commandline output:

Importing/Converting items from 5e tools [D:\Temp\test\5etools-mirror-1.github.io\data] to D:\Temp\test\ttt.
?  Reading 5eTools data from D:\Temp\test\5etools-mirror-1.github.io\data
? finished reading 5etools data.
? Writing files to D:\Temp\test\ttt
? Wrote 1 files to races.
? Wrote 1 files to backgrounds.
? Wrote 1 files to spells.
? Wrote 1 files to deities.
? Wrote 1 files to feats.
? Wrote 1 files to items.
? Wrote 4 notes (rules and tables).
? Wrote 1 notes (rules and tables).
? Wrote 130 notes (rules and tables).

Checking the compendium directory, I find:
14 backgrounds
110 deities
2 feats
14 items
12 races
5 spells
4 tables

In the rules directory:
121 variant rules
1 file: item-properties

Import of Books with subtitles ":" break markdown.

It looks like the output from books which have a colon in the title break markdown when viewed in Obsidian. Fixed manually by changing the colon to "SPACE DASH SPACE" " - " so that they show up correctly.

Its and easy fix from our end but having to do that after every export is teadious.

I found this while checking the spell lists. The spells below are teh first ones that i came across with the issue and the text below them is how I fixed them.

Acid Stream:
"Unearthed Arcana:"
"Unearthed Arcana - "

Blade Of Disaster:
"Icewind Dale:"
"Icewind Dale - "

Blade Of Disaster: Doesnt import Classes)

borrowed-knowledge
"Strixhaven:"
"Strixhaven - "

Gust:
"Eberron: Rising"
"Eberron - Rising"

Linked Glyphs
"Adventures in the Forgotten Realms:"
"Adventures in the Forgotten Realms - "

Suggestion: Create a -s keyword that is the equivalent of *

In order to avoid having to escape -s * in all kinds of weird ways, it might be useful to have a source abbreviation that can be used instead of *.

eg: 5e-convert.cmd --index -o ttt -s ALL 5etools-mirror-1.github.io/data

This might be a Windows specific request :)

[FR]: Provide option for fully qualified or partially qualified directories

I notice that when I do not put the root folder (name it "compendium") into the root of my vault, none of the wikilinks nor pictures work, because of the preceding / in the file name automatically generated by the tool.

By removing this, Obsidian finds the image, or file without an issue. I do not want to change the default behaviour (as many of you do use it in your root directory), but would it be possible to have an option to turn on|off manually the use of the initial forward slash

This would greatly help me as finding & replacing these are tedious due to different directory names (like rules, bestiary, etc.)

[Tracking] TTRPG-CLI CSS/SCSS

This is just for my things on #113 . Mainly to help me keep track.

What I think is "Done":

  • Pf2 Callouts
  • Pf2 Admonitions
  • Scoped CSS where it would interact with themes.

(I actually so far have not needed to scope anything to specific page-types yet).

What could need work:

  • 1. Color cohesion. Everything is pulled from the books but was also made to be more accessible. Thus some things just.. need a design pass.

  • 2. Probably a font pass.

What does need work:

  • 1. Trait Shadows for Uncommon.md, Rare.md, and so on. I am not sure how to beat the specificity there.

  • 3. Re-adding a dark theme for the icons. I'll likely get to this tomorrow.

  • 4. A specific interaction between embedded callouts where the embedded callout fights with the "parent" callout. I've tried some things but will need to come back to this.

  • 5. Statblock-pf2e

Can be tackled at some point just for completeness.

  • 1. Statblock-5e
  • 2. Flowchart Admonition

Suggestion: Using an non-existant templatefile should report a clearer error message

Version: 1.0.11

Command: 5e-convert.cmd --deity idonotexist.txt -o out -s SCAG 5etools-mirror-1.github.io/data
Output:

Could not invoke void dev.ebullient.json5e.io.TemplatePaths.setFeatTemplatePath(java.nio.file.Path) with idonotexist.txt
(java.lang.NullPointerException: Cannot invoke "dev.ebullient.json5e.io.Json5eTui.errorf(String, Object[])" because "this.tui" is null)
Convert 5etools data to markdown
Usage: ...

It would be clearer if the error message simply stated: Cannot find idonotexist.txt. Please specify an existing template or something similar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.