Skip to content

Add support for YAML metadata #153

Closed
@metasoarous

Description

As pointed out in this nice Stack Overflow answer, YAML section markers are another nice way of specifying metadata. For instance, this is how Jekyll does its metadata specifications. And as pointed out in the SO post, this syntax is also supported by pandoc, a popular Linux markdown processing utility.

Here's a small sample:

---
title: Introduction
author: "Bob Jones"
---

# Hello

I see from #46 that MultiMarkdown notation is supported as follows:

(markdown.core/md-to-html-string* "Title: title\nAuthor: brunokim\n\nFirst paragraph." [:parse-meta? true])
=> {:metadata {:title ["title"], :author ["brunokim"]}, :html "<p>First paragraph.</p>"}

Support for processing YAML metadata could either be added directly to the :parse-meta? true option, or to a separate :parse-yaml-meta? true option. Or both, for the matter. I'd also support adding an option for processing EDN, as suggested in #46.

Would you consider a PR with this functionality? If so, what shape do you think it should take?

Thanks!

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions