Skip to content

Support for syntax extensions #56

@FynnFreyer

Description

@FynnFreyer

Transclusion Syntax

There's often lively discussion on how to do transclusion syntax in markdown. This old discussion on the commonmark forum gives a decent overview.

A few popular ideas coming are:

  1. path/to/file.md Just pasting the URL (from iA Writer)
  2. ![description](path/to/file.md) Repurposing image syntax (from Obsidian)
  3. {{path/to/file.md}} Using double braces (from MultiMarkdown)
  4. {{#include path/to/file.md}} Double braces plus keyword (from mdBook, also see support mdbook include syntax #34)

Supporting a plethora of different syntaxes in this repo is probably not maintainable, and would complicate development. An alternative would be to specify an API for defining include syntaxes and then to allow users to extend syntax support via that API.

Status Quo

Right now pandoc-include only supports the !include`<args>` path/to/file syntax, which has the advantage, that it allows for passing arguments to the directive, like you would in reST and that it's unambiguous. But it is a bit verbose and doesn't offer graceful degradation in other contexts.

The maintainer is open to a PR on this (see discussion in #54)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions