Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

View raw non-rendered markdown source with line numbers on file blob show view #297

Closed
cirosantilli opened this issue Nov 13, 2014 · 17 comments

Comments

@cirosantilli
Copy link
Collaborator

cirosantilli commented Nov 13, 2014

Currently, it is not possible to view the highlighted markdown source with line numbers like it is possible for non-markdown files: only the rendered HTML shows:

vs

I want to do this to be able to link to specific lines of the markdown file, like can be done with other file types. Header IDs are somewhat of a workaround, but not enough as you may want to comment any specific line.

It would also enable stuff like: #295, #293 (comment) for markdown.

On GitLab: http://feedback.gitlab.com/forums/176466-general/suggestions/6563749-also-show-non-rendered-markdown-on-blob-show

This is already even possible for SVGs where you have "Display the source blob" and "Display the rendered blob" buttons: https://github.com/corkami/pics/blob/28cb0226093ed57b348723bc473cea0162dad366/binary/elf101/elf101-64.svg Come on GitHub!

@cirosantilli cirosantilli changed the title Also show non-rendered markdown on blob show View non-rendered markdown source with line numbers on blob show Nov 13, 2014
@aspiers
Copy link
Collaborator

aspiers commented Oct 9, 2015

UPDATE: https://github.com/petros replied with template.

What do you mean by this exactly? Thanks for any info!

@cirosantilli
Copy link
Collaborator Author

@aspiers ah, I (cryptically) meant "with the standard ACK reply" :-) I don't even do those updates anymore, they always reply.

@aspiers
Copy link
Collaborator

aspiers commented Oct 9, 2015

Ah right. The only workaround I found so far was to use the blame view instead, which is obviously not great.

@SamirBoulil
Copy link

I'm also interested in having a repository settings option to tell github wether I want my markdown files to be rendered or wether I want to display raw markdown files (BLOB).

@NfNitLoop
Copy link

I'd love this feature too! Wanted to link someone to a particular line of a longish README.md, but you either get the rendered Markdown w/o lines, or you can click "raw" and see the file w/o GitHub's nice line formatting.

@cirosantilli
Copy link
Collaborator Author

@iliastsangaris please use the new +1 button feature instead of comments to avoid notifying people and have an automated upvote count ;-)

@pzanitti
Copy link

I got here because I was wondering how to open an issue from markdown code, so I had to figure out a workaround.

Currently you have to find the .md file, press 'y' to find the blob hash, go to Blame view, find the line numbers, and then manually assemble the reference.

e.g.

Want to reference line 48 of https://github.com/isaacs/github/blob/master/README.md. Master is 001e354f8c7be0d8accccd0f5c9644c7910832b8, line number is L48:

https://github.com/isaacs/github/blob/001e354f8c7be0d8accccd0f5c9644c7910832b8/README.md#L48

I'm very thankful to GitHub, and the great work they do. When I shake

@goswami-rahul
Copy link

goswami-rahul commented Jul 14, 2018

@pzanitti

Currently you have to find the .md file, press 'y' to find the blob hash, go to Blame view, find the line numbers, and then manually assemble the reference.
e.g.
Want to reference line 48 of https://github.com/isaacs/github/blob/master/README.md. Master is 001e354, line number is L48:
https://github.com/isaacs/github/blob/001e354f8c7be0d8accccd0f5c9644c7910832b8/README.md#L48

I'm very thankful to GitHub, and the great work they do. When I shake

https://github.com/goswami-rahul/alien-invasion-game/blob/027071489c12df633d362351364b642443a4415f/README.md#L8

I wonder why doesn't it work in my repo?

@janisozaur
Copy link

I wonder why doesn't it work in my repo?

It works just fine. It doesn't render here, because this is isaacs/github and not goswami-rahul/alien-invasion-game

@cirosantilli cirosantilli changed the title View non-rendered markdown source with line numbers on blob show View raw non-rendered markdown source with line numbers on blob show Aug 6, 2018
@cirosantilli cirosantilli changed the title View raw non-rendered markdown source with line numbers on blob show View raw non-rendered markdown source with line numbers on file blob show view Aug 6, 2018
@XedinUnknown
Copy link

Almost 4 years now. Any progress?

@binki
Copy link

binki commented Sep 2, 2018

@XedinUnknown Please note that this is a repository only for tracking gripes people have with GitHub. The operators of this repository do not have any power to add features to GitHub itself. If you are interested in seeing progress, consider using Contact GitHub to send GitHub itself feedback about the issue. See https://github.com/isaacs/github/blob/master/README.md .

@dhimmel
Copy link

dhimmel commented Apr 1, 2019

Note this question is also on StackOverflow here. As someone who works with markdown files a lot, I run into this issue all the time. I'm surprised GitHub is taking so long to address it!

@cirosantilli the GitLab Feedback link in your comment now seems to redirect to a blog post.

On GitLab: http://feedback.gitlab.com/forums/176466-general/suggestions/6563749-also-show-non-rendered-markdown-on-blob-show

Regarding GitLab however, there is a frontend option to "display source" (pull request). When linking to a markdown file with #L suffix in the URL, it defaults to "display source" rather than "display rendered file".

@Frug
Copy link

Frug commented Jan 14, 2020

I'm rather surprised not to be able to turn off the preview for READMEs. It never mattered for me... until I wanted to link someone to a line in the readme.

Wouldn't a preview button to view it rendered make sense?

@fr0
Copy link

fr0 commented Jan 22, 2020

Has anyone submitted this to GitHub support as a request? I'm not sure that they check this repo.

@ABHISHEK-G0YAL
Copy link

Any progress! I too want my markdown files to not be rendered as they are used by a jekyll project. Github renders my markdown file horribly wrong that I want it to not render it.
https://github.com/ABHISHEK-G0YAL/Hacktoberfest-2020/blob/master/index.md (This is how github renders it)
https://abhishek-g0yal.github.io/Hacktoberfest-2020/ (This is how my jekyll site renders it)
https://raw.githubusercontent.com/ABHISHEK-G0YAL/Hacktoberfest-2020/master/index.md (This is how it is raw)
You can see the links for reference.

@christianh814
Copy link

Just adding my +1 ..this would be a cool feature

@TPS
Copy link
Collaborator

TPS commented Jul 2, 2021

Announced via https://github.blog/changelog/2021-06-30-parameter-to-disable-markdown-rendering/: Append ?plain=1 to URL & further add #L[line #] for line highlighting (as is typical).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests