Document data - lmparppei/BeatPlugins GitHub Wiki

The screenplay document itself is a plain-text file, but some preprocessing is performed when saving to ensure compatibility with other Fountain editors (capitalizing scene headings etc.), and a JSON block is added at the end of document.

Meanwhile rendered output is actually just a HTML file with an embedded CSS for printing, and converted into PDF.

You can access all this data if needed.

Plain-text document file

Beat.createDocumentFile() — returns the plain-text Fountain file for current document, along with document settings JSON block

If you'd like to add something into the saved file, but not into the current, you can send in additional settings in a dictionary format.

let fileString = Beat.createDocumentFileWithAdditionalSettings({
    "pluginData": "some data"
})

The resulting file will have your additional data, but it is not written into the document currently being edited.

HTML data

Beat.previewHTML() — returns the HTML currently displayed in preview tab
Beat.screenplayHTML(settings) — returns HTML rendered for printing

You can provide some rendering settings to .screenplayHTML(), listed here with their default values:

let html = Beat.screenplayHTML({
    header: "",
    printSceneNumbers: true,
    printNotes: false,
    revisions: ["orange", "cyan", "green", "purple"],
    scene: null,
    coloredPages: false,
    revisedPageColor: ""
})