<%*

// 1) Rename if title starts with ā€œNewRegionā€ let title; if (tp.file.title.startsWith(ā€œNewRegionā€)) { title = await tp.system.prompt(ā€œEnter Region Nameā€); if (!title) { new Notice(ā€œNo title entered. Aborting.ā€); return; } await tp.file.rename(title); } else { title = tp.file.title; }

// 2) Gather all continent files under 2-World/Continents/ const continentFiles = tp.app.vault.getMarkdownFiles() .filter(f ⇒ f.path.startsWith(ā€œ2-World/Continents/ā€));

if (continentFiles.length === 0) { new Notice(ā€œNo continent notes found.ā€); return; }

const placeholderLabel = ā€šŸŒ€ No Continent Selectedā€; const placeholderPath = ā€œplaceholderā€;

// 3) Prompt user to choose container const continentChoices = [placeholderLabel, …continentFiles.map(f ⇒ f.basename)]; const continentValues = [placeholderPath, …continentFiles.map(f ⇒ f.path)]; const chosenPath = await tp.system.suggester(continentChoices, continentValues, true); if (!chosenPath) return;

// 4) Build the wiki-link or fallback let wikiLink = null; if (chosenPath !== placeholderPath) { const chosenAlias = chosenPath.split(ā€/ā€œ).pop().replace(/.md{chosenPath}|${chosenAlias}]]`; }

// 5) Write to frontmatter setTimeout(() ⇒ { const newFile = tp.file.find_tfile(tp.file.path(true)); if (!newFile) { new Notice(ā€œCould not find file after rename.ā€); return; } app.fileManager.processFrontMatter(newFile, fm ⇒ { fm[ā€œMyContainerā€] = wikiLink ?? ā€œNoneā€; }); }, 200);

%>

Parent Continent: INPUT[suggester(optionQuery(#Category/Continent)):MyContainer]

Column

Map

id: ZalkorsFerry ### Must be unique with no spaces  
image: [[The Island of Screams.jpg]] ### Link to the map image file. Do not add a ! in front of the image  
bounds: [[0,0], [5888, 5882]] ### Size of the map in px Height_y, Width_x. Ignore 0,0  
height: 500px ### Size of the leaflet embed in px on your screen  
width: 95% ### Size of the leaflet embed in your note  
lat: 2944 ### To center the map, make this half of the map height.  
long: 2941 ### To center the map, make this half of the map width.  
minZoom: -5 ### Controls how far away from the map you can zoom out. Hover over the target icon to see the current level.  
maxZoom: 1 ### Controls how far towards the map you can zoom in. Hover over the target icon to see the current level.  
defaultZoom: -3.5 ### Sets the default zoom level when the map loads. Hover over the target icon to see the current level.  
zoomDelta: 0.5 ### Adjust how much the zoom changes when you zoom in or out.  
unit: mi ### The value displayed when measuring so you know what type of unit is being measure.  
scale: 0.09328358208955223 ### Real units/px (resolution) of your map  
recenter: false  
darkmode: false ### marker

Town Name

INPUT[select(
option(1, ā„¹ļøGeneral Info),
option(2, 🌐Region Details),
option(3, šŸ“GM Notes),
class(tabbed)
)]

Tabbed

NOTE

INPUT[select(
option(1, šŸ”Hubs),
option(2, šŸŽPoints of Interest),
option(3, āš”ļøGroups),
option(4, šŸ’­Quests),
class(tabbed)
)]

Tabbed


General Info

This is the region description.

Region Details

Dominant Races:
Climate: Seasons:

GM Notes

Make notes of what you need to track in the region here.

Hubs

BUTTON[button_hub] Hubs Places where people live - Cities, Towns, Villages, Hamlets, Encampment, Keeps, Fortresses, Strongholds.

properties:
  file.name:
    displayName: Hub Name
views:
  - type: cards
    name: Hubs - Cards
    filters:
      and:
        - file.folder == "2-World/Hubs"
        - list(MyContainer).contains(this)
    order:
      - file.name
    image: note.image
  - type: table
    name: Hubs - Table
    filters:
      and:
        - file.folder == "2-World/Hubs"
        - list(MyContainer).contains(this)
    order:
      - file.name
      - MyContainer
    sort:
      - property: file.name
        direction: ASC
    columnSize:
      file.name: 182
 

Points of Interest

BUTTON[button_pointofinterest] Places that can be explored.

properties:
  file.name:
    displayName: Hub Name
views:
  - type: cards
    name: POIs - Cards
    filters:
      and:
        - file.folder == "2-World/Points of Interest"
        - list(MyContainer).contains(this)
    order:
      - file.name
    image: note.image
  - type: table
    name: POIs - Table
    filters:
      and:
        - file.folder == "2-World/Points of Interest"
        - list(MyContainer).contains(this)
    order:
      - file.name
      - MyContainer
    sort:
      - property: file.name
        direction: ASC
    columnSize:
      file.name: 182
 

Groups

BUTTON[button_group] Groups of people and power - religious, cults, guilds, military

properties:
  file.name:
    displayName: Hub Name
views:
  - type: cards
    name: Groups - Cards
    filters:
      and:
        - file.folder == "2-World/Groups"
        - list(MyContainer).contains(this)
    order:
      - file.name
    image: note.image
  - type: table
    name: Groups - Table
    filters:
      and:
        - file.folder == "2-World/Groups"
        - list(MyContainer).contains(this)
    order:
      - file.name
      - MyContainer
    sort:
      - property: file.name
        direction: ASC
    columnSize:
      file.name: 182
 

Quests

BUTTON[button_quest] P - Philosophy (Religion and Education) - Houses of Worship, Schools, Universities, Laboratories, Arboretums

properties:
  file.name:
    displayName: Hub Name
views:
  - type: cards
    name: Quests - Cards
    filters:
      and:
        - file.folder == "2-World/Quests"
        - list(MyContainer).contains(this)
    order:
      - file.name
    image: note.image
  - type: table
    name: Quests - Table
    filters:
      and:
        - file.folder == "2-World/Quests"
        - list(MyContainer).contains(this)
    order:
      - file.name
      - MyContainer
    sort:
      - property: file.name
        direction: ASC
    columnSize:
      file.name: 182