A module to integrate World Anvil with Foundry Virtual Tabletop.

Overview

Foundry Virtual Tabletop - World Anvil Integration

This module provides an integration with World Anvil for Foundry Virtual Tabletop, allowing you to import article content from World Anvil into the Foundry VTT journal system and easily keep that content synchronized over time as you update and create articles on the World Anvil platform.

Watch the following video to learn more about this module and how to use it: https://www.youtube.com/watch?v=o9DMELe7G_o


Installation

This module can be installed automatically from the Foundry Virtual Tabletop module browser, or by using the following module manifest url: (https://gitlab.com/foundrynet/world-anvil/-/raw/master/module.json).


Configuration

To begin using this module, some initial configuration is required. You must provide a World Anvil user authorization API token which is available to any Guild member user by visiting the API Keys Management section of your World Anvil user dashboard.

Enable the World Anvil module in Foundry VTT and click the small WA logo at the bottom-right of the Journal Directory to open the World Anvil browser. This will open an initial configuration screen where you should enter your User Authentication Token and then choose the World from which you want to import content.


Importing World Anvil Content

Once the module is configured, the same WA icon will open the World Anvil browser which allows you to see all the Categories and Articles which exist within your world.

Clicking on the name of a Category or an Article will open the respective page on the World Anvil website. Clicking the button on the right side of the page will import the category or article into Foundry Virtual Tabletop.

Importing a Category

When importing a category, it will become a Folder in your Journal sidebar and all articles within that category will be imported as entries under that new Folder.

Importing a Single Article

When importing a single article, it will become a new Journal Entry in your Journal sidebar which you can move to a Folder of your choice.

World Anvil Browser

Permission Controls

All functionality of this module is restricted to Gamemaster users only.

This module does not currently attempt to preserve permission or visibility control settings from World Anvil when importing content into Foundry VTT. Instead any imported content will be private only for the Gamemaster user who imported it.

Custom permission control

Game-Masters will be able to see which entry have been displayed to players via their World Anvil Browser inside Foundry VTT. Using the World Anvil browser they can manage the visibility of each article or even an entire category:


Updating/Syncing an Article

Once a Category or Article has been imported, a link to it will display in the World Anvil Browser instead of an import button. For any imported World Anvil article, there is a WA Sync button in the header of the article which allows you to refresh the content, pulling the latest changes from the World Anvil website.

Cross-Links

Content links from World Anvil are also preserved in Foundry VTT. If the linked Article has already been imported, the link will open the Journal Entry in Foundry VTT, otherwise that linked Article will be automatically imported.


Software License and Contribution Policy

This software is licensed under the MIT License. See the LICENSE.txt file in this repository for details.

If you would like to contribute to making this software better, merge requests are welcomed. In your merge request, please include a clear description of the change you are making and be prepared to engage with me for 1-2 rounds of code review.

Contributors

Thanks to the following individuals for their valued contributions to this module.

  • Dimitris from World Anvil
  • Adrien Schiehle
  • Megastrukur
Comments
  • Third step secrets management - [merged]

    Third step secrets management - [merged]

    In GitLab by @adrien.schiehle on Nov 17, 2021, 10:29

    Merges third_step_secrets_management -> secrets

    Next step : Secret management.

    Only Storyteller seeds are managed for now. I've chosen to split those seeds by checking if there is some <h3 ...> inside of it. Each h3 indicating the start of a new secret. It will allow GMs to reveal secrets step by step for a given article.

    <h3> inside what we retrieve are what we write as [h2] inside BBCode.

    It works like that :

    • When importing article, we store one property inside world-avil.secrets flag each secret.
    • GMs can toggle each secret insde the Journal Entry. Or toggle all in one go inside the WorldAnvilBrowser.
    • The WorldAnvilBrowser indicates which article contains secrets.
    • Players can't see secrets which has not been revealed.
    • Players see revealed secret inside Journal Entries the same way they see other sections.
    opened by cswendrowski 40
  • Second step : Category hierarchy & article visibility - [merged]

    Second step : Category hierarchy & article visibility - [merged]

    In GitLab by @adrien.schiehle on Sep 24, 2021, 12:17

    Merges categories -> categories

    A little bigger one. It has some recursive code to go through the whole category tree.

    But that shouldn't pose any problem as long as there is no infinite loop in what we retrieve for World Anvil.

    By saying that... I may need to add a security and the categoryBranchLevel :angel:

    This is what it does :

    README_visibilityManagement

    opened by cswendrowski 40
  • Cosmetics modifications - [merged]

    Cosmetics modifications - [merged]

    In GitLab by @adrien.schiehle on Sep 21, 2021, 04:53

    Merges first_step_cosmetics -> master

    Some screenshots that will help you see what changed

    Default configuration : default_configuration

    Article display with the default configuration : article_display_default_config

    Custom configuration : custom_configuration

    Article display with the custom configuration (GM side) : article_display_custom_config

    Article display with the custom configuration (Player side) : article_display_custom_config_from_player_side

    I didn't update the Readme for this kind of modifications. Is it necessary ?

    opened by cswendrowski 37
  • World Anvil API changes have caused downstream failures in the Foundry VTT module for content import and image URLs.

    World Anvil API changes have caused downstream failures in the Foundry VTT module for content import and image URLs.

    image image

    Numerous users on reddit and the FVTT discord are reporting issues similar to this one. Suspect there may have been an API change at WA, may need a reach out to Dimitris.

    bug wa-input 
    opened by anathemamask 19
  • Fix categories - [merged]

    Fix categories - [merged]

    In GitLab by @adrien.schiehle on Nov 3, 2021, 11:09

    Merges fix_categories -> categories

    First commit

    For fixing importAll and some hierarchy problems.

    We had in fact two Root folder when importing. ( The parent tree node was also a folder named Root )

    I decided to let one here. I tested : If they want to remove the upper folder after moving the other one outside of it, it still works. Link remains

    Second commit

    For visibility buttons. I think that when you tried to simplify things, you found that I didn't use entry.visible and chose to use it.

    But its purpose slightly differs from what you thought : WA Panel control is only for GMs, and those buttons gives him info on what is visible by other players? It's great to keep track of what you have shared to your players until now.

    It can also be used when you have a NPC who have evolved and its description changed.

    • Hide its description on prior category
    • Set it visible on the new one.

    (For campaign data, I use a WA category for each act)

    opened by cswendrowski 10
  • The WA API provides links in rendered HTML using relative URL paths which no longer function properly outside of the World Anvil domain.

    The WA API provides links in rendered HTML using relative URL paths which no longer function properly outside of the World Anvil domain.

    In GitLab by @myk1e on Jun 13, 2020, 01:56

    Using the World Anvil Integration module with:

    • FVTT 0.6.2
    • The Forge (hosting)
    • FF 77 (browser)

    I'm having the following issue:
    After importing an article, all "meta-links" (to categories, types, etc.) are shown as button and work fine.
    On the other hand, the links which are included in the text of the article (shown as texte links in bold underlined orange) don't.
    These text links open a new browser tab and give a "Cannot GET /w/ayo-leakimka/a/waelt-article" error message.
    They're pointing to an incorrect URI, in this case:

    • https://ayo.eu.forge-vtt.com/w/ayo-leakimka/a/waelt-article \instead of:
    • https://www.worldanvil.com/w/ayo-leakimka/a/waelt-article

    It seems they are using a relative path (use of a global server variable maybe?)
    Thanks for your help!

    bug wa-api wa-input 
    opened by cswendrowski 9
  • CORS Error in article API. Potential fix included.

    CORS Error in article API. Potential fix included.

    In GitLab by @johnnolan on Sep 18, 2021, 01:24

    Clicking the sync button in FoundryVTT for articles causes CORS errors to return from the Article API Endpoint

    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at xxxxx (Reason: CORS header 'Access-Control-Allow-Origin' missing)

    Using Postman with the same api call I get the same error

    curl --location --request GET 'https://www.worldanvil.com/api/aragorn/article/(GUID)?x-application-key=xxx&x-auth-token=xxx

    Changing the request from a params to a header gives a success.

    curl --location --request GET 'https://www.worldanvil.com/api/aragorn/article/(GUID)' \ --header 'x-application-key: xxx' \ --header 'x-auth-token: xxx'

    Would this be solved by changing the folowing lines to use the header instead of params? https://gitlab.com/foundrynet/world-anvil/-/blob/master/module/api.js#L66-67

    opened by cswendrowski 7
  • Fix null content import error - [closed]

    Fix null content import error - [closed]

    In GitLab by @mod100 on Feb 2, 2022, 04:02

    Merges master -> master

    I hit an error when trying to import my WorldAnvil content because of this line (252) in framework.js.

    const isLongContent = section.content.length > 100;

    In some cases section.content is null and so this line fails, hence the change.

    opened by cswendrowski 6
  • When pasting a valid API key, no worlds are shown in the dropdown.

    When pasting a valid API key, no worlds are shown in the dropdown.

    In GitLab by @zdaar on Jun 15, 2020, 12:27

    Dimitri thinks the issue is foundry side and told me it is unrelated to the journeyman api access issue. You can see in the screenshot the authentication gets done as it finds my username (blurred) but no world are shown in the dropdown. image

    Tested on : Linux headless foundry 0.6.2 //

    Fresh install of foundry 0.6.2 on windows 10 with zero modules except WA, in a different physical location/network to rule out firewall issues.

    opened by cswendrowski 6
  • Formatting issues in 1.1.0 in Foundry  (system: The Dark Eye)

    Formatting issues in 1.1.0 in Foundry (system: The Dark Eye)

    In GitLab by @Fulla3 on Sep 30, 2021, 12:27

    After updating to the new version (yeah, the module is not dead! :-)), I started to re-sync my articles, and I've been experiencing some formatting issues. The problem occurs as soon as I edit an entry within Foundry (I wanted to get rid of spoilers, as the spoiler tags from World Anvil don't transfer and spoilers just show up as regular text).

    Character entry pre-editing:

    charpreedit

    Character entry after I edited something in the main character description text (not anywhere close to the now messed up formatting):

    newchar

    Note how from "date of birth" forward, everything appears as one single block of text.

    Formatting issues continue in the other sections as well as soon as I edit anywhere - like when I edit something in the family section here to remove the spoiler:

    preedit

    It messes up this section here (religion etc.) as well as the formatting of the date of birth, height etc. section further up in the entry (the the screenshot above).

    postedit

    opened by cswendrowski 5
  • Compatibility v10

    Compatibility v10

    The first three commits seems to come from somethink we already merged : Refresh button + category sort I don't know why it is back in this PR :(

    The rest is V10 compliance + entry pages for new Journal management

    13-08-2022: I recently added some additionnal changes du to another change in WA API. And while doing it, I added a new buttion for shrinking categories in the journal. (When you have a big WA world, it become difficult to navigate without it)

    opened by adrien-schiehle 4
  • Cover images aren't importing

    Cover images aren't importing

    Cover images on an article aren't importing. Getting this error:

    GET https://[[URL REDACTED]]/media/cache/mapthumb/uploads/maps/e92cbf4605c7733b9c04f656aae06a2e.png 404
    

    Seems like it's trying to create a folder that doesn't exist?

    bug 
    opened by ctbritt 0
  • Articles with sidebar images do not import

    Articles with sidebar images do not import

    If I have a person who has a sidebar image, they don't import. get this error:

    Uncaught (in promise) TypeError: Cannot read properties of null (reading 'replace')
    [Detected 1 package: world-anvil]
        at createImagePage (framework.js:471:39)
        at addJournalImagePages (framework.js:483:5)
        at getArticleContent (framework.js:368:3)
        at importArticle (framework.js:116:17)
    createImagePage @ framework.js:471
    addJournalImagePages @ framework.js:483
    getArticleContent @ framework.js:368
    importArticle @ framework.js:116
    
    bug 
    opened by ctbritt 0
  • TypeError when attempting to import a JournalEntry document.

    TypeError when attempting to import a JournalEntry document.

    Foundry v10 Build 284 Integration v1.4.0

    When importing any single document or importing any category the below error message triggers in the console. Additionally, when selecting Sync, nothing happens despite claiming it was successful.

    Clean world install using multiple systems/worlds with no other modules running.

    Uncaught (in promise) TypeError: Cannot read properties of null (reading 'replace') at createImagePage (framework.js:471:39) at addJournalImagePages (framework.js:491:5) at getArticleContent (framework.js:368:3) at importArticle (framework.js:116:17) at async WorldAnvilBrowser._importCategory (journal.js:373:7)

    bug 
    opened by linkshadowelf 2
  • Referenced articles in section content do not become document links in Foundry VTT

    Referenced articles in section content do not become document links in Foundry VTT

    In GitLab by @juliantabel.jt on Mar 21, 2022, 16:58

    I have tried many things, but I can't get it to work, that links in world anvil are transfered to foundry. I am using the forge and have tried with many other modules as well as only the world-anvil module active. This is the world anvil entry (example):

    world_anvil_entry

    When importing to foundry, it looks like this:

    foundry_entry

    I can click on the Bold text, nothing happens, same for the entries below that. When running foundry 0.8.x I can at least click on the entries below the text and the other entry opens (also imported), however even then it doesn't work in the content section.

    bug 
    opened by cswendrowski 3
  • Will WA Timelines become linkable to Foundry VTT?

    Will WA Timelines become linkable to Foundry VTT?

    In GitLab by @spaceflows on Sep 13, 2021, 19:55

    Foundry has such amazing integration with World Anvil. Are there any plans to allow WA Timelines to be linkable like the articles are??

    wa-api wa-input 
    opened by cswendrowski 2
  • Artciles with a related timeline can't be imported

    Artciles with a related timeline can't be imported

    In GitLab by @adrien.schiehle on Mar 14, 2021, 11:50

    Hi, I'm new here, so first :

    Thank you for this integration module !

    It will allow me to create my article in advance and share what I want directly inside fvtt.

    When I tried it, some of my articles couldn't be imported. Here was the stack :

    framework.js:71 Uncaught (in promise) TypeError: Cannot read property 'id' of undefined
        at framework.js:71
        at Array.map (<anonymous>)
        at _getArticleContent (framework.js:71)
        at importArticle (framework.js:12)
        at async WorldAnvilBrowser._onClickControlButton (journal.js:146)
    

    If I understand correctly, timeline relations inside an article are not correctly interpreted. section.items is undefined.

      // Article relations
      if ( article.relations ) {
        for ( let [id, section] of Object.entries(article.relations) ) {
          const title = section.title || id.titleCase();
          const items = section.items instanceof Array ? section.items: [section.items];  // Items can be one or many
          const relations = items.map(i => `<span data-article-id="${i.id}" data-template="${i.type}">${i.title}</span>`);
          aside += `<dt>${title}:</dt><dd>${relations.join(", ")}</dd>`
        }
      }
    

    Something like this could do the job. What do you think ?

          let items = section.items;
          if( ! items ) {
             items = []; // There can be no items in an article relation. (Ex: timeline)
          } else if (! items instanceof Array ) {
             items = [section.items];  // Items can be one or many
          } 
    
    bug 
    opened by cswendrowski 0
