Skip to content

Support bulk and partial redefinitions in the \markdownSetup plain TeX command #232

@Witiko

Description

@Witiko

Discussed in #121

Originally posted by Witiko March 5, 2022
At the moment, the \markdownSetup LaTeX command allows the redefinition of individual renderers and renderer prototypes. This has several shortcomings:

It makes sense to consider these shortcomings together rather than in isolation. For example, redefining all six levels of headings to behave the same is seldom useful, but prepending or appending the same code to all six levels of headings or all ordered, unordered, and definition lists is a common pattern.

Here are some possible desiderata for a syntax extension to \markdownSetup:

  1. Backwards compatibility: Whatever is now valid in \markdownSetup should stay valid and keep its current meaning.
  2. Bulk redefinitions: Allow several renderers or renderer prototypes to be redefined in bulk.
    • Enumeration: Allow the explicit specification of several renderers or renderer prototypes to be redefined in bulk.
    • Wildcards: Allow the implicit specification of several renderers or renderer prototypes to be redefined in bulk.
      Requires Add reflection to the TeX implementation #119.
  3. Partial redefinitions: Instead of full redefinitions, allow the partial redefinitions of renderers and renderer prototypes.
    • Prepending and appending: Instead of replacement, the code would be prepended or appended to the previous definition.
    • Patching: Rather than replacing all of the previous definition, only a part of it could be replaced.
    • Matching: Rather than replacing the previous definition, the previous definition could be arbitrarily reordered and interleaved with code.

This thread will list some of the ideas for the syntax extensions and outline which desiderata they satisfy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestplaintexRelated to the plain TeX interface and implementationquality of lifeRelated to quality-of-life improvements to the interface

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions