Skip to content

Locals

actionButtonName

function

Converts a string to a valid kebab-case action button name

  • name - string -

    The string to convert to an action button name

actionInputName

function

Converts the name of an action button in a roller construction to the controlling attribute name.

  • name - string -

    The string to convert

attrName

function

Converts a string to a valid snake_case attribute name or kebab-case action button name.

  • string - string -

    The string to adapt

attrTitle

function

Converts an attribute name into an attribute call for that attribute. Converts _max attribute names to the proper attribute call syntax for _max attributes (see second example). If called from inside the block of a fieldset mixin, will also add the appropriate information for calling a repeating attribute.

  • string - string -

    The attribute name to create an attribute call for.

buttonTitle

function

Converts an ability name into an ability call for that attribute. If called from inside the block of a fieldset mixin, will also add the appropriate information for calling a repeating attribute.

  • string - string -

    The ability name to create a call for.

capitalize

function

Capitalizes the first letter of words in a string.

  • string - string -
    undefined

getSystemPrefix

function

Gets the current state of the system prefix

k

constant

Object that describes the state of k-scaffold prefixes and info that are manipulated in reaction to mixins being used or direclty by the user, but are not used in the sheetworkers.

  • scriptUsed - boolean -

    Boolean that tracks whether the kScript mixin has been called or not. Default false.

  • repeatingPrefix - string -

    The prefix for the current repeating section. Empty when no repeating section is currently being worked in. Automatically updated when using the fieldset mixins. Default ''

  • repeatsIgnoreSystemPrefix - boolean -

    Boolean that controls whether repeating sections ignore the system prefix or not. Default false.

  • systemPrefix - string -

    A prefix that is added to all attribute names until changed. Useful for sheets that handle multiple systems and need separate tracking for similarly named attributes. Default ''

Locals

namespace

The local functions and variables that the K-scaffold provides for use in your pug.

replaceProblems

function

Escapes problem characters in a string for use as a regex.

  • string - string -

    The string to work on

replaceSpaces

function

Replaces spaces in a string with underscores (_).

  • string - string -

    The string to work on

setSystemPrefix

function

Updates the k.systemPrefix K-scaffold global variable so that any attributes created after this point will be prepended with the prefix. By default attributes in repeating sections are not prepended; instead the repeating section name is prefixed. Returns the previous prefix.

  • val - string -

    The value to set the prefix to. If not a string or falsy, will reset the prefix to an empty string.

  • normalRepeating - boolean -

    Whether the prefix should be applied to repeating section names (default), or to the attribute name itself in repeating sections.

titleToName

function

Converts a title back to an attribute name

  • string - string -

    The string to convert to an attribute name

varObjects

constant

Object that stores attributes that are updated based on the pug but are used in the sheetworkers. The user can add properties to this object to export data from the pug to the sheetworkers.

  • repeatingSectionDetails - Array.<object> -

    Array of objects that describe each repeating section and the attributes contained in them.

  • actionAttributes - Array.<string> -

    Array of attribute names created by use of the roller mixin.

  • cascades - object -

    Object that accumulates the trigger information for all attributes created using k-scaffold mixins. Items are added and updated here via the storeTrigger function.

Released under the MIT License