mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-13 09:30:37 +03:00
[GH-ISSUE #475] Provide markdown rendering support #2975
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.htmladd 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 renderREADME.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
@sigoden commented on GitHub (Oct 30, 2024):
Dufs will never treat any file differently.
Users who need markdown rendering should use a custom UI.
@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