Skip to content

ScribeProvider.js

William edited this page Nov 13, 2024 · 9 revisions

ScribeProvider

ScribeProvider module

Author: William Leemans
Copyright: William Leemans 2024

ScribeProvider.scribeProvider ⇐ baseProvider

A class to generate scribe formatted files.

Kind: static class of ScribeProvider
Extends: baseProvider

new exports.scribeProvider(actor)

Param Type Description
actor Object The Foundry VTT actor object.

scribeProvider.class

all scribe classes available to use to format resources

Kind: instance property of scribeProvider

scribeProvider.createFile() ⇒ Promise

Create an empty file for scribe

Kind: instance method of scribeProvider
Returns: Promise - a dummy promise

scribeProvider.updateFile() ⇒ undefined

Update the file

Kind: instance method of scribeProvider

scribeProvider.saveFile() ⇒ undefined

Save the file

Kind: instance method of scribeProvider

scribeProvider.getScribeData(scribeOption) ⇒ string

Get the specified scribe text

Kind: instance method of scribeProvider
Returns: string - scribe formatted text

Param Type Description
scribeOption string The scribe option to get the text of

scribeProvider.scribe(scribeOption, scribeData)

Store Scribe information as regular text

Kind: instance method of scribeProvider

Param Type Description
scribeOption string The option the text is related to
scribeData string Scribe formatted text

ScribeProvider~scribeBase

The base class for all scribe related classes

Kind: inner class of ScribeProvider

new scribeBase()

This is the base class for all scribe related renderer classes, it provides a couple of shared methods

scribeBase.label : string

formatted label for a link

Kind: instance property of scribeBase

scribeBase.stripFoundryElements(value) ⇒ string

Strip all Foundry VTT markdown elements

Kind: instance method of scribeBase

Param Type Description
value string the text to be parsed

scribeBase.stripHTMLtag(value) ⇒ string

Strip HTML elements

Kind: instance method of scribeBase

Param Type Description
value string the text to be parsed

ScribeProvider~scribeItem ⇐ scribeBase

Scribe Item wrapper

Kind: inner class of ScribeProvider
Extends: scribeBase

new scribeItem(name, type, rank, traits, usage, description, [labelLevel])

This class provides a renderer for the item scribe resource.

Param Type Default Description
name string the name of the item
type string the type of the item
rank number the rank of the item
traits Array.<string> the traits of the item
usage string the usage text of the item
description string the description text of the item
[labelLevel] number 0 the level of the label of the item

scribeItem.usage : string

sanitized usage value

Kind: instance property of scribeItem

scribeItem.description : string

sanitized description text

Kind: instance property of scribeItem

scribeItem.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeItem

ScribeProvider~scribeHeader ⇐ scribeBase

scribe Header wrapper

Kind: inner class of ScribeProvider
Extends: scribeBase

new scribeHeader(level, title)

Param Type Description
level number the level of the header (1-6)
title string the title of the header

scribeHeader.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeHeader

ScribeProvider~scribeCharacterStrike ⇐ scribeBase

scribe Character strike wrapper

Kind: inner class of ScribeProvider
Extends: scribeBase

new scribeCharacterStrike(strike)

Param Type Description
strike object The strike to render

scribeCharacterStrike.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeCharacterStrike

ScribeProvider~scribeCharacterActivity ⇐ scribeBase

scribe Character activity wrapper

Kind: inner class of ScribeProvider
Extends: scribeBase

new scribeCharacterActivity(activity)

Param Type Description
activity object The activity to render

scribeCharacterActivity.description

sanitized description text

Kind: instance property of scribeCharacterActivity

scribeCharacterActivity.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeCharacterActivity

ScribeProvider~scribeCharacterFeat ⇐ scribeItem

scribe Character feat wrapper

Kind: inner class of ScribeProvider
Extends: scribeItem

new scribeCharacterFeat(feat, labelLevel)

Param Type Description
feat object The feat to render
labelLevel number The label level to associate with the feat

scribeCharacterFeat.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeCharacterFeat

ScribeProvider~scribeCharacterSpell ⇐ scribeItem

scribe Character spell wrapper

Kind: inner class of ScribeProvider
Extends: scribeItem

new scribeCharacterSpell(spell, labelLevel)

Param Type Description
spell object The spell to render
labelLevel number The label level to associate with the spell

scribeCharacterSpell.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeCharacterSpell

ScribeProvider~scribeCharacterFormula ⇐ scribeItem

scribe Character formula wrapper

Kind: inner class of ScribeProvider
Extends: scribeItem

new scribeCharacterFormula(formula, labelLevel)

Param Type Description
formula object The formula to render
labelLevel number The label level to associate with the formula

scribeCharacterFormula.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeCharacterFormula

ScribeProvider~scribeCharacterRitual ⇐ scribeItem

scribe Character ritual wrapper

Kind: inner class of ScribeProvider
Extends: scribeItem

new scribeCharacterRitual(formula, labelLevel)

Param Type Description
formula object The ritual to render
labelLevel number The label level to associate with the ritual

scribeCharacterRitual.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeCharacterRitual

ScribeProvider~scribeCreature ⇐ scribeItem

scribe Creature wrapper

Kind: inner class of ScribeProvider
Extends: scribeItem

new scribeCreature(creature, labelLevel)

Param Type Description
creature object The creature to render
labelLevel number The label level to associate with the creature

scribeCreature.senses() ⇒ array

Generate senses for the creature

Kind: instance method of scribeCreature

scribeCreature.languages() ⇒ array

Generate languages for the creature

Kind: instance method of scribeCreature

scribeCreature.skills() ⇒ array

Generate skills for the creature

Kind: instance method of scribeCreature

scribeCreature.attributes() ⇒ array

Generate attributes for the creature

Kind: instance method of scribeCreature

scribeCreature.items() ⇒ array

Generate items for the creature

Kind: instance method of scribeCreature

scribeCreature.acSaves() ⇒ array

Generate AC and Saving throws for the creature

Kind: instance method of scribeCreature

scribeCreature.hpImmunityWeaknessResistance() ⇒ array

Generate HP, Immunities, Weaknesses and Resistance for the creature

Kind: instance method of scribeCreature

scribeCreature.defensiveActivities() ⇒ array

Generate defensive activities for the creature

Kind: instance method of scribeCreature

scribeCreature.offensiveActivities() ⇒ array

Generate offensive activities for the creature

Kind: instance method of scribeCreature

scribeCreature.otherActivities() ⇒ array

Generate other activities for the creature

Kind: instance method of scribeCreature

scribeCreature.movement() ⇒ array

Generate movement for the creature

Kind: instance method of scribeCreature

scribeCreature.melee() ⇒ array

Generate melee strikes for the creature

Kind: instance method of scribeCreature

scribeCreature.ranged() ⇒ array

Generate ranged strikes for the creature

Kind: instance method of scribeCreature

scribeCreature.spells() ⇒ array

Generate spells for the creature

Kind: instance method of scribeCreature

scribeCreature.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeCreature

ScribeProvider~scribeHead ⇐ scribeBase

scribe Head wrapper

Kind: inner class of ScribeProvider
Extends: scribeBase

new scribeHead(title, text, labelLevel)

Param Type Description
title string The title of the Heading
text string The text to render with the title
labelLevel number The label level to associate with the creature, default: 0

scribeHead.title : string

sanitized title

Kind: instance property of scribeHead

scribeHead.text : string

sanitized text

Kind: instance property of scribeHead

scribeHead.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeHead

ScribeProvider~scribeText ⇐ scribeBase

scribe Text wrapper

Kind: inner class of ScribeProvider
Extends: scribeBase

new scribeText(text)

Param Type Description
text string The text to render

scribeText.text : string

sanitized text

Kind: instance property of scribeText

scribeText.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeText

ScribeProvider~scribeTable ⇐ scribeBase

A class to generate a scribe formatted table

Kind: inner class of ScribeProvider
Extends: scribeBase

new scribeTable(name, headerRow, contentRows, footer)

Param Type Description
name string the name of the table
headerRow array (optional) an array of strings to be used as the header
contentRows array (optional) an array of arrays of strings to be used as cell data
footer string (optional) The footer to add to the table

scribeTable.addContentRow(row)

Add a table row

Kind: instance method of scribeTable

Param Type Description
row array an array of strings to be used as a row's cell data

scribeTable.scribify() ⇒ string

Generate the scribe markdown for a table entry

Kind: instance method of scribeTable
Returns: string - a formatted scribe table entry

scribeTable.setHeaderRow(row)

Set the header row

Kind: instance method of scribeTable

Param Type Description
row array an array of strings to be used as the header

ScribeProvider~scribeTitle ⇐ scribeBase

A class to generate a title on each page

Kind: inner class of ScribeProvider
Extends: scribeBase

new scribeTitle(text)

Param Type Description
text string The text to render

scribeTitle.text : string

sanitized text

Kind: instance property of scribeTitle

scribeTitle.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeTitle

ScribeProvider~scribeWatermark ⇐ scribeBase

A class to generate a watermark on each page

Kind: inner class of ScribeProvider
Extends: scribeBase

new scribeWatermark(text)

Param Type Description
text string The text to render

scribeWatermark.text : string

sanitized text

Kind: instance property of scribeWatermark

scribeWatermark.scribify() ⇒ string

Render the scribe object

Kind: instance method of scribeWatermark

Clone this wiki locally