Skip to content

Basic extension system #55

@antonmeskildsen

Description

@antonmeskildsen

Courses should have a system for implementing extensions using WASM and the Extism framework. The end goal is to make Courses highly customizable without having to modify the source code or recompile the project. A side goal is to allow extension development in other languages that may be known by a wider audience.

The extension system should, at the very least, support adding custom AST transformers since this is the core of how Courses works. A consequence of this approach is that these transformers must be able to produce additional data that is somehow provided to the rendering engine in a manner that makes it usable from within templates. This can be implemented very simply (at first) by having each extension implement a full transformer. Later, this can be refined to extension points for individual node types, attributes, etc.

Another highly important area is template extensions, i.e. Tera filters, functions, and tests. Finally, extensions could also help customize the high-level build pipeline process by adding extension points for custom file generators, custom file post-processing (e.g. file bundling). However, this last point is not likely to be implemented in this first iteration.

Summary:

  • WASM extensions using Extism
  • Extension functionality for AST transformers and Tera elements.
  • Types and helpers defined in Rust for easy extension development.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions