Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "PUGjs"

From Roll20 Wiki

Jump to: navigation, search
(transclude from Sheet Author Tips)
 
m
 
Line 37: Line 37:
 
Examples, Sheets, & Sheet template made with PUG:
 
Examples, Sheets, & Sheet template made with PUG:
 
* {{gist|Anduh/968bdae0c8dda4f7171fab2561acbea2 Example snippets of SCSS & PUG}}, by [[Andreas J.]]
 
* {{gist|Anduh/968bdae0c8dda4f7171fab2561acbea2 Example snippets of SCSS & PUG}}, by [[Andreas J.]]
* [https://github.com/Kurohyou/Roll20-Snippets/tree/main/K_Scaffold The K-Scaffold] - by [[Scott C.]]
+
* {{K-scaffold}} - by [[Scott C.]]
 
* {{repo|clevett/SheetTemplate SheetTemplate}} by [[Cassie]]
 
* {{repo|clevett/SheetTemplate SheetTemplate}} by [[Cassie]]
 
* {{repo|aureyia/roll20-character-sheet-boilerplate Aureyia's Roll20 Sheet Boilerplate}} - Uses PUG, Stylus(CSS) & Gulp
 
* {{repo|aureyia/roll20-character-sheet-boilerplate Aureyia's Roll20 Sheet Boilerplate}} - Uses PUG, Stylus(CSS) & Gulp

Latest revision as of 09:30, 21 February 2022

Main Page: Sheet Author Tips#Frameworks

PUG is a template engine for generating HTML, where you can use various features & tool to write code more efficiently, such as using variables and loops, and has a simpler syntax.

//- Comment that only appears in PUG
- var pages = ["character", "skills", "inventory", "magic", "familiar", "background", "campaign", "vehicle", "settings"];
div
  span Page selection
  select(name="attr_sheetTab")
    each tab in pages
      option(value=`${tab}`)= tab[0].toUpperCase() + tab.slice(1)

Result HTML:

<div>
     <span>Page selection</span><select name="attr_sheetTab">
        <option value="character">Character</option>
        <option value="skills">Skills</option>
        <option value="inventory">Inventory</option>
        <option value="magic">Magic</option>
        <option value="familiar">Familiar</option>
        <option value="background">Background</option>
        <option value="campaign">Campaign</option>
        <option value="vehicle">Vehicle</option>
        <option value="settings">Settings</option>
    </select>
</div>

PUGjs.org

Examples, Sheets, & Sheet template made with PUG:

[edit] See Also