desmost
v0.10.0
Published
A tiny DSL for compiling LaTeX to Desmos
Readme
Desmost
Docs · Changelog · Learn · Playground
A tiny DSL for compiling LaTeX to Desmos.
In other words, it’s like HTML+CSS but for Desmos. Write your content in LaTeX (alongside your Markdown!) with Desmost syntax where you need it, and Desmost will turn it into a Desmos calculator embed for you.
Requirements
- Desmos API v1.12
- Desmost only works in the browser, because the Desmos API can only be included via a
<script>tag
Usage
Compile
import { compile } from "desmost";
let calc = Desmos.GraphingCalculator(...);
compile(calc, "f(x) = x^2");Pass in options to customise compilation:
compile(calc, "/text{ sup world! }", {
errors: "crash",
ignore_blank_lines: true,
});Render
Left up to you, in your framework of choice!
But if you enjoy nice things, Desmost provides a Svelte↗ component for mass-compiling Desmost, intended to be used in conjunction with MDsveX↗:
<script>
import Content from "./intro.md";
import { Desmost } from "desmost/svelte";
</script>
<Desmost>
<Content />
</Desmost>This will replace all ```desmos blocks from your Markdown source with Desmos calculator embeds.
