-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Unhide lines in rustdoc's doc -- Closes #11645 #11810
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
Conversation
Clever! Could you add a comment (with the normal |
Woah, this is way subtle. So this is an example of how to add non-displayed lines to code examples? Is there any other way to solve this besides putting a non-space space character here? If not, can you put a non-displayed comment in here that explains that the following spaces are not space characters? This may be solved by putting {.notrust} on the outer code block, or adding a new type of code block tag that prepare.js understands to not strip these lines. |
Comment added. I let you guys decide whether you prefer modifying prepare.js but frankly I can hardly see any other use case than in rustdoc.md... |
@brson: {.notrust} works but then we lose the colors in the code. |
# /!\ The three following lines are comments, which are usually stripped off by | ||
# the doc-generating tool. In order to display them anyway in this particular | ||
# case, the character following the leading '#' is not a usual space but a non | ||
# breakable one. |
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.
Maybe worth mentioning that these 5 lines have a normal space?
The doc-generating tool comments out the lines that match `/$# /` (note the space), which is not what is wanted here. And it lets live the lines matching `/$#[^ ]/`. But we still want to see a space. So I replaced the normal space by a non breakable one, which fools the parser into displaying the line.
…nishearth add help text where missing to lints Fixes rust-lang/rust-clippy#11805 Essentially just changes the section of code that applies the lint from using `cx.struct_span_lint` and instead opts for `span_lint_and_then`, which automatically appends the help text. changelog: add missing help text for `cast_possible_wrap`, `mod_module_files`, and `self_named_module_files` lints
…shearth disallow calls to `LintContext::struct_span_lint` and `TyCtxt::struct_span_lint_hir` `LintContext::struct_span_lint` and `TyCtxt::struct_span_lint_hir` don't show the link to the clippy documentation, see: rust-lang#11805 In rust-lang#11810, the last few calls to those methods were replaced with `span_lint_*`. It seems like we should just disallow them altogether so that no new code tries to use them. The existing `disallowed_methods` lint makes this easy. changelog: none
The doc-generating tool comments out the lines that match
/$# /
(note the space), which is not what is wanted here. And it lets live the lines matching/$#[^ ]/
. But we still want to see a space. So I replaced the normal space by a non breakable one, which fools the parser into displaying the line.