Function dilla_renderer::render
source · pub fn render(payload: &str, output: &str) -> Result<String, Error>Expand description
Render a Json String value into HTML String and output in specific Dilla formats.
Arguments
payload: The JSON payload string to be rendered, following Dilla format APIoutput: The output format desired, can be:json: Default. A json response with every rendered parts as:attached: The HTML@attachedpart of the rendered output for<header>body: The HTML main rendered contentsystem_stylesheet: The HTML list of global<link>tagssystem_javascript: A list of global javascript files from libraries asname => {options}.stylesheet: The HTML list of<link>tagsjavascript: A list of javascript files from libraries asname => {options}.variables: The HTML@variableswrapped in a<style>tag
full: Whole HTML page wrapped in<html>tag_test: Test is only HTML body without head, styles and libraries, for test purpose_test_full: All HTML parts not wrapped in<html>tag, for test purpose_logs: Display on logs, mostly debug and internal test purpose
Returns
Result<String, Error>- A Result containing the rendered output as a String if successful, or an Error if any error occurs.