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: Frontmatter Support #16374

Closed

Conversation

thehydroimpulse
Copy link
Contributor

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.

---
foo: "bar"
description: "123"
title: "983
Foobar
444"

---

/cc @brson

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.
@brson
Copy link
Contributor

brson commented Aug 9, 2014

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.

@brson
Copy link
Contributor

brson commented Aug 9, 2014

This seems to require that values are formatted differently than in Jekyll. For example in jekyll you can write

-----
keywords: foo, bar, baz
-----

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?

@huonw
Copy link
Member

huonw commented Aug 9, 2014

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.

@thehydroimpulse
Copy link
Contributor Author

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.

@thehydroimpulse
Copy link
Contributor Author

@brson Did you want strings to only be contained on a single line, or did you want multiline support?

@brson
Copy link
Contributor

brson commented Aug 21, 2014

@thehydroimpulse sorry for delay. One line strings are probably good enough for me.

@thehydroimpulse
Copy link
Contributor Author

@brson np. Will do!

@alexcrichton
Copy link
Member

@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!

@thehydroimpulse
Copy link
Contributor Author

@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!

@thehydroimpulse
Copy link
Contributor Author

Don't have free time anymore, sorry. Feel free to use whatever is here or not.

@edunham
Copy link
Member

edunham commented Aug 12, 2015

@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 frontmatter is supposed to go.

@brson
Copy link
Contributor

brson commented Aug 12, 2015

@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.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 21, 2024
feat: Show notable trait impls on hover
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.

5 participants