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

Pluggable asset pipeline #34

Open
raqbit opened this issue Sep 25, 2020 · 0 comments
Open

Pluggable asset pipeline #34

raqbit opened this issue Sep 25, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@raqbit
Copy link
Contributor

raqbit commented Sep 25, 2020

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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant