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

Rework template-plugin and unify with snippet-plugin #452

Open
abeforgit opened this issue Jul 10, 2024 · 0 comments
Open

Rework template-plugin and unify with snippet-plugin #452

abeforgit opened this issue Jul 10, 2024 · 0 comments

Comments

@abeforgit
Copy link
Member

This issue is mainly a place to store my thoughts, this is a long-term goal that I don't want to put in Jira yet.

The template plugin carries a lot of history in its implementation. It used to act both as a full-document template selector and a "snippet" inserter. Throughout all the changes we've lost that second ability and rebuilt it as the snippet plugin.

There's already a lot of overlap between snippets and "full templates", given that snippets can contain other snippets. I think we can evolve towards a generic template manager plugin.

it needs to:

  • understand the concept of a "template", whatever that will look like by the time we start implementing this (in particular, the work regarding rdfa connections will be important here)
  • understand template (aka snippet) placeholders and their configuration
  • understand snippet nodes after insertion (replace, add, delete)
  • allow to select and change the "base template" -> this is nothing more than a set of templates that replace the entire content rather than insert into it
  • allow to "insert" a template -> this is like the pre-placeholder snippet behavior

This suggests a component split of the main search and select UI, a button that reacts on placeholder selection, an insert button, and "base template" button
The latter 3 would likely trigger the same search UI, but each with a different list of templates.

all of these modes should be configurable, and (at least part of) that config will likely have to be stored alongside the document.

The template plugin is also responsible for fetching snippets from a configured endpoint, just like the snippet plugin is now. We might make this configurable by taking in a callback argument, which we would then provide a default for, but that may be overkill and can be added later.

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