diff --git a/docs/latest/examples/markdown.md b/docs/latest/examples/markdown.md index ba7d18e928c..91a07a2f83e 100644 --- a/docs/latest/examples/markdown.md +++ b/docs/latest/examples/markdown.md @@ -12,9 +12,9 @@ First, let's install the [`@deno/gfm`](https://jsr.io/@deno/gfm) package that can transform markdown to html. 1. Run `deno install jsr:@deno/gfm` -2. Create a markdown file like `content.md`: +2. Create a markdown file like `content/example.md`: -```md path/to/content.md +```md content/example.md ## some heading and some interesting text here @@ -24,32 +24,34 @@ and some interesting text here 4. Add a route that renders that file -```tsx main.ts +```tsx route/markdown.tsx +// deno-lint-ignore-file react-no-danger +import { define } from "../utils.ts"; import { CSS, render as renderMarkdown } from "@deno/gfm"; -const CONTENT = `## some heading - -and some interesting text here - -> oh look a blockquote -`; - -const app = new App(); - -app.get("/", async (ctx) => { - const content = await Deno.readTextFile("path/to/content.md"); +export default define.page(async () => { + const content = await Deno.readTextFile("./content/example.md"); const html = renderMarkdown(content); - return await ctx.render( + return (

Here comes a markdown post: