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

rustdoc doesn't know to nest things into list items #6605

Closed
ben0x539 opened this issue May 19, 2013 · 1 comment
Closed

rustdoc doesn't know to nest things into list items #6605

ben0x539 opened this issue May 19, 2013 · 1 comment

Comments

@ben0x539
Copy link
Contributor

see http://static.rust-lang.org/doc/0.6/core/task.html#enum-schedmode / https://github.com/mozilla/rust/blob/bdc182cc41c27/src/libcore/task/mod.rs#L82

rustdoc generates markdown like

#### Variants

* `DefaultScheduler` - Run task on the default scheduler
* `CurrentScheduler` - Run task on the current scheduler
* `ExistingScheduler(Scheduler)` - Run task on a specific scheduler
* `PlatformThread` - Tasks are scheduled on the main OS thread

The main OS thread is the thread used to launch the runtime which,
in most cases, is the process's initial thread as created by the OS.
* `SingleThreaded` - All tasks run in the same OS thread
* `ThreadPerCore` - Tasks are distributed among available CPUs
* `ThreadPerTask` - Each task runs in its own OS thread
* `ManualThreads(uint)` - Tasks are distributed among a fixed number of OS threads

so the list ends with the PlatformThread line and the rest is a run-on paragraph that happens to have asterisks in it.

@ben0x539
Copy link
Contributor Author

Indenting the second part of the multi-line doc-comment with four spaces apparently tells markdown that we want multiple paragraphs in a single list item, but it looks weird in the .rs file and then there's paragraph elements in some list items and not others, which also looks weird (and inconsistent between markdown implementations):

Variants

  • DefaultScheduler - Run task on the default scheduler
  • CurrentScheduler - Run task on the current scheduler
  • ExistingScheduler(Scheduler) - Run task on a specific scheduler
  • PlatformThread - Tasks are scheduled on the main OS thread

    The main OS thread is the thread used to launch the runtime which, in most cases, is the process's initial thread as created by the OS.
  • SingleThreaded - All tasks run in the same OS thread
  • ThreadPerCore - Tasks are distributed among available CPUs
  • ThreadPerTask - Each task runs in its own OS thread
  • ManualThreads(uint) - Tasks are distributed among a fixed number of OS threads

I'm not sure what the desired html output here is in the first place (maybe paragraphs for every list item whether and css to squeeze them together?), but I suspect the doc comment is okay as it is and rustdoc ought to change.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 30, 2021
Doc markdown

I added "WebGL" along the lines of the existing "OpenGL" to the whitelist of `doc_markdown` as I found this to be a pretty common term.

(this is a follow-up of the now closed rust-lang/rust-clippy#6388)

changelog: Whitelist "WebGL" in `doc_markdown`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant