fountain-converter

1.1.4 • Public • Published

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

Package Sidebar

Install

npm i fountain-converter

Weekly Downloads

0

Version

1.1.4

License

MIT

Last publish

Collaborators

  • authman2