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

Projects
None yet
5 participants
@steveklabnik
Copy link
Member

steveklabnik commented Jul 29, 2014

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

This comment has been minimized.

Copy link
Contributor

lilyball commented Jul 29, 2014

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

This comment has been minimized.

Copy link
Member

chris-morgan commented Jul 29, 2014

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

steveklabnik commented Jul 29, 2014

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

@steveklabnik

This comment has been minimized.

Copy link
Member Author

steveklabnik commented Jul 29, 2014

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

steveklabnik commented Aug 1, 2014

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member Author

steveklabnik commented Aug 1, 2014

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.

@Gankro

This comment has been minimized.

Copy link
Contributor

Gankro 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

This comment has been minimized.

Copy link
Member Author

steveklabnik commented Aug 12, 2014

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

@steveklabnik steveklabnik deleted the steveklabnik:gh15499 branch Aug 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.