Skip to content

Howto display source code of markdown files? #13640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fhgd opened this issue Nov 19, 2020 · 8 comments
Closed

Howto display source code of markdown files? #13640

fhgd opened this issue Nov 19, 2020 · 8 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@fhgd
Copy link

fhgd commented Nov 19, 2020

When I browse through the file tree of my repo I find some markdown files (*.md). And when I click on it they are rendered (bold head lines, nice bullet lists, and so on...) which is nice for the most cases.

But in my case I just want to see the plain source code of the *.md file. How can I switch?

@khmarbaise
Copy link
Member

usually in the upper area there are shown links "Raw Permalink Blame History" just use RAW than you see the source code of the markdown file.

@fhgd
Copy link
Author

fhgd commented Nov 19, 2020

Unfortunately, no. For example, on

https://gitea.com/gitea/tea/src/branch/master/CHANGELOG.md

you see the rendered md-file which is nice. But when you click on the first raw-button you get nearly the same rendered result and not the source code of the md-file.

The only work-around for the source code is the blame-button but it could be hard to read.

@khmarbaise
Copy link
Member

khmarbaise commented Nov 19, 2020

I see in your example in the line "3.4 KiB" going to the right those links see the image Raw Permalink Blame History
rendered md

Maybe you have turned off Javascript etc. ?

@khmarbaise
Copy link
Member

I checked the output of the "Raw" link and I get correctly the source code of the markdown file?... Maybe you have installed a markdown plugin in your browser?

source-markdown

@fhgd
Copy link
Author

fhgd commented Nov 19, 2020

Oh, you are right - when I deactivated the markdown add-on I get the same raw output as you. Many thanks for that advice!

Nonetheless, I would like to propose an extra source-code-button next to the raw-button which displays the file with line numbers and syntax highlighting. Is there an existing configuration option for that or is it a new feature request?

@jolheiser jolheiser added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Nov 19, 2020
@lunny
Copy link
Member

lunny commented Nov 21, 2020

For those files who can be rendered, it will be rendered when you visit the file. For other text files, it will be a highlight code review. So I think it's may useful sometimes to view a hightlight code of the markdown file.

@jolheiser I think this should be a proposal but not a question. I will change that.

@lunny lunny added type/proposal The new feature has not been accepted yet but needs to be discussed first. and removed type/question Issue needs no code to be fixed, only a description on how to fix it yourself. labels Nov 21, 2020
@lafriks lafriks closed this as completed Nov 21, 2020
@lafriks lafriks reopened this Nov 21, 2020
@silverwind
Copy link
Member

Essentiall this needs a rendered/source view, similar to SVG files which also suffer from this issue.

@wxiaoguang
Copy link
Contributor

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

7 participants