YAML front matter
Leave feedback
On this page
Enable IncludeFrontMatter to extract document metadata into a YAML block at the beginning of the Markdown output. This is commonly used by static site generators like Jekyll, Hugo, and Docusaurus.
using GroupDocs.Markdown;
var options = new ConvertOptions { IncludeFrontMatter = true };
string md = MarkdownConverter.ToMarkdown("report.docx", options);
Console.WriteLine(md);
// Output:
// ---
// title: "Q3 Report"
// author: "Jane Doe"
// format: Docx
// pages: 12
// ---
//
// # Q3 Report
// ...
using GroupDocs.Markdown;
var options = new ConvertOptions
{
IncludeFrontMatter = true,
HeadingLevelOffset = 1
};
MarkdownConverter.ToFile("chapter.docx", "chapter.md", options);
Only non-empty fields are included:
| Field | Source | Example |
|---|---|---|
title | BuiltInDocumentProperties.Title | "Q3 Report" |
author | BuiltInDocumentProperties.Author | "Jane Doe" |
format | Detected file format | Docx |
pages | Page or worksheet count | 12 |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.