Skip to content
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 first-class support for YAML documents #452

Closed
6 tasks done
Witiko opened this issue Jun 18, 2024 · 0 comments · Fixed by #524
Closed
6 tasks done

Add first-class support for YAML documents #452

Witiko opened this issue Jun 18, 2024 · 0 comments · Fixed by #524
Labels
context Related to the ConTeXt interface and implementation latex Related to the LaTeX interface and implementation lua Related to the Lua interface and implementation plaintex Related to the plain TeX interface and implementation yaml Related to the tinyyaml library.
Milestone

Comments

@Witiko
Copy link
Owner

Witiko commented Jun 18, 2024

The processing of YAML documents can often be the primary function of the Markdown package, see my TUG 2024 preprint Markdown themes in practice that discusses just this aspect of the Markdown package. Despite this, our support for YAML documents has a number of weak points:

  1. Invalid YAML documents are processed as markdown text.
  2. The commands \markdownSetup, \setupmarkdown, and \markdownInput and the environments \markdownBegin ... \markdownEnd, \begin{markdown} ... \end{markdown}, and \startmarkdown ... \stopmarkdown are used to process YAML files, which is a confusion name choice.

For these workflows, it would make sense to

  1. Provide an option that would cause us to produce an error when an invalid YAML document has been provided.
  2. Provide better-named aliases for the package files, commands, and environments for the processing of YAML files.

Tasks

  • Add option ensureJekyllData that will cause an error if a document is not (only) a YAML document.
  • Add command \yamlSetup and \setupyaml that will alias the commands \markdownSetup and \setupmarkdown.
  • Add command \yamlInput[...]{...} that will be equivalent to \markdownInput[jekyllData, expectJekyllData, ensureJekyllData, ...]{...}.
  • Add enviroments \yamlBegin and \yamlEnd, \begin{yaml}[...] ... \end{yaml}, and \startyaml[...] ... \stopyaml that will be an equivalent of \begingroup \yamlSetup{jekyllData, expectJekyllData, ensureJekyllData} \markdownBegin ... \markdownEnd, \begin{markdown}[jekyllData, expectJekyllData, ensureJekyllData, ...] ... \end{markdown}, and \startmarkdown[jekyll_data, expect_jekyll_data, ensure_jekyll_data, ...] ... \stopmarkdown.
  • Use this new feature in markdown.dtx and in the example documents.
  • Update CHANGES.md.
@Witiko Witiko added lua Related to the Lua interface and implementation latex Related to the LaTeX interface and implementation syntax extension Related to syntax extensions and dialects of markdown yaml Related to the tinyyaml library. labels Jun 18, 2024
@Witiko Witiko modified the milestones: 3.7.0, 3.8.0 Jun 18, 2024
@Witiko Witiko modified the milestones: 3.7.0, 3.8.0 Jul 1, 2024
@Witiko Witiko mentioned this issue Aug 5, 2024
3 tasks
@Witiko Witiko modified the milestones: 3.7.0, 3.7.1, 3.8.0 Aug 5, 2024
@Witiko Witiko added plaintex Related to the plain TeX interface and implementation context Related to the ConTeXt interface and implementation lua Related to the Lua interface and implementation and removed syntax extension Related to syntax extensions and dialects of markdown lua Related to the Lua interface and implementation labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context Related to the ConTeXt interface and implementation latex Related to the LaTeX interface and implementation lua Related to the Lua interface and implementation plaintex Related to the plain TeX interface and implementation yaml Related to the tinyyaml library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant