Open webketje opened 2 years ago
I've become member of the jstransformer's org and have updated the 2 jstransformers mentioned.
I still think providing a transformers
option has several advantages:
require('jstransformer-nunjucks')
-> explicit is better than implicitinputformat-to-jstransformer
obsolete, which does a dictionary - key lookup of rendering engines matching an ext. 3. Instead, the transformer's inputFormat properties can be used, this allows custom matching & custom transformersDisadvantages:
To be aligned with @metalsmith/in-place 5.x transform
option
Some of the JS transformers are severely outdated and due to the update mechanism (
jstransformer-boilerplate
->test-jstransformer
->jstransformer-*
) this is probably going to keep being an issue in the future.For example:
jstransformer-marked
usesmarked@0.3.9
while the latest version is4.0.7
(4 years ahead)jstransformer-handlebars
useshandlebars@4.0.1
while the latest version is4.7.7
(6 years ahead)Furthermore the
renderAsync
method used in layouts is not guaranteed to be present on all jstransformers.There are a few options:
peerDependencies
andpeerDependenciesMeta: optional
transformers: ['path/to/transformer.js', 'path/to/other/transformer.js
]` that will be added to the cache with the node_modules transformers, update the docs explaining how to create your own jstransformer.In favor of option 3