-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat: add #help note
command
#948
base: main
Are you sure you want to change the base?
feat: add #help note
command
#948
Conversation
remove trailing whitespace
awaiting-review |
Mathlib CI status (docs):
|
The Mathlib test PS: Thank you for being the first live test of this new Batteries feature that checks whether a Batteries PR will break Mathlib downstream! |
when writing this PR i certainly did not take this in consideration, so it was not something i was expecting... |
Indeed, that is a poorly designed test. On the other hand, that test's output shows that |
i guess it could be a |
Actually, it makes sense to move |
The |
wip |
awaiting-review |
unfortunately it seems i can't write a test to make sure the command indeed does work across imports, as i can't figure out how to import a test file in another test file, and writing a library note in the actual module for the sole purpose of testing might not be desirable. In particular, it is impossible to write a library note in the same file that the environment extension is defined. |
This is what |
WIP |
make sure the order is correct.
awaiting-review |
You need to add the dummy files to This looks really good! Other I'll be busy for the rest of the day, so I'll come back for a review tomorrow. |
i added code for prefix search, but left it in comments since it depends on |
You can use |
ok, it should have all the desired features now. please make sure the documentation and tests are sufficient. |
test/library_note.lean
Outdated
|
||
/-- | ||
info: library_note "Other" | ||
/-- |
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 don't see the utility of wrapping each note in /-- ... -/
. How about just separating with a blank line or ---
?
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 think the benefit is that this is less likely to cause confusion as to where one note stops and another begins, and this mimics the way you'd find the note in the actual code.
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 guess my issue is that /-- ... -/
has a specific meaning in Lean, which is not relevant here. So, for example, copy pasting the output in a Lean file would lead to multiple errors. How about /- ... -/
? (No errors then, though that still seems visually cluttered.)
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.
We aren't doing this for any of the other #help
commands, I think the docs should just be indented relative to the library_note
header.
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 reflected on this a bit and I think #help
subcommands should give output that is better than plain code lookup in some useful way. In many cases organization is the key difference but formatting is relevant too. I don't know what would be the best formatting for library notes. How about asking on Mathlib Zulip what users would like to see for library notes?
By the way, no worries about the current |
actually, it looks to me like the script trying to find the mathlib branch fails... |
Yes, the script is broken right now, we're doing manual testing for the time being. |
on zulip it was mentioned that there used to be an easy way to find and/or read library notes, but that this feature no longer works, presumably since lean4.
This PR aims to remedy the situation by introducing the
#help note "some tag"
command, which displays all library notes marked with the tag "some tag" that are declared before the command, including in imports.