markup icon indicating copy to clipboard operation
markup copied to clipboard

Render files that looks like markdown that does not have an markdown or md extension.

Open AraHaan opened this issue 8 years ago • 8 comments

For example I have an markdown file that is named .rst.in which is in input to pandoc to make it generate an rst file. As such github should be able to render it just like the rst file if people go by naming like that.

Example files: https://github.com/DecoraterBot-devs/DecoraterBot/blob/Async/README.rst.in https://github.com/DecoraterBot-devs/DecoraterBot/blob/Async/description.rst.in

This can also be said about files that looks like rst as well when used to generate other formats with similar naming strategies. people can name them using the <file name>.<any of pandoc's supported conversion to formats>.in As such I think github should still be able to render those just like the converted ones from pandoc.

However there is a known issue with tables, pandoc likes to ruin them forcing me to convert them to html temporarily just to convert them to rst that looks 100% like the markdown ones.

AraHaan avatar Jun 03 '17 17:06 AraHaan

:wave: We do our detection using the linguist gem, so a PR or issue there will be the quickest way to get this fixed.

If you'd like to have a go at fixing this yourself, I can think of two possible routes:

  1. You can add the .in variants directly to the extensions key of each format.
  2. You could add a heuristic for ".in" which dispatches to the correct parser.

Hope this helps!

kivikakk avatar Jun 05 '17 01:06 kivikakk

I think adding an heuristic would work perfectly for this kind of issue.

AraHaan avatar Jun 05 '17 03:06 AraHaan

I hate mobile copy of this website as the stupid close and comment button gets in the way of the default iOS keyboard. I think when pressing it GitHub should ask "Do you really want to close this issue after sending this comment?". And then if they press no it would fail to send the comment and not close the issue. Would at least fix the accidential issue close issue of itself.

AraHaan avatar Jun 05 '17 03:06 AraHaan

Are you referring to how the "close and comment" button is really near the keyboard here? I'll pass on the confirm dialog suggestion to our UX people! I have closed issues and PRs by accident before too.

kivikakk avatar Jun 05 '17 05:06 kivikakk

Yes, but when viewing the extended keyboard on the side the keyboard completely covers the button and sometimes the keyboard disappears while typing and you can accidentally press the button.

AraHaan avatar Jun 05 '17 05:06 AraHaan

Should I render bruising?

Sent from my MetroPCS 4G LTE Android Device

justmehlc76 avatar Jun 05 '17 05:06 justmehlc76

I managed to get GitHub renders a file without extension as a Markdown file by adding a vim modelines at the top.

<!-- vim: syntax=Markdown -->

To accomplish this I followed the instructions on https://github.com/github/linguist#overrides. I also tried using the override with the .gitattributes file, and I am wondering on why is not working. Any idea?

dexpota avatar Feb 03 '19 14:02 dexpota

Thanks for the tips!

I was also expecting that defining the language in .gitattributes would work, but the preview is not properly shown. YAML metadata is shown as a table, but the content is shown as plain text and break lines are removed:

image

Would it be any option that markup also takes into account the .gitattributes way of working?

rogerbramon avatar Mar 21 '23 06:03 rogerbramon

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 11 '24 12:12 github-actions[bot]

Has this been fixed yet?

AraHaan avatar Dec 23 '24 00:12 AraHaan

https://github.com/github/markup/issues/1069#issuecomment-2558682403

@AraHaan, when GHA nukes an issue, it's nuked forever (in practice). :(

RokeJulianLockhart avatar Apr 23 '25 09:04 RokeJulianLockhart