fountain-converter
v1.1.4
Published
Converts HTML elements into a string in the format of the Fountain markup lanugage used for screen writing.
Downloads
3
Maintainers
Readme
FountainConverter
An npm module for converting an HTML string into Fountain markup text.
Usage
To convert an HTML string to Fountain text, use the "HTMLtoFountain" function, which takes a string of HTML as the input along with an optional parameter of options that can be given to the converter. Options:
- requiresBeautification: Boolean - Whether or not the string of HTML should be beautified before being sent through the converter. Useful for HTML strings that are all in one line. which are all on one line.
const fountainConverter = require('fountain-converter');
const content = fs.readFileSync('./src/html/example.html', 'utf8');
const toFountain = fountainConverter.HTMLtoFountain(content, { requiresBeautification: false });
const toHTML = fountainConverter.FountainToHTML(toFountain);
console.log(toFountain); // Prints out a string representation of the HTML in Fountain markup.
console.log(toHTML); // Prints a string similar to "element.innerHTML"
Author
- Year: 2018
- Programmers: Adeola Uthman