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

Add support for YAML metadata in Markdown files #1636

Closed
wants to merge 1 commit into from

Conversation

kernc
Copy link
Contributor

@kernc kernc commented Feb 23, 2015

Meta extension from Python-Markdown>=2.6 supports YAML (Jekyll-like) headers and an optional yaml switch which, when used, parses data with PyYAML and hence a wee bit different metadata object gets provided. This is what I came up with. I think it may work well perhaps.

Related: getpelican/pelican-plugins#382

~~Would YAML deserve a mention in docs/content.rst?~~Done.

Would additional test cases be desired? 😅

@kernc
Copy link
Contributor Author

kernc commented Feb 26, 2015

The discussion on dropping internal metadata altogether should be considered. Some of the changes here are relevant even with an external yaml-meta-data markdown plugin, though.

@robclancy
Copy link

Just add it as an option? Why is this on the milestone with no activity? We want the release but all I see is 3 random issues stagnating. Is there other issues actually holding up the release?

@kernc
Copy link
Contributor Author

kernc commented May 20, 2015

@robclancy How would you make it an option? Everything is already in place as-is anyway, just a couple of invariants need to be evened out (e.g. if it's already a datetime object, don't parse it, if it's already a list of tags, don't str.split it, etc.)

Will rebase this asap.

@robclancy
Copy link

I don't know I just see this stagnating for no reason other than not being able to decide to put it in or not? I don't know if I will use this but as I come from other static site generators I would like the option (we have a LOT of metadata atm). I just want to be able to go to 3.6 and stay there instead of checking back every week for a new release.

~~Python-Markdown>=2.6 and its meta extension supports YAML headers
and optional `yaml` switch which, when used, parses data with
PyYAML and hence a wee bit different metadata object gets provided.~~
Not anymore.

YAML is supported by python-markdown-yaml-meta-data extension
which uses PyYAML, which returns parsed lists of strings instead
of raw strings, datetime objects instead of string date
representations etc. Pelican needed only slight adjusting, and
now support Jekyll-like YAML headers with aforementioned Markdown
extension.

Related:
* https://github.com/teoric/python-markdown-yaml-meta-data
* getpelican/pelican-plugins#382
* Python-Markdown/markdown#390 (comment)
@justinmayer
Copy link
Member

Thanks for the rebase, @kernc. From your perspective, I assume this is good to go and ready for inclusion in 3.6, without any follow-on work needed before release?

@ingwinlu
Copy link
Contributor

ingwinlu commented Jun 3, 2015

I would expect to see some test cases for this kind of metadata and updated documentation about markdown metadata.

@justinmayer
Copy link
Member

@kernc: How useful/relevant is this PR given that Python-Markdown removed YAML metadata support?

@kernc
Copy link
Contributor Author

kernc commented Jun 8, 2015

Indeed. And the YAML meta data extension seems to have just recently inverted to outputting plain strings. So this PR seems to be irrelevant. Good that you checked again. Sorry for taking so long.

@kernc kernc closed this Jun 8, 2015
@justinmayer justinmayer removed this from the 3.6 milestone Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants