[GH-ISSUE #475] Provide markdown rendering support #2975

Closed
opened 2026-04-12 17:13:23 +03:00 by zhus · 2 comments
Owner

Originally created by @hugo-akaora on GitHub (Oct 30, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/475

Specific Demand

Would be great to provide markdown rendering support in dufs, like in https://github.com/brson/basic-http-server

Implement Suggestion

md-block: Render styleable Markdown in your HTML is great.

I found an easy way to do it:

In assets folder, in index.html add between <head></head>: <script type="module" src="__ASSETS_PREFIX__markdown/md-block.js"></script>

Extract markdown folder (it's basically offline md-block/marked.js/dompurify) folder in assets folder. You could also fetch JS using a CDN but I do not like it (and my dufs instance must work offline too).

Then add <md-block untrusted src="README.md"></md-block> to render README.mdwhen one exists in folder.

Don't know if you would be interested in implementing it, it's extra JS and it's probably a niche.

I'm personally satisfied by my workaround :) So I posted an issue so it could be useful for others.

Feed free to close it, and many thanks for dufs! <3

Originally created by @hugo-akaora on GitHub (Oct 30, 2024). Original GitHub issue: https://github.com/sigoden/dufs/issues/475 ## Specific Demand Would be great to provide markdown rendering support in dufs, like in https://github.com/brson/basic-http-server ## Implement Suggestion [md-block: Render styleable Markdown in your HTML](https://md-block.verou.me/) is great. I found an easy way to do it: In assets folder, in `index.html` add between `<head></head>`: `<script type="module" src="__ASSETS_PREFIX__markdown/md-block.js"></script>` Extract [markdown folder](https://github.com/user-attachments/files/17571084/markdown.zip) (it's basically offline md-block/marked.js/dompurify) folder in assets folder. You could also fetch JS using a CDN but I do not like it (and my dufs instance must work offline too). Then add `<md-block untrusted src="README.md"></md-block>` to render `README.md`when one exists in folder. Don't know if you would be interested in implementing it, it's extra JS and it's probably a niche. I'm personally satisfied by my workaround :) So I posted an issue so it could be useful for others. Feed free to close it, and many thanks for dufs! <3
zhus closed this issue 2026-04-12 17:13:23 +03:00
Author
Owner

@sigoden commented on GitHub (Oct 30, 2024):

Dufs will never treat any file differently.

Users who need markdown rendering should use a custom UI.

<!-- gh-comment-id:2447283455 --> @sigoden commented on GitHub (Oct 30, 2024): Dufs will never treat any file differently. Users who need markdown rendering should use a custom UI.
Author
Owner

@image72 commented on GitHub (Apr 10, 2026):

@sigoden current, markdown file is very important file format in llm, document and many more place required. when render markdown file just need place <script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script> will auto process pass markdown content as html page.
I think that very usefully.

reference project:
https://github.com/MichielDeMey/marked-mermaid
https://github.com/markedjs/marked

<!-- gh-comment-id:4223802638 --> @image72 commented on GitHub (Apr 10, 2026): @sigoden current, markdown file is very important file format in llm, document and many more place required. when render markdown file just need place ` <script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>` will auto process pass markdown content as html page. I think that very usefully. reference project: https://github.com/MichielDeMey/marked-mermaid https://github.com/markedjs/marked
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#2975