Releases(release-1.4.0)
  • release-1.4.0(Sep 5, 2022)

    This World Anvil release upgrades compatible support to Foundry Virtual Tabletop version 10.

    Because of the significant changes to the V10 Journal System, this new version of the World Anvil module requires Foundry VTT version 10. If you are remaining on Verison 9 or prior you should also remain on an older version of the WA module.

    Many thanks to Adrien Schiehle (@adrien-schiehle) for his contributions towards V10 compatibility and the features included in this release:

    • Version 10 compatibility, the components of a World Anvil article will be split up into pages of the imported Journal Entry.
    • Add support for collapsible/expandable categories in the World Anvil browser interface.
    • Bug fixes for refresh workflows with a new button to manually refresh articles within the UI.
    • Better support for choosing the featured image of a World Anvil article.
    • Adapt to some upstream API changes on the World Anvil side.
    • Improved support of category sorting to more closely match the order in which categories appear within World Anvil.

    Additional Contributors

    • @wdawson for a helpful bugfix in Release 1.4.2
    Source code(tar.gz)
    Source code(zip)
  • release-1.3.3(Jun 11, 2022)

  • release-1.3.2(Jun 1, 2022)

  • release-1.3.0(Jun 1, 2022)

    World Anvil Version 1.3.0

    The version 1.3.0 release for the world-anvil module adds support for importing secret sections from World Anvil articles which result in secret blocks in the imported Foundry VTT text. It also adds support for convenient buttons that can share imported articles with your players (who become Observers).

    The version also expands upon the API by adding the following hooks at various stages of the content import workflow.

    Hooks.callAll(`WAUpdateJournalEntry`, entry, content);
    Hooks.callAll(`WACreateJournalEntry`, entryData, article, content);
    Hooks.callAll(`WAParseArticle`, article, parsedData);
    

    Documentation on these hooks is available within the framework.js file.

    Contributors

    Many thanks to Adrien Schiehle whose contributions made this release possible.

    Source code(tar.gz)
    Source code(zip)
    module.json(868 bytes)
    world-anvil-1.3.0.zip(2.40 MB)
  • release-1.2.0(Jun 1, 2022)

    World Anvil Version 1.2.0

    The version 1.2.0 release for the world-anvil module adds support for hierarchical categories and improved imports. This allows you to retain your parent/child category structure on World Anvil and import journal entries which keep that Category structure as the folder names for your imported content.

    This version also significantly improves the underlying API for importing content from World Anvil and provides a stronger platform for making additional changes in the future.

    Information on these new features has been added to the readme file at https://gitlab.com/foundrynet/world-anvil.

    Contributors

    Many thanks to Adrien Schiehle whose contributions made this release possible.

    Source code(tar.gz)
    Source code(zip)
    module.json(867 bytes)
    world-anvil-1.2.0.zip(2.40 MB)
  • release-1.1.0(Jun 1, 2022)

    New Features

    • Automatically set the Journal Title from the <h1> element of the World Anvil article instead of duplicating it in the body
    • Move the "View on World Anvil" link to the header buttons instead of in the HTML content
    • Add a permission control setting for whether players can follow the link to the WA site or not
    • Improved importing of sidebar content by better recognizing various sections and assigning header titles.

    Community Contributions

    • Many thanks to Adrien Schiehle whose work in https://gitlab.com/foundrynet/world-anvil/-/merge_requests/8 made this release possible
    Source code(tar.gz)
    Source code(zip)
    module.json(908 bytes)
    world-anvil-1.1.0.zip(35.54 KB)
  • release-1.0.3(Jun 1, 2022)

  • release-1.0.2(Jun 1, 2022)

    World Anvil Integration - Release 1.0.2

    New Features

    • Add toggle buttons in the browser to toggle the display of Draft/Published and WIP/Final articles in the list.
    • Set the article cover artwork as the featured image if one is set on the WA article.

    Bug Fixes

    Source code(tar.gz)
    Source code(zip)
    module.json(783 bytes)
    world-anvil-1.0.2.zip(34.60 KB)
  • release-1.0.1(Jun 1, 2022)

  • release-1.0.0(Jun 1, 2022)

Owner
Foundry Virtual Tabletop
Foundry Virtual Tabletop self-hosted software that provides an innovative online role-playing experience.
Foundry Virtual Tabletop
Foundry-Hardhat plugins: Use Foundry for Hardhat projects

This repo contains hardhat plugins to use foundry tools in hardhat environments. Installation See in each plugin anvil forge foundryup Documentation F

Foundry 77 Nov 3, 2022
A module for modifying sheet rolling functions on Foundry VTT Character sheets for D&D 5th Edition.

Ready Set Roll for 5e - FoundryVTT Module Ready Set Roll is a Foundry VTT module that accelerates the built in rolling system of the Foundry DnD5e sys

Mangó 17 Dec 12, 2022
An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

Snyk Labs 57 Dec 28, 2022
🥰 Mini world simulator is a terminal application made in JavaScript to control the world that is being generated.

Mini-world "Simulator" Mini world simulator is a terminal application made in JavaScript to control the world that is being generated. It has no other

Adrián 2 Mar 14, 2022
Write "hello world" in your native language, code "hello world" in your favorite programming language!

Hello World, All languages! ?? ?? Write "hello world" in your native language, code "hello world" in your favorite language! #hacktoberfest2022 How to

Carolina Calixto 6 Dec 13, 2022
GitHub action to install Foundry

