-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Copy link
Labels
CLIenhancementImprove something existing (e.g. no docs, new APIs, etc)Improve something existing (e.g. no docs, new APIs, etc)
Milestone
Description
Type of Change
- New Feature Request
- Documentation / Website
- Improvement / Suggestion
- Bug
- Other (please clarify below)
Summary
Currently there is a secondary plugin needed to extract the frontmatter from a markdown file, in addition the existing remark-frontmatter plugin, which (in theory) should be able to get it for already.
const settings = config.markdown.settings || {};
const fm = frontmatter(markdownContents); // one plugin
processedMarkdown = await unified()
.use(remarkParse, settings)
.use(remarkFrontmatter) // another one here
.use(remarkPlugins)
....
.process(markdownContents);
if (fm.attributes) {
// do stuff
}
Details
It would be great to just get everything from processedMarkdown
directly, instead of needing a second package just to get the frontmatter. From the docs, this should be possible, but I was having issues when I tried it initially, but hopefully by now we can figure it out. 🤞
Metadata
Metadata
Assignees
Labels
CLIenhancementImprove something existing (e.g. no docs, new APIs, etc)Improve something existing (e.g. no docs, new APIs, etc)
Type
Projects
Status
✅ Done