-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
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. |
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? |
@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 Will rebase this asap. |
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)
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? |
I would expect to see some test cases for this kind of metadata and updated documentation about markdown metadata. |
@kernc: How useful/relevant is this PR given that Python-Markdown removed YAML metadata support? |
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. |
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? 😅