Skip to content

Allow customizing at the point of inclusion #545

Description

@damithc

Suggestied feature: the following code will include foo.md as per normal but will replace all spans/divs with id title in foo.md with New Title and level with 2:

<include src=”foo.md”>
  <span id=”title”>New Title</span>
  <span id=”level”>2</span>
</include>

foo.md:

## <span id="title">Dummy Title</span>

This is a level <span id="level"/> topic.

The level of this topic is <span id="level"/>.

Rationale: this will greatly increase code reuse as it allows authors to write templates and reuse them while customizing them at the point of reuse (somewhat similar to Jekyll tempates https://jekyllrb.com/docs/layouts/).

Points to consider: What about variations that cannot be captured in spans e.g., html attribute values? For example, if we want to use the following code fragment as a template but we want the background color to be confirguragle at the point of reuse

   <box background-color="white" border-color="#cccccc"><md><span id="content"/></md></box>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions