-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Markdown parsing in doc comments #5891
Conversation
10af7ac
to
82ebbe7
Compare
82ebbe7
to
e906f16
Compare
Could you clean up the commits for how you'd like this reviewed? Generally, its best to have a commit that adds tests before the feature work. In this case, i would expect it to show the current handling so the diff shows how formatting changes. |
35eac60
to
58308ab
Compare
@epage Changed the commits as requested. |
I also added the open questions I had in the PR description |
Before merging, preference on whether #2389 should be used as the tracking issue or if we should open a dedicated one? |
Maybe a new one would be good, we could transfer the open questions from the PR description there to discuss them more easily. |
@epage should I squash the commits now to match the commit message requirements? |
If you'd like, go ahead and create the tracking issue so you have edit permissions. As it was just a test commit, I wasn't too worried. |
I created it in #5900 |
This is such a cool feature. Out of curiosity: Have you considered usind Djot https://github.com/jgm/djot? I think it might be relevant when Markdown is added to a crate that a lot of people focus very much w.r.t binary size and performance. AFAIA, djot is specifically a simplification of Markdown to make parsing faster and easier. |
This is currently limited to clap_derive and happens during build time, so build time is the only consideration. I created https://github.com/rosetta-rs/md-rosetta-rs to compare different implementations. We aren't locked into one though parity with rustdoc is a bonus. As for using a different format, that is unlikely. Besides having a rust implementation, compatibility with rustdoc is important. At first glance, I didn't see what all they changed but we'd at least needa subset of markdown. |
@epage Oh, cool. I can add jotdown just out of curiosity! :)
It isn't really a different format. It kind of is just a slightly more strict Markdown, AFAICT. |
fixes #2389
# heading
![image]()
<html>
> blockquote
>
`code`
*emphasis*
**strong**
~stikethrough~
[link](url)
`inline code `
---
hrule---
surrounded by empty lines| tables |
\\\n
and\n
hard breakOpen Questions
•
for bullet lists,Options::ENABLE_SMART_PUNCTUATION
forpulldown_cmark
, unicode lines for blockquotesa.
,b.
andi.
,ii.
? we could use https://docs.rs/nominals for that