-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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: Frontmatter Support #16374
Rustdoc: Frontmatter Support #16374
Conversation
This is the initial PR to add frontmatter support. Note that it currently only supports strings (and booleans) as values. Lists, integers and such can be added in future PRs. This doesn't integrate the frontmatter into the rest of rustdoc as I wanted to get this out there.
Thanks. Even though this isn't wired up to anything yet, I want to get it merged so I can use it for describing metadata, to close out #12466. |
This seems to require that values are formatted differently than in Jekyll. For example in jekyll you can write
but this looks to be more strongly typed, and require quotes around strings. I'd like to keep rustdoc in conformance with whatever markdown 'standards' already exist. Can this be changed? Is there any spec anywhere for markdown frontmatter? |
I believe jekyll just uses YAML, we probably don't want to write a full YAML parser (not yet anyway); AIUI, it's very compilcated. |
Yeah, it's traditionally YAML, which I wanted to stay away from creating a full blown parser. I can definitely change the syntax to be a little looser and follow the jekyll syntax a little more. |
@brson Did you want strings to only be contained on a single line, or did you want multiline support? |
@thehydroimpulse sorry for delay. One line strings are probably good enough for me. |
@brson np. Will do! |
@brson ping, does this look ok to you? It would be nice to have some comments in the file about this (personal preference) as well! |
@alexcrichton Just need to push my change to be a little like yaml (less strongly typed) per @brson's request. I'll also add some comments! |
Don't have free time anymore, sorry. Feel free to use whatever is here or not. |
@alexcrichton, @brson Should we re-open and merge this as-is? If the lack of comments and need for quotes are a blocker, I can have a go at fixing it up, but I might make it worse 😐 Just nudging on this since it seems to be nearly-complete and looks like the path of least resistance to completing #16178. The only merge conflict between this commit and Rust right now is that Git can't figure out where in the list of modules |
@edunham If the SEO issue is still relevant then it may be worth cleaning up and reposting. We could also consider different approaches to solving the SEO problem, for example by just putting HTML directly into our standalone docs. |
feat: Show notable trait impls on hover
This is the initial PR to add frontmatter support. Note that it
currently only supports strings (and booleans) as values. Lists,
integers and such can be added in future PRs.
This doesn't integrate the frontmatter into the rest of rustdoc as I
wanted to get this out there.
/cc @brson