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

Migrate # -> ## in doc headers. #16082

Closed
wants to merge 1 commit into from

Conversation

steveklabnik
Copy link
Member

I busted out some git grep | xargs sed and fixed this. I've reviewed the diff, and it should be good. Please double check me, though!

Fixes #15499

@lilyball
Copy link
Contributor

I think it's better to tweak the Rustdoc CSS to make <h1> look however we want, then to try and use ## everywhere. It's odd to use ## if we never use #. Also I think /// # Examples looks better when reading the comments than /// ## Examples.

@chris-morgan
Copy link
Member

We should be at liberty to declare that here, # is h2, ## h3, &c. I know that you can do the equivalent in reStructuredText (just specify the starting level for headings), and I will declare that you should be able to do the same with Markdown (whether you can or not).

@brson
Copy link
Contributor

brson commented Jul 29, 2014

If this is just changing all headers in rustdocs to '##', leaving no '#', then I prefer to change rustdoc to make this work as expected. Old rustdoc actually silently converted '#' to '##' before translating to markdown if I recall.

@steveklabnik
Copy link
Member Author

I'm not a fan of changing Markdown's semantics just because.

@steveklabnik
Copy link
Member Author

Also, these are never top-level headers. They're secondary headers. It doesn't make sense to mark up secondary headings as primary headings and then render them as secondary headings.

@brson
Copy link
Contributor

brson commented Aug 1, 2014

@steveklabnik The reasoning for using # there is that in the local context of the item documentation, it is the only header level. The way the docs are structured locally doesn't determine the final rendering which could put those headings at any level (i.e. whose to say that these headings should always be level 2 headings in the output. one version of rustdoc at least had multiple output modes that put these headers at different levels).

@steveklabnik
Copy link
Member Author

Gotcha. Then we're not really doing markdown, we're doing our own kinda-markdown format. Which is a decision we can make, but it should be made explicitly.

@lilyball
Copy link
Contributor

lilyball commented Aug 1, 2014

Well, we already are using a bunch of markdown extensions (appears to be equivalent to GitHub-flavored Markdown + superscripts), so we've already diverged from straight markdown anyway.

@steveklabnik
Copy link
Member Author

Extensions are one thing, and GH flavored markdown is basically markdown, since Gruber's governance of markdown is terrible. Changing the way headings work is a pretty significant divergence.

@Gankra
Copy link
Contributor

Gankra commented Aug 8, 2014

Longterm, do we plan to stick to Hoedown, or would we like to migrate to a pure Rust solution for markdown handling? Hoedown doesn't strike me as particularly configurable outside of the ~10 flags they offer (hardcoded special characters as inline string literals is a notable pattern in their source). Maybe they offer some nice plugin utilities, but their documentation is very weak.

And of course C-bindings are always a higher security risk that native Rust.

@steveklabnik
Copy link
Member Author

This PR is super out of date, so I'm just going to close it.

@steveklabnik steveklabnik deleted the gh15499 branch August 12, 2014 19:34
lnicola pushed a commit to lnicola/rust that referenced this pull request Jan 3, 2024
…e-5, r=Veykril

internal: Migrate assists to the structured snippet API, part 5

Continuing from rust-lang#15874

Migrates the following assists:

- `extract_variable`
- `generate_function`
- `replace_is_some_with_if_let_some`
- `replace_is_ok_with_if_let_ok`
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2024
…e-6, r=DropDemBits

internal: Migrate assists to the structured snippet API, part 6/7

Continuing from rust-lang#16082

Migrates the following assists:

- `extract_function`
- `generate_getter_or_setter`
- `generate_impl`
- `generate_new`
- `replace_derive_with_manual_impl`

Would've been the final PR in the structured snippet migration series, but I didn't notice that `generate_trait_from_impl` started to use `{insert,replace}_snippet` when I first started the migration 😅. This appears to be a pretty self-contained change, so I'll leave that for a separate future PR.

This also removes the last usages of `render_snippet`, which was a follow up goal of rust-lang#11638. 🎉
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

Successfully merging this pull request may close these issues.

Use # vs. ## consistently for headings in documentation
5 participants