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

Projects
None yet
5 participants
@thehydroimpulse
Copy link
Contributor

thehydroimpulse commented Aug 9, 2014

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

Rustdoc: Frontmatter Support
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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

thehydroimpulse commented Aug 9, 2014

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

This comment has been minimized.

Copy link
Contributor Author

thehydroimpulse commented Aug 9, 2014

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

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Aug 21, 2014

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

@thehydroimpulse

This comment has been minimized.

Copy link
Contributor Author

thehydroimpulse commented Aug 22, 2014

@brson np. Will do!

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Aug 29, 2014

@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

This comment has been minimized.

Copy link
Contributor Author

thehydroimpulse commented Aug 29, 2014

@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

This comment has been minimized.

Copy link
Contributor Author

thehydroimpulse commented Sep 10, 2014

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

@edunham

This comment has been minimized.

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

This comment has been minimized.

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.

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.