Skip to content

[Doc] Ignore lines starting with # in the example code #4353

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

Closed
flip1995 opened this issue Aug 8, 2019 · 2 comments · Fixed by #4409
Closed

[Doc] Ignore lines starting with # in the example code #4353

flip1995 opened this issue Aug 8, 2019 · 2 comments · Fixed by #4409
Labels
A-documentation Area: Adding or improving documentation A-website Area: Improving the clippy website E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@flip1995
Copy link
Member

flip1995 commented Aug 8, 2019

rustdoc hides lines starting with #.

The Clippy documentation still shows these lines:
https://rust-lang.github.io/rust-clippy/master/index.html#boxed_local

It would be great if we could detect those lines and also hide them in the Clippy documentation.

@flip1995 flip1995 added A-documentation Area: Adding or improving documentation E-help-wanted Call for participation: Help is requested to fix this issue. A-website Area: Improving the clippy website labels Aug 8, 2019
@phansch
Copy link
Member

phansch commented Aug 8, 2019

This would have to happen somewhere in this loop:

for line in lint.doc:

lint.doc contains the whole doc comment in the lines before pub LINT_NAME.

We will have to track if we're inside a code block within that loop and then skip the lines starting with \/\/\/(\s+)#.

@flip1995
Copy link
Member Author

flip1995 commented Aug 8, 2019

I think we only have code blocks in the Example section (?). So we could limit this check to last_section == "Example".

bors added a commit that referenced this issue Aug 22, 2019
[Doc] Ignore lines starting with #

Resolves #4353

changelog: none
bors added a commit that referenced this issue Aug 22, 2019
[Doc] Ignore lines starting with #

Resolves #4353

changelog: none
phansch added a commit to phansch/rust-clippy that referenced this issue Aug 23, 2019
[Doc] Ignore lines starting with #

Resolves rust-lang#4353

changelog: none
phansch added a commit to phansch/rust-clippy that referenced this issue Aug 23, 2019
[Doc] Ignore lines starting with #

Resolves rust-lang#4353

changelog: none
@bors bors closed this as completed in 56f51b3 Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Adding or improving documentation A-website Area: Improving the clippy website E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants