Skip to content

ANN: highlight emphasis and strong emphasis in rustdocs #7347

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

Merged
merged 1 commit into from
Jun 18, 2021

Conversation

vlad20012
Copy link
Member

@vlad20012 vlad20012 commented Jun 15, 2021

Depends on #6502

highlight *emphasis* and **strong emphasis** text in rustdocs.
I'm not sure what color scheme should be used by default for *emphasis* text. It's assumed to be italic, but both default Light and Darcula themes highlight all doc comments as italic, hence plain italic *emphasis* would be indistinguishable from a regular doc text. I've used a scheme from #3739 where *strong emphasis* is highlighted as bold and *emphasis* is highlighted as italic and bold simultaneously.

image

Closes #3739

changelog: highlight *emphasis* and **strong emphasis** text in rustdocs

Copy link
Member

@Undin Undin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's about ~~struckout text~~? I know that it's a less common formatting case than Italic and bold, but it looks like it's quite easy to support it as well

@vlad20012
Copy link
Member Author

What's about ~~struckout text~~?

Well... We can't parse it for now. Common Mark Markdown flavor doesn't specify struck-out text. (but rustdoc understand it)

@vlad20012 vlad20012 force-pushed the parse-rust-docs-highlighting-emphasis branch 2 times, most recently from bd0427a to 792ee12 Compare June 17, 2021 05:48
<DOC_COMMENT>/// Some documentation <DOC_CODE>`with a code`</DOC_CODE>, <DOC_EMPHASIS>*an italic text*</DOC_EMPHASIS>
/// and <DOC_STRONG>**a bold text**</DOC_STRONG>
/// <DOC_HEADING># Heading</DOC_HEADING>
/// <DOC_LINK>[Rust](https://www.rust-lang.org/)</DOC_LINK></DOC_COMMENT>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@Undin Undin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except minior comments

@vlad20012 vlad20012 force-pushed the parse-rust-docs-highlighting-emphasis branch from 792ee12 to 04fdbdc Compare June 18, 2021 08:22
@vlad20012
Copy link
Member Author

bors r=undin

@bors
Copy link
Contributor

bors bot commented Jun 18, 2021

Build succeeded:

@bors bors bot merged commit 2a28256 into master Jun 18, 2021
@bors bors bot deleted the parse-rust-docs-highlighting-emphasis branch June 18, 2021 10:52
@github-actions github-actions bot added this to the v150 milestone Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants