-
Notifications
You must be signed in to change notification settings - Fork 98
feat: convert docComments in Literate Lean pages #425
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
base: main
Are you sure you want to change the base?
Conversation
| addBlock (← ofBlock helper other) | ||
| -- Lemma is purposefully unchecked, such that it can be matched on when a project | ||
| -- is dependent on mathlib | ||
| | ``declaration | `lemma => |
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.
This is making me think that this should be an attribute rather than a hardcoded list.
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.
Is there a way we can attach an attribute to the keyword lemma somehow (or can we avoid tagging every lemma in the book project)? If yes, I definitely agree.
If not, I think it depends on the aim of LiterateLeanPage:
- If the goal is to best-effort render any existing lean file, then having to tag the custom-definitions you want to be converted is kind of rough.
- If the goal is to provide an easy way to convert an existing lean file to something that can be rendered nicely, then I think introducing an attribute is fine.
I can totally get it if you don't want to have the hardcoded `lemma there in any case, so I'm also happy to remove it and maintain it as a patch right now for the analysis book project, since I'm currently doing that anyway.
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 was thinking that there would be something like an attribute that's attached to the syntax kind lemma, not to every lemma in the world! So you'd have something along the lines of:
attribute [renderDocComments] Mathlib.Parser.Declarations.lemma
once in your setup file.
Do you know how to make an environment extension and a custom attribute? If not, I can do that last step before merging.
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.
And it's not so much that I want to avoid the hardcoded lemma as it is that I want other people to be able to use this with their own custom syntax without having to send me patches!
This feature is controlled by the
verso.literateMarkdown.convertDoccommentsoption, which defaults to false for backwards compatibility.