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

Closed
opened 2026-04-08 16:51:35 +03:00 by zhus · 1 comment
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-08 16:51:35 +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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#262