Skip to content
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

Fix the order in which README files are chosen #360

Closed
karthik opened this issue Sep 13, 2014 · 9 comments
Closed

Fix the order in which README files are chosen #360

karthik opened this issue Sep 13, 2014 · 9 comments
Assignees

Comments

@karthik
Copy link

karthik commented Sep 13, 2014

Hi @bkeepers
Following the merge of PR #343, everything has been working great, but there is a new issue that has come up. If a repository contains both a README.Rmd and a README.md, GitHub now shows README.Rmd. I'm sure you have some mechanism in place to handle which file to choose when repos contain multiple README files/formats.

Example: https://github.com/ropensci/git2r
Here you see the raw, unparsed Rmd is shown by default, when in fact the parsed README is what needs to be displayed.

So if I were to have README.md, README.rst and README.txt (same repo and same folder), how is the order determined?

If it is possible to set the order, README.md should always be displayed over README.Rmd since the latter contains unparsed code. The purpose of having both files in the same folder is so that with each software update, the author can parse the Rmd file and have the most up to date code rendered into the README.md.

I apologize if this issue needs to go elsewhere so please close and open in the right repo.

Thank you.

@renkun-ken
Copy link

Fully agree with @karthik! I would appreciate it if the the display order is set like:

If final result (README.md) exists, show it;
otherwise, show its producer (README.Rmd).

@hilaryparker
Copy link

Yes, +1 to this! I'm VERY happy with the .Rmd rendering. However, this change has broken my workflow because I use README.Rmd -> README.md as my default way for creating reports.

@bkeepers
Copy link
Contributor

Interesting. Currently we just choose the first README that can be rendered, where "first" is determined by the order of the git tree. I don't know if git trees are in any deterministic order.

I'll work on getting this fixed on Monday.

I apologize if this issue needs to go elsewhere so please close and open in the right repo.

You'll generally get a faster response if you contact support@github.com.

@jennybc
Copy link

jennybc commented Sep 14, 2014

👍 to displaying README.md by default, even if a (now beautifully rendered!) README.Rmd is also present

@leeper
Copy link

leeper commented Sep 15, 2014

+1

@leeper
Copy link

leeper commented Sep 15, 2014

This issue is solved by changing the .Rmd extension to .rmd. Example: https://github.com/rOpenGov/recalls

@bkeepers
Copy link
Contributor

This issue is solved by changing the .Rmd extension to .rmd. Example: https://github.com/rOpenGov/recalls

This is true. It looks like git trees use asciibetical order, so .md comes after .Rmd and before .rmd.

Either way, we don't expect everyone to rename their files, so we will get it fixed.

@ymendel
Copy link
Contributor

ymendel commented Sep 16, 2014

Your README.md files should now take precedence over the README.Rmd files.

To answer the question in the original post, generally we look for "formatted" README files before plaintext ones, and we sort them alphabetically (now — it was ASCIIbetical until just a short while ago, hence the problem with .Rmd files). That means, for the specific example, the order is

  1. README.md
  2. README.rst
  3. README.txt

(In all examples, the first element in the list is the one used as the README.)

But that's a little unclear because it's also just plain alphabetic order. If instead of ReStructured Text there were a format called "ZappoText" with an extension .zt, then we'd have

  1. README.md
  2. README.zt
  3. README.txt

And if the markdown file were deleted, it'd be

  1. README.zt
  2. README.txt

And finally, if the only existing file were the plaintext README.txt, that would be the one used.

That's what we do right now, at least. We may do something more sophisticated in the future. We may never find something that works better than this, which is good news for the AsciiDoc fans.

@ymendel ymendel closed this as completed Sep 16, 2014
@hilaryparker
Copy link

Thank you!

Akrog added a commit to Akrog/cinderlib that referenced this issue Jul 4, 2018
Now that we have multiple README files, one for Docker Hub, and another
for Github, we have the wrong file rendered by Github because it chooses
the Markdown instead of the RST file (alphabetical order [1]).

We rename the README.md to README to resolve this, as this seems to help
us get the right file in both cases.

[1] github/markup#360 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants