-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Several issues with Specifications v1.3 #4290
Comments
Thanks for the feedback, @avih! I've responded to each of your invidivdual points below.
Oh, great point - thanks! We should replace those - e.g.
True. We could perhaps use a section in the spec for that. It needs to be worded such that it's only applicable to CLI clients though.
Another interesting edge case. I would guess that some help text should be shown. We should update the spec.
That could get complicated. We should perhaps mention which options ar mutually exclusive with which other ones, but the trick there is to find a concise way of expressing that without making the spec look too verbose.
This is very client-dependent. Some clients will support colour, and others don't. The key thread that links them all is the support of CommonMark though, as the spec says:
The spec is actually very clear on this. POSIX style locale codes are used. The spec details that here:
Hrm, that approach has a number of issues. Regional dialects can have significant variances, and the resolution order for different languages is already clearly defined in the languages section of the spec. Specifically, it's the
Oh, oops! We've actually discussed that before, but it must have been dropped. Yeah,
I think that's the intention. Then for example we can request that a user checks with the Many thanks again for all the comments! Would oyu like to open a PR to address some or all of these comments? |
Many thanks for the detailed reply!
I would not do that blindly. As far as I can tell it's actually used as "not required" - exactly demonstrating why correct terminology is important. Excellent example: "Clients MAY NOT support new platforms (though such support is RECOMMENDED)", which could be changed, for instance, to "It's RECOMMENDED that clients support new platforms automatically (without changes to the client)". That's it, RECOMMENDED already includes not-required by the RFC specification, and it's also stronger than MAY.
I think the spec already does that quite a lot, so I'm not seeing it as a blocker.
It's not an edge case, it's the main case.
POSIX has a great set of recomendations how utilities should specify their syntax in a non-ambiguous way - https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
That's the spec for the current directory structure, which I didn't want to refer to because my impression was that it's being moved to another structure - as mentioned at #4120. But if only the structure changes while the names remain in the same format as now, then for instance the locale
I specifically mentioned I don't know much about locales, and it's probably a very bad algorithm. It was given only as an example of what I mean by explicit algorithm. So together with the spec mentioned earlier, It definitely makes it easier for clients to search pages, but I think practically also a lot easier to fail to find pages which the locale does suggest should be found - like the example with
Fair enough. In that case I think It would help to mention just that. Otherwise it can appear contradicting that in one place it states that the client MUST fall back to english, and few lines below that it MUST strictly afhere to the specific language. So at "clients MUST always attempt to fallback to English..." maybe add "except with -L is used - see below" or some such.
Not right now. Getting good specifications right actually requires considerable effort. I mostly pointed at issues, which is a good start, but could still be far from finding the solution, because the more accurate you try to be, the more you notice issues, which also require resolution and more specifications. It's not a trivial process. I actually noticed these issues because I started to implement the specifications, and had so many questions which were not answered by it. So I wanted to check how other clients behave, but from the few clients I tried (node.js, python, bash, sh, perl) it doesn't look like any of them is actualluy compliant... so I was left with the spec alone, which left many things unanswered for me... Thanks again for the reply. Feel free to ping me if you think I could help with some things (and obviously I'll keep watching this thread). |
@sbrl I'm still not entirely clear on the language-to-directory resolution clients are expected to use. Do you prefer that I open a new issue for it? |
Also on the subject of missing basic client behavior description. Say someone who tries to implement the spec makes an educted guess that
and they go "wait, WHAT?!?", was I supposed to run the command NAME? why else would they tell me not to assume it's executable?! was I even supposed to check if it exists at all? They read the spec again and realize no where does it say what the client should actually do. The spec could have said with equal validity: "clients must not make coffee without cream". This makes no sense at all, unless it was specifed earlier, for instance, that So don't assume it's obvious what a client should do, and then go on to specify in gread details what some options must or must not do, and then tell it what NOT to do when you never tell it what YES to do. And another subject, it's technically impossible to "detect" the current platform without knowing IN ADVANCE the exact list of platforms which you have pages for - and even that requires considerable guessing of matching the current platform to one or more of the platforms which you support. For instance, the strings "osx" or "windows" etc are not produced by any API which a client could use. In fact, the only platform which you have (currently) and can be identified automatically by a client without knowing the tldr platforms in advance is Even if the client is a macOS program which can only be run on macOS, it still can't know that it should look for it in |
Here are my suggestion to improve some of the issues mentioned above, not orgnized in specification form. I think that's it for now.
And now, after it's clear WHAT it does, you start to specify HOW it does it.
A client is allowed to use only the basic list, and continue to resolve SRC according FILE and this list alone. Alternatively, a client may try to improve the suitability of the list to the current environment by identifying the current platform and/or preferred languages, as follows: Platform:
Languages:
Then, once it's clear what is the main function and behavior, you specify options - which are optional. |
Wow, that's a lot of text here. It will take me a while to read through it all. |
Oh nice! Perhaps we could adapt some of that then to enhance the clarity of our spec.
Hrm, that's an awkward one. I wonder what we do currently with that? Anyone have any ideas (/cc @owenvoke or @agnivade perhaps)?
Fair enough. You've raised a lot of individual points here though - so I'm unsure as to whether I'll be able to remember and correct them all. You'll have to remind us when the next PR goes through :P
Yes please :-)
Ah, interesting interpretation there. I've started to revise the spec to aid clarity a bit there - so hopefully that clears that up.
Hrm. I see what you're saying there, but note this part of the spec:
Ok, so I've pushed some improvements to the spec to a new branch, but we need to wait for #4246 to be merged before we can open a PR and start working some things out. Particularly with respect to some of the changes here, I think it might be best if you open a separate PR after my changes have gone through. That way you can demonstrate what you mean - which would be more effective that us going back and forth here or in a PR where I've attempted to take action. |
Yeah, sorry about that. Take your time ;)
This "awkwardness" was my main question. In other words, the algorithm doesn't work for the languages which you currently have pages for, so you clearly understand the issue which I was wondering about. Feel free to resolve it anywhere you prefer.
Thanks. I'll try to check it out soon.
This only partially covers it:
Yeah, the exit code is kinda obvious. I wasn't aware of this issue but I also specified the exit code behavior at the "spec" I posted above.
One step at a time. I'm not following the spec daily, so if you want me to help review some changes, just ping me. |
That's what other clients (including node.js) do, but to quote @sbrl:
which I don't disagree with, but when confronted with the reality of existing directories which you have, this part of the spec becomes mostly useless. |
@kbdharun You're more informed on the client specifications. Are there any points in this thread that are missing in the current specs? |
Some non exhaustive issues with spec v1.3:
Terminology:
Client program:
The overall syntax of the client is not mentioned anywhere. I'm guessing it's possibly
client [OPTIONS] CMD
- which suggests that CMD is mandatory, but judging by other text at the page, that's not necessarily the case.While it's specified what some options should do, it's not mentioned anywhere what the client should do when no options are used (but CMD is). I'm assuming the main use case it to print or display some form of the page of CMD, but it's not mentioned anywhere.
It's not mentioned how options may or may not be combined. For instance
-u
withCMD
could be useful, but-l
withCMD
is probably not useful, while-v
probably doesn't go with anything. Should it succeed without arguments at all?Terminal output:
client CMD
it doesn't say if only colors should be stripped, or maybe also the formatting of markup-to-display - i.e. print a raw page file. This goes back to the main task of the client - which isn't specified.Languages/locales:
I'm ignoring issues with the current directory structure, and assume #4120 is the way forward, at which case it's not obvious to me what the algorithm should be to map a locale string to directory name string, but I think it should be specified in absolute terms in order to be useful, because the example at #4120 doesn't show directories with coutry codes.
One simplistic and most probably bad algorithm could be:
pages/<language>
.en
, then also searchpages/en
.E.g. both
en_US.UTF-8
anden_UK
map topages/en
,zh_CN
andzh_TW
andzh
all map topages/zh
, etc.Another algorithm could be to seatch
pages/lc_CC
and thenpages/lc
and then (iflc
is noten
) alsopages/en
.Now, I don't pretend to know much about locales and my ideas is probably complete junk. But you should define absolutely how a locale string maps to directory name string(s) which should be searched, because otherwise it's unlikely IMHO that clients will be able to get the directory name as you expect them to.
More specific locale issues:
LC_ALL
override other vars? (generally it does, but you don't mention it).The text was updated successfully, but these errors were encountered: