Skip to content

feat: add plugin system for processing instructions #28

@Tygo-van-den-Hurk

Description

@Tygo-van-den-Hurk

What do you want to request?

Since the registry is already its own thing it would be easy to reuse to make another registry for the processing instructions.

Note

This change would probably requires reworking the parsing logic, but I was already planning on doing that anyways.

Examples of New Instructions

We could add different types of processing instructions as well:

Processing instructions that dynamically add text:

Hello, my username is: <?eval process.env.USER ?? process.env.USERNAME ?>

Importing files

<?include "path/to/some/other/file.xml" ?>

Modifying parsing state

<?markup "Plain" ?>
<?path "custom-prefix:" ?>

Backwards Compatibility

it would not be a breaking change. You could add a Slyde processing instruction that takes in attribute pairs, and then you would have full backwards compatibility.

<?slyde markup="plain" engine="1.0.0" ?>

I assert this issue is relevant

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Labels

featNew feature or request for one

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions