skeldjs
    Preparing search index...

    Class DocElement

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    attributes: Record<string, string | number>
    boiler: TMPElement[] = []
    children: TMPNode[]
    tagName: TMPTag
    SINGLES: TMPTag[] = ...

    Methods

    • Set the colour of the text

      Parameters

      • clr: string | [number, number, number, number]
      • ...content: TMPNode[]

      Returns DocElement

      const formatted = tb().color("ff0000ff", "Red text.");
      

      Or using RGBA:

      const formatted = tb().color([255, 0, 0, 255], "RGBA red text.");
      
    • Change the background colour of the text.

      Parameters

      • color: string | [number, number, number, number]
      • ...content: TMPNode[]

      Returns void

      const formatted = tb().highlight("00ff00aa", "This text has a green background.");
      

      Or using RGBA:

      const formatted = tb().highlight([0, 255, 0, 255], "This text has a green background.");
      
    • Create a link to a resource (Not necessarily related to anything).

      Parameters

      • resource: string
      • ...content: TMPNode[]

      Returns boolean

      const formatted = tb().link("https://google.com", "click here to get tracked.");
      
    • Change the line height of the text.

      Parameters

      • height: string | number
      • ...content: TMPNode[]

      Returns boolean

      const formatted = tb().indent("2em", "I have huge line spacing like a boss.");
      
    • Change only the indentation for the first line of the text.

      Parameters

      • indentation: string | number
      • ...content: TMPNode[]

      Returns boolean

      const formatted = tb().indent("2em", "Only this line is indented, any other line will not be indented as displayed by this long piece of text.");
      
    • Change the background colour of the text.

      Parameters

      • color: string | [number, number, number, number]
      • ...content: TMPNode[]

      Returns void

      const formatted = tb().mark("00ff00aa", "This text has a green background.");
      

      Or using RGBA:

      const formatted = tb().mark([0, 255, 0, 255], "This text has a green background.");