Skip to content

Other output formats #8

@rnwst

Description

@rnwst

Currently, only HTML is supported. Where a to-be-inserted element is an SVG, it would be great if it could be made available to other output formats as well. This could be done by loading the output document in a headless browser (or alternatively in nodejs using jsdom), serialising the SVGs, and saving in a temp directory. Things would be a little bit more tricky where a provided expression is a function, as it would need to be evaluated on a placeholder element, and the DOM changes observed subsequently. Depending on the changes made to the DOM, one might then select an appropriate element to serialise (the original placeholder, if it hasn't been removed, or an element that has been inserted into the DOM).

For non-SVG elements, this could be done similarly, by serialising the HTML and using pandoc to parse them into an AST fragment. This might be rather involved, and as a first step only text elements could be considered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions