JordyPouw / michelangelo

kss-node living styleguide theme.
http://jordypouw.github.io/michelangelo/
MIT License
52 stars 22 forks source link

Twig support? #3

Open ydmitry opened 6 years ago

ydmitry commented 6 years ago

How can I enable twig templates markup using this KSS theme?

When I write: // Markup: example.twig ...it writes file name as is "example.twig"

JordyPouw commented 6 years ago

@ydmitry This is just a theme on top of kss-node. This is what their docs says:

Instead of using inline HTML markup, you could point at a separate file that contains your HTML. kss-node supports either a plain .html file or a Handlebars .hbs file. The kss-node generator will search for the markup file in any of the --source folders.

You can find that here: github.com/kss-node/kss/blob/spec/SPEC.md.

ydmitry commented 6 years ago

Do you mean I need to generate my examples from twig to HTML separately from KSS and use Markup: compiled-example.html ?

KSS node repository contains builder that can support twig: https://github.com/kss-node/kss-node/tree/master/builder/twig , but as I see index.* file of the builder should be written in twig and builder.js should inherit KssBuilderBaseTwig... Maybe there is a possibility to add twig builder to this theme?

JordyPouw commented 6 years ago

@ydmitry I understand. Currently in the kss-config.json we reference to "node_modules/michelangelo/kss_styleguide/custom-template/" with the builder setting, which is just the handlebars template. So creating multiple custom templates is what I think that should happen, something like this:

And then it should be possible to reference with the builder setting to the custom theme you want.

Sad news is that I currently don't have the time. But good idea to add later on. For now you can fork this repo and try it yourself if you need it now. I think if you write the index template with the twig syntax and replace the handlebars builder with the twig builder it would work.

dawidk92 commented 6 years ago

+1