MrPrimate / ddb-importer

Integrate your dndbeyond.com content into Foundry virtual tabletop
MIT License
199 stars 78 forks source link

Feature request: In-line links to things referenced in item description text #201

Open notrealdan opened 2 years ago

notrealdan commented 2 years ago

I'd like to request that, when importing anything with a text description that references certain things, the parser replace the text with a link to that thing. For example, when parsing the Description text in a spell, and a reference to another spell, an item, a condition, or anything else that would be useful to be able to quickly reference, replace the text with a journal entry style link to that thing. The link should reference things in either the dnd5e SRD compendiums (for things like conditions or other commonly-looked-up rules) or the relevant D&D Importer compendium. This feature would make looking up relevant things easy in the moment. My apologies if this has been suggested before.

Additional info and ideas for this:

Thanks!

MrPrimate commented 2 years ago

I have implemented partial support for this. Conditions, skills, and senses. Items and spells are harder - many spells are just common words (e.g. sleep) and determining if something is referring to a spell/item or just in a regular sense is a bit harder.

aprusik commented 2 years ago

I personally wouldn't mind an imperfect solution to this. If the import occasionally makes the normal word "sleep" into a spell link, I'm not going to be too bothered by it. Alternatively, if you skip linking spells that are made up of normal common words like "sleep" or "rope trick", I think that would also be an acceptable solution, at least for now.

Either way, I think it is worth it to cover the 90% of cases where they are easily identified, as it reduces the amount of work for the DM from having to edit every reference, to only a few that happen to be erroneous.

Also, a spell like "Antimagic Field" as in the example above, does use dynamic links on DnD Beyond to referenced items and spells (see below), though I don't know how well that can be leveraged. If you can identify these links, it would theoretically remove the need to even recognize the words from just text. image

MrPrimate commented 2 years ago

I might make it optional - worth noting though, the spells are not scraper from the page, but rather are transformed from data provided when you select spells in the character builder, so the text you see on these pages is slightly different

aprusik commented 2 years ago

Ah, that's interesting. Odd that DnD Beyond doesn't have the links in the character sheet spells as well.