Skip to content

Commit

Permalink
chore: allow example script to be run via url (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
lino-levan authored Mar 8, 2023
1 parent 6f4b8ae commit 79ade25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
15 changes: 6 additions & 9 deletions example/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,12 @@ When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are

$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

You can even typeset individual letters or whole sentences inline just like $x$ or $Quadratic \; formula$. You can also use math blocks to typeset whole equations with $\LaTeX$:

$$
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{aligned}
$$
You can even typeset individual letters or whole sentences inline just like $x$
or $Quadratic \; formula$. You can also use math blocks to typeset whole
equations with $\LaTeX$:

$$ \begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy \end{aligned} $$

# Deno

Expand Down
3 changes: 2 additions & 1 deletion example/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const CONTENT_PATH = new URL("./content.md", import.meta.url);

async function handler(_req: Request): Promise<Response> {
try {
const markdown = await Deno.readTextFile(CONTENT_PATH);
const markdown = await (await fetch(CONTENT_PATH)).text();

const body = render(markdown, {
allowIframes: true,
allowMath: true,
Expand Down

0 comments on commit 79ade25

Please sign in to comment.