From 7f25e4395d8d2391baa07665b9a3184aa60a9e43 Mon Sep 17 00:00:00 2001
From: fry69 <142489379+fry69@users.noreply.github.com>
Date: Wed, 17 Sep 2025 07:06:28 +0200
Subject: [PATCH 1/5] docs: fix markdown docs
---
docs/latest/examples/markdown.md | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/docs/latest/examples/markdown.md b/docs/latest/examples/markdown.md
index ba7d18e928c..d49750eff65 100644
--- a/docs/latest/examples/markdown.md
+++ b/docs/latest/examples/markdown.md
@@ -11,10 +11,10 @@ browser.
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`:
+1. Run `deno install --allow-scripts jsr:@deno/gfm`
+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,29 @@ 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:
-
,
+
);
});
```
+## More complex examples
+
+For building a full markdown blog see this [tutorial](https://www.jackfiszr.eu/how-to-build-a-blog-with-fresh-2.0) or have a look at the [source code](https://github.com/denoland/fresh/tree/main/www) for this documentation website.
+
## Other libraries
There are several other popular libraries besides `@deno/gfm` that can be used
From a86f09498af47649c4eae3a6db584dd87cd5a836 Mon Sep 17 00:00:00 2001
From: fry69 <142489379+fry69@users.noreply.github.com>
Date: Wed, 17 Sep 2025 07:10:06 +0200
Subject: [PATCH 2/5] chore: formatting
---
docs/latest/examples/markdown.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/latest/examples/markdown.md b/docs/latest/examples/markdown.md
index d49750eff65..7c94b8a8656 100644
--- a/docs/latest/examples/markdown.md
+++ b/docs/latest/examples/markdown.md
@@ -45,7 +45,10 @@ export default define.page(async () => {
## More complex examples
-For building a full markdown blog see this [tutorial](https://www.jackfiszr.eu/how-to-build-a-blog-with-fresh-2.0) or have a look at the [source code](https://github.com/denoland/fresh/tree/main/www) for this documentation website.
+For building a full markdown blog see this
+[tutorial](https://www.jackfiszr.eu/how-to-build-a-blog-with-fresh-2.0) or have
+a look at the [source code](https://github.com/denoland/fresh/tree/main/www) for
+this documentation website.
## Other libraries
From 73b50844611fa70677a2bcd1c0eec307a378e18a Mon Sep 17 00:00:00 2001
From: fry69 <142489379+fry69@users.noreply.github.com>
Date: Wed, 17 Sep 2025 07:18:05 +0200
Subject: [PATCH 3/5] docs: fix minor wording
---
docs/latest/examples/markdown.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/latest/examples/markdown.md b/docs/latest/examples/markdown.md
index 7c94b8a8656..7546e537223 100644
--- a/docs/latest/examples/markdown.md
+++ b/docs/latest/examples/markdown.md
@@ -46,7 +46,7 @@ export default define.page(async () => {
## More complex examples
For building a full markdown blog see this
-[tutorial](https://www.jackfiszr.eu/how-to-build-a-blog-with-fresh-2.0) or have
+[tutorial](https://www.jackfiszr.eu/how-to-build-a-blog-with-fresh-2.0) or take
a look at the [source code](https://github.com/denoland/fresh/tree/main/www) for
this documentation website.
From 4a8aed2151da80feecd9bc3ab29329fe1cd091ae Mon Sep 17 00:00:00 2001
From: fry69 <142489379+fry69@users.noreply.github.com>
Date: Wed, 17 Sep 2025 07:20:21 +0200
Subject: [PATCH 4/5] docs: split two example links
---
docs/latest/examples/markdown.md | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/docs/latest/examples/markdown.md b/docs/latest/examples/markdown.md
index 7546e537223..affbafc56a9 100644
--- a/docs/latest/examples/markdown.md
+++ b/docs/latest/examples/markdown.md
@@ -46,9 +46,11 @@ export default define.page(async () => {
## More complex examples
For building a full markdown blog see this
-[tutorial](https://www.jackfiszr.eu/how-to-build-a-blog-with-fresh-2.0) or take
-a look at the [source code](https://github.com/denoland/fresh/tree/main/www) for
-this documentation website.
+[tutorial](https://www.jackfiszr.eu/how-to-build-a-blog-with-fresh-2.0).
+
+For a more elaborate markdown system with Fresh 2 take a look at the
+[source code](https://github.com/denoland/fresh/tree/main/www) for this
+documentation website.
## Other libraries
From 8fa5f613fdfa2264f02593a1d41f76852f0654b5 Mon Sep 17 00:00:00 2001
From: fry69 <142489379+fry69@users.noreply.github.com>
Date: Fri, 19 Sep 2025 10:30:12 +0200
Subject: [PATCH 5/5] docs: remove --allow-scripts
---
docs/latest/examples/markdown.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/latest/examples/markdown.md b/docs/latest/examples/markdown.md
index affbafc56a9..91a07a2f83e 100644
--- a/docs/latest/examples/markdown.md
+++ b/docs/latest/examples/markdown.md
@@ -11,7 +11,7 @@ browser.
First, let's install the [`@deno/gfm`](https://jsr.io/@deno/gfm) package that
can transform markdown to html.
-1. Run `deno install --allow-scripts jsr:@deno/gfm`
+1. Run `deno install jsr:@deno/gfm`
2. Create a markdown file like `content/example.md`:
```md content/example.md