-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
How to handle mixed casing of titles and filenames #5085
Comments
I think for the linter to work the page name must exactly and case-sensitively match the page name, but I can't remember. So the linter needs to be considered here. I like the idea of having page name in lowercase, but I'm somewhat concerned that if we encounter 2 commands with different functions but the same name and different casings we'll have an issue. Murphy's Law: If it can happen, it will happen. |
+1 for title = pagename = lowercase. @sbrl I can't think of any example where two commands with the same name, but different casing, have different functionality. That does not seem likely at all, to me. |
To add to this, letting in pages with different cases, but same letters (say |
Oops, looks like my previous comments didn't come out right. I'm in favour of:
|
Example of different commands, same letters:
|
Hmm...that's tricky. I'm not sure what to do about that. As @MasterOdin said, macOS is case-insensitive, and so is Windows, so that situation isn't possible on those OSes. |
@sbrl The linter currently does not do anything with file names. Support for that is being added in tldr-pages/tldr-lint#32 which I will update to support with the decision on this topic. |
I have updated the PR above to include a rule mandating lowercase file names. Similar to what was done with 0.0.9 release, once 0.0.10 (or whatever) is released, I will make a new issue that bundles all pages that now fail validation into a single master issue to track updating them all. |
Nice. |
According to this comment, a consensus hasn't been reached yet. Let's reopen and close once there's a clear agreement on how to proceed. |
My 2 cents: yes, there will be pages with the same name and different casing, but it's equally possible for two tools to exist with exactly the same name in the same platform (see Homebrew/homebrew-core#65438 for an example). That means that allowing case differences may alleviate the problem somewhat, but will not solve it completely, while making things way too nuanced and potentially confusing for those used to case-insensitive platforms (not to mention potential git issues as @MasterOdin mentioned above). My vote, then, is to force all filenames to be lowercase, but allow the page titles to match the command's preferred name, as originally proposed above, as well as in the opening comment. Any objections? |
The situation already exists within tldr of multiple commands with the same name:
I would also like to express that it's not just git that will be a problem, it will also be actual usage of the clients. If you have two pages |
Here's some more commands with the exact same name and casing (and different functionality entirely), for example the more popular bat and less popular bat, and the relevant issue: sharkdp/bat#164 😄 |
My opinion on this would be similar to @waldyrious. |
That sounds like a sensible thing to do. The filename should match the command name in lowercase then, I take it? |
In most cases, yes, but we we can't make that an absolute rule because of the additional cases that @MasterOdin mentioned in his comment. More on this below.
A better approach IMO would be to handle these in a case-by-case basis. But maybe we can come up with a strategy that allows for disambiguation in all cases. Typically package managers use namespacing to resolve this issue, i.e. the tool is referred in the format |
This discussion is now veering into territory covered by #5071, which is directly discussing how to handle an actual existing instance of this (rename commands) that exists in the tldr repo. |
Hrm. Sounds like the issue is complex enough that we can't really enforce any of this via linter rules, except maybe the "always lowercase" bit. |
Drat! Sorry for the diversion. I'll try to follow the discussion there. In any case, for this one, I think we can all agree with (1) making all filenames lowercase, and (2) not forcing the filename to match the title within. All in favor say "aye"! :P |
Aye! 😄 |
Aye! 😃 |
Aye! lol |
In retrospect, I should have asked whether anyone has objections :) Anyway, there doesn't seem to be objections, so the only thing left to do is to implement the rules in tldr-linter. We can close this issue once that's done :) |
@waldyrious I didn't notice this part—
You mean they don't have to match case or they don't have to match at all? |
@bl-ue I think the idea there is that they don't have to match case. |
I wonder if clients will support this. e.g. |
Typing this issue up from recent discussion on gitter.
Currently, most pages use filenames that are lowercased, even if the command that they document utilizes capital letters.
common/pages/R.md is an example of a page who has the file name and title using capitals.
windows/pages/get-content.md is a page where the file name is lowercased and the title/command uses capitals.
While man itself is case sensitive (presumably given Linux's case sensitivity), I do not think it makes sense to apply this to tldr, given that people are using this repo on a range of systems, some case sensitive and some case insensitive. For example, macOS is case insensitive, and so it's possible to refer to any command listed with any capitalization (e.g. I could always use
Python3 /path/to/script.py
), and so mandating memorization of capitalization does not really make sense. Similarly, I could user
to refer toR
.My vote on the resolution of this would be:
(page file name).toLowerCase() === (page title).toLowerCase()
The benefits of this approach imo would be:
The text was updated successfully, but these errors were encountered: