-
-
Notifications
You must be signed in to change notification settings - Fork 2
ScribeProvider.js
ScribeProvider module
Author: William Leemans
Copyright: William Leemans 2024
-
ScribeProvider
-
static
-
.scribeProvider ⇐
baseProvider
- new exports.scribeProvider(actor)
- .class
-
.createFile() ⇒
Promise
-
.updateFile() ⇒
undefined
-
.saveFile() ⇒
undefined
-
.getScribeData(scribeOption) ⇒
string
- .scribe(scribeOption, scribeData)
-
.scribeProvider ⇐
-
inner
-
~scribeBase
- new scribeBase()
-
.label :
string
-
.stripFoundryElements(value) ⇒
string
-
.stripHTMLtag(value) ⇒
string
-
~scribeItem ⇐
scribeBase
- new scribeItem(name, type, rank, traits, usage, description, [labelLevel])
-
.usage :
string
-
.description :
string
-
.scribify() ⇒
string
-
~scribeHeader ⇐
scribeBase
-
~scribeCharacterStrike ⇐
scribeBase
-
~scribeCharacterActivity ⇐
scribeBase
-
~scribeCharacterFeat ⇐
scribeItem
-
~scribeCharacterSpell ⇐
scribeItem
-
~scribeCharacterFormula ⇐
scribeItem
-
~scribeCharacterRitual ⇐
scribeItem
-
~scribeCreature ⇐
scribeItem
- new scribeCreature(creature, labelLevel)
-
.senses() ⇒
array
-
.languages() ⇒
array
-
.skills() ⇒
array
-
.attributes() ⇒
array
-
.items() ⇒
array
-
.acSaves() ⇒
array
-
.hpImmunityWeaknessResistance() ⇒
array
-
.defensiveActivities() ⇒
array
-
.offensiveActivities() ⇒
array
-
.otherActivities() ⇒
array
-
.movement() ⇒
array
-
.melee() ⇒
array
-
.ranged() ⇒
array
-
.spells() ⇒
array
-
.scribify() ⇒
string
-
~scribeHead ⇐
scribeBase
- new scribeHead(title, text, labelLevel)
-
.title :
string
-
.text :
string
-
.scribify() ⇒
string
-
~scribeText ⇐
scribeBase
- new scribeText(text)
-
.text :
string
-
.scribify() ⇒
string
-
~scribeTable ⇐
scribeBase
-
~scribeTitle ⇐
scribeBase
- new scribeTitle(text)
-
.text :
string
-
.scribify() ⇒
string
-
~scribeWatermark ⇐
scribeBase
- new scribeWatermark(text)
-
.text :
string
-
.scribify() ⇒
string
-
~scribeBase
-
static
A class to generate scribe formatted files.
Kind: static class of ScribeProvider
Extends: baseProvider
-
.scribeProvider ⇐
baseProvider
- new exports.scribeProvider(actor)
- .class
-
.createFile() ⇒
Promise
-
.updateFile() ⇒
undefined
-
.saveFile() ⇒
undefined
-
.getScribeData(scribeOption) ⇒
string
- .scribe(scribeOption, scribeData)
Param | Type | Description |
---|---|---|
actor | Object |
The Foundry VTT actor object. |
all scribe classes available to use to format resources
Kind: instance property of scribeProvider
Create an empty file for scribe
Kind: instance method of scribeProvider
Returns: Promise
- a dummy promise
Update the file
Kind: instance method of scribeProvider
Save the file
Kind: instance method of scribeProvider
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 |
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 |
The base class for all scribe related classes
Kind: inner class of ScribeProvider
-
~scribeBase
- new scribeBase()
-
.label :
string
-
.stripFoundryElements(value) ⇒
string
-
.stripHTMLtag(value) ⇒
string
This is the base class for all scribe related renderer classes, it provides a couple of shared methods
formatted label for a link
Kind: instance property of scribeBase
Strip all Foundry VTT markdown elements
Kind: instance method of scribeBase
Param | Type | Description |
---|---|---|
value | string |
the text to be parsed |
Strip HTML elements
Kind: instance method of scribeBase
Param | Type | Description |
---|---|---|
value | string |
the text to be parsed |
Scribe Item wrapper
Kind: inner class of ScribeProvider
Extends: scribeBase
-
~scribeItem ⇐
scribeBase
- new scribeItem(name, type, rank, traits, usage, description, [labelLevel])
-
.usage :
string
-
.description :
string
-
.scribify() ⇒
string
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 |
sanitized usage value
Kind: instance property of scribeItem
sanitized description text
Kind: instance property of scribeItem
Render the scribe object
Kind: instance method of scribeItem
scribe Header wrapper
Kind: inner class of ScribeProvider
Extends: scribeBase
-
~scribeHeader ⇐
scribeBase
Param | Type | Description |
---|---|---|
level | number |
the level of the header (1-6) |
title | string |
the title of the header |
Render the scribe object
Kind: instance method of scribeHeader
scribe Character strike wrapper
Kind: inner class of ScribeProvider
Extends: scribeBase
-
~scribeCharacterStrike ⇐
scribeBase
Param | Type | Description |
---|---|---|
strike | object |
The strike to render |
Render the scribe object
Kind: instance method of scribeCharacterStrike
scribe Character activity wrapper
Kind: inner class of ScribeProvider
Extends: scribeBase
-
~scribeCharacterActivity ⇐
scribeBase
Param | Type | Description |
---|---|---|
activity | object |
The activity to render |
sanitized description text
Kind: instance property of scribeCharacterActivity
Render the scribe object
Kind: instance method of scribeCharacterActivity
scribe Character feat wrapper
Kind: inner class of ScribeProvider
Extends: scribeItem
-
~scribeCharacterFeat ⇐
scribeItem
Param | Type | Description |
---|---|---|
feat | object |
The feat to render |
labelLevel | number |
The label level to associate with the feat |
Render the scribe object
Kind: instance method of scribeCharacterFeat
scribe Character spell wrapper
Kind: inner class of ScribeProvider
Extends: scribeItem
-
~scribeCharacterSpell ⇐
scribeItem
Param | Type | Description |
---|---|---|
spell | object |
The spell to render |
labelLevel | number |
The label level to associate with the spell |
Render the scribe object
Kind: instance method of scribeCharacterSpell
scribe Character formula wrapper
Kind: inner class of ScribeProvider
Extends: scribeItem
-
~scribeCharacterFormula ⇐
scribeItem
Param | Type | Description |
---|---|---|
formula | object |
The formula to render |
labelLevel | number |
The label level to associate with the formula |
Render the scribe object
Kind: instance method of scribeCharacterFormula
scribe Character ritual wrapper
Kind: inner class of ScribeProvider
Extends: scribeItem
-
~scribeCharacterRitual ⇐
scribeItem
Param | Type | Description |
---|---|---|
formula | object |
The ritual to render |
labelLevel | number |
The label level to associate with the ritual |
Render the scribe object
Kind: instance method of scribeCharacterRitual
scribe Creature wrapper
Kind: inner class of ScribeProvider
Extends: scribeItem
-
~scribeCreature ⇐
scribeItem
- new scribeCreature(creature, labelLevel)
-
.senses() ⇒
array
-
.languages() ⇒
array
-
.skills() ⇒
array
-
.attributes() ⇒
array
-
.items() ⇒
array
-
.acSaves() ⇒
array
-
.hpImmunityWeaknessResistance() ⇒
array
-
.defensiveActivities() ⇒
array
-
.offensiveActivities() ⇒
array
-
.otherActivities() ⇒
array
-
.movement() ⇒
array
-
.melee() ⇒
array
-
.ranged() ⇒
array
-
.spells() ⇒
array
-
.scribify() ⇒
string
Param | Type | Description |
---|---|---|
creature | object |
The creature to render |
labelLevel | number |
The label level to associate with the creature |
Generate senses for the creature
Kind: instance method of scribeCreature
Generate languages for the creature
Kind: instance method of scribeCreature
Generate skills for the creature
Kind: instance method of scribeCreature
Generate attributes for the creature
Kind: instance method of scribeCreature
Generate items for the creature
Kind: instance method of scribeCreature
Generate AC and Saving throws for the creature
Kind: instance method of scribeCreature
Generate HP, Immunities, Weaknesses and Resistance for the creature
Kind: instance method of scribeCreature
Generate defensive activities for the creature
Kind: instance method of scribeCreature
Generate offensive activities for the creature
Kind: instance method of scribeCreature
Generate other activities for the creature
Kind: instance method of scribeCreature
Generate movement for the creature
Kind: instance method of scribeCreature
Generate melee strikes for the creature
Kind: instance method of scribeCreature
Generate ranged strikes for the creature
Kind: instance method of scribeCreature
Generate spells for the creature
Kind: instance method of scribeCreature
Render the scribe object
Kind: instance method of scribeCreature
scribe Head wrapper
Kind: inner class of ScribeProvider
Extends: scribeBase
-
~scribeHead ⇐
scribeBase
- new scribeHead(title, text, labelLevel)
-
.title :
string
-
.text :
string
-
.scribify() ⇒
string
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 |
sanitized title
Kind: instance property of scribeHead
sanitized text
Kind: instance property of scribeHead
Render the scribe object
Kind: instance method of scribeHead
scribe Text wrapper
Kind: inner class of ScribeProvider
Extends: scribeBase
-
~scribeText ⇐
scribeBase
- new scribeText(text)
-
.text :
string
-
.scribify() ⇒
string
Param | Type | Description |
---|---|---|
text | string |
The text to render |
sanitized text
Kind: instance property of scribeText
Render the scribe object
Kind: instance method of scribeText
A class to generate a scribe formatted table
Kind: inner class of ScribeProvider
Extends: scribeBase
-
~scribeTable ⇐
scribeBase
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 |
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 |
Generate the scribe markdown for a table entry
Kind: instance method of scribeTable
Returns: string
- a formatted scribe table entry
Set the header row
Kind: instance method of scribeTable
Param | Type | Description |
---|---|---|
row | array |
an array of strings to be used as the header |
A class to generate a title on each page
Kind: inner class of ScribeProvider
Extends: scribeBase
-
~scribeTitle ⇐
scribeBase
- new scribeTitle(text)
-
.text :
string
-
.scribify() ⇒
string
Param | Type | Description |
---|---|---|
text | string |
The text to render |
sanitized text
Kind: instance property of scribeTitle
Render the scribe object
Kind: instance method of scribeTitle
A class to generate a watermark on each page
Kind: inner class of ScribeProvider
Extends: scribeBase
-
~scribeWatermark ⇐
scribeBase
- new scribeWatermark(text)
-
.text :
string
-
.scribify() ⇒
string
Param | Type | Description |
---|---|---|
text | string |
The text to render |
sanitized text
Kind: instance property of scribeWatermark
Render the scribe object
Kind: instance method of scribeWatermark