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

Feature: Add a directive system #23

Open
enderger opened this issue Jun 22, 2021 · 0 comments
Open

Feature: Add a directive system #23

enderger opened this issue Jun 22, 2021 · 0 comments

Comments

@enderger
Copy link
Contributor

enderger commented Jun 22, 2021

Adding directives

Currently, LMT provides a great way to weave code from most flavors of Markdown. However, the lack of a directive system makes it dificult to provide flexibility. I propose a system of directives, which can be used for slight alterations of the program's behavior.

Syntax

I propose that directives take the following syntax, which retains compatibility with most forms of Markdown:

<!--@<name> <paramaters>-->

This syntax uses HTML comments to hide these directives in the output, while still remaining distinct from other comments

Suggested Directives

A few directives sorely missing are:

  • @namespace <name>, which causes everything up to the next namespace directive to be handled separately. This provides a concrete mechanism for avoiding accidentally overwriting code blocks.
  • @defaultAppend <bool>, which determines whether to append by default (see Consider making += the default #14).
  • @requireUndefined <name>, which requires that a macro is not defined outside of this file (again, preventing collisions).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant