Skip to content
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

docs: consider whether to distinguish kernel-only alloc methods #407

Closed
ojeda opened this issue Jun 30, 2021 · 2 comments
Closed

docs: consider whether to distinguish kernel-only alloc methods #407

ojeda opened this issue Jun 30, 2021 · 2 comments
Labels
• docs Related to `Documentation/rust/`, `samples/`, generated docs, doctests, typos...

Comments

@ojeda
Copy link
Member

ojeda commented Jun 30, 2021

From #402 (comment):

The main reason I think the current way is not acceptable is that when we generate the docs for the alloc crate, people may look at the doc and think that it is part of standard Rust library but clearly it isn't.

From #402 (comment):

I replaced the Rust logo with the Rust for Linux one (in the version we sent for the RFC) so that it was clear when the user is navigating from the kernel docs into the Rust ones (e.g. when clicking on Some).

Having also a banner on the specific methods that are kernel-only would also be nice to further clarify

If we want something extra to the logo, e.g. to highlight individual methods, perhaps we can go with some unique to the kernel so that it is even more obvious, e.g. changing slightly the background color or a colored line in the right or left, etc.

@ojeda ojeda added • docs Related to `Documentation/rust/`, `samples/`, generated docs, doctests, typos... prio: normal labels Jun 30, 2021
@frazar
Copy link

frazar commented Sep 5, 2024

Not sure if this Issue is still relevant, but for what it's worth, it is possible to inject arbitrary HTML in rustdocs simply by placing it in the doc comments:

  • Code change:

     impl fmt::Display for BStr {
    +  /// <p style="font-weight: bold; background: #dad09d;">
    +  /// Be wary of your editor’s word-wrap corrupting your patch, if you choose to cut-n-paste your patch.
    +  /// </p>
       ///
       /// Formats printable ASCII characters, escaping the rest.
  • Generated docs:

@ojeda
Copy link
Member Author

ojeda commented Oct 2, 2024

I think with alloc being custom soon, we can close this.

Injecting some custom HTML is an interesting idea @frazar, although I guess we would have wanted to do it somehow automatically, i.e. without having to write it all the time the same CSS styling and possibly automating the injection too (by looking at the "kernel" annotation we had).

@ojeda ojeda closed this as completed Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
• docs Related to `Documentation/rust/`, `samples/`, generated docs, doctests, typos...
Development

No branches or pull requests

2 participants