Skip to content

Pluggable asset pipeline #34

@raqbit

Description

@raqbit

Is your feature request related to a problem? Please describe.

There are use-cases where source assets should be transformed before being output, like images that should be resized before adding them to the final document, or transforming completely new source types like AsciiDoc or perhaps even ODT & MS Word documents to HTML.

Describe the solution you'd like

A way to configure transforming pipelines for assets (and pages), which should be very flexible. Perhaps we could make our existing liquid and markdown renderers use this same transformer pipelineing system and make docmaker more generic and pluggable this way.

Adding this pipeline system would be a major overhaul of the way docmaker works, but I think it could be a cool & very powerful addition.

Examples

(Syntax should be yaml based instead of this custom string syntax, but this is just for showcasing the idea)

"*.md": "liquid.parse(data) | markdown.toHtml()"
"*.scss": "liquid.parse(data) | sass.toCss()" 
"*.txt": "liquid.parse(data) | asciidoc.toHtml()"
"*.png": "png.compress() | png.resize()"
Ideas
  • In order to make the basic use of docmaker simple, we should probably define some kind of "default (pipeline) config" which would define a default pipeline that does exactly the same rendering we do now (liquid renderer first, then markdown).
T.B.D.
  • Config format for defining pipelines
  • Format for extending default config and other custom configs
  • Keeping it hidden/simple for the people which just want default behavior
  • Handling text transformers vs binary transformers (like word documents)
  • Registering custom transformers to docmaker?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions