sourcebot icon indicating copy to clipboard operation
sourcebot copied to clipboard

[FR] Markdown files should render in markdown and not plain text

Open brendan-kellam opened this issue 10 months ago • 3 comments

When viewing a markdown file, it would be useful if it actually rendered, and then gave you the option to view the raw source. GitHub does this: https://github.com/sourcebot-dev/sourcebot/blob/main/README.md

brendan-kellam avatar Jan 27 '26 05:01 brendan-kellam

Hi , @brendan-kellam . I’m looking into this issue now and will work on resolving it. Feel free to share any additional context if you have it.

Naresh-official avatar Feb 01 '26 08:02 Naresh-official

image.png

From a UX perspective, imo having a Toggle group similar to GitHub would probably make sense to select between previewing the README or viewing the raw source.

In terms of rendering it, we are already using remark to render Markdown for ask, so that would be a good option here: https://github.com/remarkjs/remark

brendan-kellam avatar Feb 03 '26 18:02 brendan-kellam

Hi, I'd like to pick this up. My plan: detect markdown files in the browse view and render them GitHub-style by default, with a toggle to switch back to the raw source (the existing CodeMirror view stays as-is). Rendering would use react-markdown, which is already a dependency. I have the project running locally and the issue reproduced. Does that approach sound good before I start on a PR?

rudraasakariya avatar Jun 12 '26 02:06 rudraasakariya