foundry-toolchain Action This GitHub action installs Foundry. Example workflow on: [push] name: test jobs: check: name: Foundry project ru

Bjerg 128 Jan 5, 2023
Solidity starter combining foundry and hardhat because both are great and I can't live without either...

Combination Pizza Hut & Taco Bell Foundry && HardHat starter template. Motivation I like them both. With this set-up we get: Unit tests written in sol

Cache Monet 32 Aug 23, 2022
Library for Foundry VTT which provides easy access to dark comedy fantasy setting created by Richard Zadmar Woolcock

Library for Foundry VTT which provides easy access to dark comedy fantasy setting created by Richard Zadmar Woolcock. Current inclusions are a bestiary, edges, hindrances, and a journal with setting information, character creation, and more. The Savage Worlds Adventurers Edition Game System is the system this setting is designed for.

KevDog 2 Mar 18, 2022
Use Hardhat & Foundry in the same project

Hardhat Foundry Starter This is a solidity starter template which lets you use both, Hardhat and Foundry. Why use both the tools? Foundry has some awe

Rajdeep Bharati 12 Aug 23, 2022
Minimal template to get started with Foundry + Hardhat

Hardhat x Foundry Template Template repository for getting started quickly with Hardhat and Foundry in one project Getting Started Use Foundry: forge

