Closed adrienne closed 5 years ago
I'm not sure I like the idea of this. I think we'd be better off documenting how to extend the adapter, and keeping a slim core that is closer to the native Twig implementation.
It shouldn't be too hard to integrate the above with individual Fractal instances, we just need to document it.
@Chapabu - Okay, whatever works, but I can't figure out how to get it extended and I would definitely like to!
Created a PR to add this to docs, but I'll post this here in case anybody needs it:
const twigAdapter = require('@frctl/twig')();
const twigMarkdown = require('twig-markdown');
const instance = fractal.components.engine(twigAdapter);
// instance.twig refers to the twig.js instance
instance.twig.extend(twigMarkdown);
It's well-supported and it would be very helpful! https://github.com/ianbytchek/twig-js-markdown It uses the
marked
parser, which is already included by Fractal, so it should be pretty trivial.