Skip to content

Howto display source code of markdown files? #13640

Closed
@fhgd

Description

@fhgd

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?

Activity

khmarbaise

khmarbaise commented on Nov 19, 2020

@khmarbaise
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

fhgd commented on Nov 19, 2020

@fhgd
Author

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

khmarbaise commented on Nov 19, 2020

@khmarbaise
Member

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

khmarbaise commented on Nov 19, 2020

@khmarbaise
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

fhgd commented on Nov 19, 2020

@fhgd
Author

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?

added
type/questionIssue needs no code to be fixed, only a description on how to fix it yourself.
on Nov 19, 2020
lunny

lunny commented on Nov 21, 2020

@lunny
Member

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.

added
type/proposalThe new feature has not been accepted yet but needs to be discussed first.
and removed
type/questionIssue needs no code to be fixed, only a description on how to fix it yourself.
on Nov 21, 2020
silverwind

silverwind commented on Nov 21, 2020

@silverwind
Member

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

locked and limited conversation to collaborators on May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @khmarbaise@lunny@silverwind@lafriks@wxiaoguang

        Issue actions

          Howto display source code of markdown files? · Issue #13640 · go-gitea/gitea