1.0.3 • Published 4 years ago
html-generator-npm v1.0.3
html-generator-npm v1.0.3
A Node.js package that generates HTML code from the server side.
Installation
Using npm: npm i html-generator-npm
Usage
var htmlGenerator = require('html-generator-npm') //include the package
htmlGenerator.initiateFile() //initiate file
htmlGenerator.appendParagraph("Hello World", "text-left") //add a left aligned paragraph
htmlGenerator.endFile() //close all the tags using endFile()
//htmlGenerator.formatFile() //format using toris-formatFunctions
- initiateFile(): must be called first, initiates the file with basic HTML tags
- appendButton(text, color):
textto be written on the button,colormust be written in bootstrap class name format i.e.btn-primary - appendHeading(text, heading):
textmust be the heading content,headingmust specify the number i.e "1" for "h1" in HTML - appendInputField(type, placeholder):
typeis the type of input (email, password, etc),placeholdertext - appendCard(cardTitle, cardImageURL, cardBody, width):
widthmust be in px - appendParagraph(text, alignment):
textto be written in the paragraph,alignmentmust be written in bootstrap class name format i.e.text-left - appendIframe(url, height, width):
urlthat you want to add in the iframe,heightandwidthof the iframe - endFile(): must be called towards the end, closes the basic HTML tags
- formatFile(): must be called last; uses a dependency, toris-format
Contribution
- This is an open-source project, and shall continue to remain so! Make a pull request! All contributions are welcome :D
- For major changes, please open an issue first to discuss what you would like to change.