Foundry 158 Jan 3, 2023
🛠️ Easily track & compare gas costs estimated by Foundry on each of your Pull Requests!

?? ??️ Foundry Gas Diff Reporter Easily compare gas reports generated by Foundry automatically on each of your Pull Requests! How it works Everytime s

Romain Milon 133 Dec 28, 2022
Awesome Pay - This is a virtual payment module made from react

Awesome Pay - This is a virtual payment module made from react

AhhyunLee 5 Jun 18, 2022
An example project to how to integrate Chat Engine into a marketplace

Add Chat to Your Marketplace This is a example online marketplace with Chat Engine fully integrated. It's meant to help people building online marketp

Adam La Morre 13 Dec 22, 2022
A build plugin to integrate Gatsby seamlessly with Netlify

Essential Gatsby Plugin This build plugin is a utility for supporting Gatsby on Netlify. To support build caching and Gatsby functions on Netlify, you

Netlify 72 Dec 27, 2022
... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.

Salesforce B2C Commerce / Customer 360 Platform Integration Introduction Salesforce B2C Commerce / CRM Sync is an enablement solution designed by Sale

Salesforce CommerceCloud 45 Dec 9, 2022
Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services.

Tidbyt Client for Node.js Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services. Insta

Nicholas Penree 19 Dec 17, 2022
Marquee is a VS Code extension designed to naturally integrate with your development flow, so that you will no longer lose track of your thoughts while you're coding

Marquee Stay organized with minimal context switching, all inside your Visual Studio Code. Marquee is a VS Code extension designed to naturally integr

stateful 60 Dec 13, 2022
Obsidian.md plugin to integrate with Zotero, create literature notes and insert citations from a Zotero library.

Obsidian Zotero Plugin Obsidian.md plugin to integrate with Zotero, create literature notes and insert citations from a Zotero library. Intro How to u

null 156 Jan 6, 2023
Integrate Railway Project events with Telegram Chat/Channel using Railway Webhooks

Railway to Telegram Integrate Railway Project events with Telegram Chat/Channel using Railway Webhooks! One Click Self Deploy Manual Self Deploy Fork

Agampreet Singh 9 Jul 5, 2022