jelovirt / org.lwdita

LwDITA parser for DITA-OT
http://lwdita.org/
Apache License 2.0
25 stars 19 forks source link

Export metadata to YAML frontmatter #212

Open infotexture opened 9 months ago

infotexture commented 9 months ago

Currently, YAML frontmatter can be read from Markdown input to specify certain metadata elements for the DITA prolog.

But there doesn’t appear to be a (documented) way to export this (or other) metadata to Markdown output.

Additional metadata

Various Markdown publishing systems and static site generators use YAML metadata to define things like page titles, shorter navigation titles, descriptions, and ToC order.

Since this information is available in the DITA source, it would be useful if it could be written to the YAML metadata when generating Markdown output.

---
title: About this project
description: Learn more about the project I’m working on.
---

As each publishing system supports different keys, there would probably need to be a way to configure mappings from various DITA elements to YAML keys, or additional output formats (similar to markdown_gitbook) that bake in mappings for certain systems.

Examples

↓Element \ SSG → Docusaurus Starlight
<title> title title
<shortdesc> description description
<navtitle> sidebar_label sidebar-label
ToC order sidebar_position sidebar-order

[!NOTE]
I realize this will require further discussion and specification, just filing this to make sure it's on the radar, and provide a place for that discussion to happen in public.

infotexture commented 9 months ago

Just noticed the previously-filed #60, which is related, but the original question there is slightly different, so I'll leave this here for now.