$.template() can render multiple languages
Scripts with different types have different meanings
-
type="text/html"
renders as HTML in-place -
type="text/plain"
renders as text, i.e. set the innerText, not innerHTML -
type="text/markdown"
- Markdown -
type="text/vega"
- Vega -
type="text/vega-lite"
- Vega-lite -
type="text/plotly"
- Plotly -
type="text/echarts"
- echarts -
type="text/mermaid"
- mermaid graph -
type="text/flowchart"
- flowchart -
type="text/js-sequence"
- js-sequence - etc.
Implementation:
- Each works as a plugin that can be registered independently, and can be extended. text/html will use
_.template
for example. - To allow use of
</script>
tags for code examples, the container can be<template>
instead of<script>