-
Notifications
You must be signed in to change notification settings - Fork 343
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
help: Add a keyword feature #4630
Conversation
ef49089
to
7024fe6
Compare
Is this associated with #3224? |
Oh! I didn't know about that! But yeah, I don't see why this couldn't be extended after to explain errors. This PR started from discussion on #4518: #4518 (comment). |
a173a66
to
60a048d
Compare
Related: #3130 by me, which actually adds a I don't think it should block this or anything, just putting it out there. In the future I imagine some merger of these two ideas would occur, really. |
a6ddaa7
to
fd411fe
Compare
fd411fe
to
01830bb
Compare
abe4799
to
24b84f3
Compare
595952a
to
4312362
Compare
4312362
to
16882a2
Compare
3b8cba1
to
cf590c5
Compare
@Grillo-0: I see that you requested my review. I find it hard to find enough time to review many PRs lately. I'm happy to trust Yuya's review. Let me know if you really want me to review it too. |
59073e9
to
cf61214
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
It would be nice to not need to go the documentation website. This aims to solve that by introducing the concept of keyword to the help command. Basically, keywords are things that we want to add help messages to, but they don't necessarily have an associated subcommand. For now we only have two keywords: - `revsets`: Shows the docs for revsets - `tutorial`: Shows the tutorial that is on the documentation You get the keyword content by tipping `jj help --keyword revsets` or `jj help -k revsets`. You can also list the available keywords with `jj help --help`. It would be nice to have all the documentation on the keywords, maybe a next commit could do it.
cf61214
to
4306d04
Compare
I will merge this |
Keyword { | ||
name: "revsets", | ||
description: "A functional language for selecting a set of revision", | ||
content: include_str!("../../../docs/revsets.md"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anyone know if this pointer outside of the crate will work when we publish to crates.io (as I'm supposed to do on wednesday)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. It could be worked around by a symlink (ln -s ../docs cli
), but symlink has its own problem, so I have no idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I somewhat doubt it will, I found a rather confusing thread about it.
We should probably instead use build.rs
in order to get access to OUT_DIR
and just copy the files there at compile time. A minor annoyance but nothing too horrid, I guess (though I'd need to figure out how to port the Buck changes, I expect it would be very minor.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that we should make build.rs
copy the files from docs/
into e.g. cli/srcs/docs/
so we have two copies of the files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, what we can do with build.rs
is to fall back to ../docs
if ./docs
doesn't exist? We'll need docs
symlink or something in order to include docs/*
in the release package.
It would be nice to not need to go the documentation website. This aims to solve that by introducing the concept of categories to the help command.
Basically, categories are things that we want to add help messages to, but they don't necessarily have an associated subcommand.
For now we only have two categories:
-
revsets
: Shows the docs for revsets-
tutorial
: Shows the tutorial that is on the documentationYou get the category content by tipping
jj help revsets
.It would be nice to have all the documentation on the categories, maybe a next commit could do it.
Checklist
If applicable:
CHANGELOG.md