Open jondkinney opened 8 years ago
Hi @jondkinney,
For the initial release of Astrum we've focussed on just supporting HTML for component templates.
You can add ERD, HAML, or SLIM into the markup.html
file and it will get displayed in the code example, however the preview will not work as Astrum does not currently support these templating languages.
We've previously discussed adding support for a preview.html
file that would allow you to specify different markup for the code example and the component preview. This would allow you to use a tempting language in the code example, and then provide plain old HTML for the component preview.
Do you think that this approach would solve your issue?
@matt-west thanks for getting back to me and for all your work on Astrum! The situation you describe is a step in the right direction, I think, but my goal would be to have the component source code available to copy/paste in the templating language it's written in so that we wouldn't have to reverse engineer the HTML to SLIM, for example.
@jondkinney Apologies my explanation was not as clear as it could be. Adding a preview.html
file would allow you to display the template language version in the code example to copy and paste, and have the component preview with pure HTML. The example component structure would be.
description.md
- The component description.preview.html
- Pure HTML version of the component used for the component preview.markup.html
- The code snippet for the component.The preview.html
file could be optional, with Astrum falling back to using the markup.html
file if it's not present.
Aaah, gotcha. That's definitely a workable solution! I guess the main downside would be needing to specify the source code in both the templating language and pure HTML, so if something changes you'd have to update it in both places. But yea, definitely that would allow us to start using it now!
Cool. I've added this to the roadmap. https://github.com/NoDivide/astrum/wiki/Project-Roadmap
Ref #84
For instance, in a rails app, we'd use ERB, or HAML, or SLIM. I suppose we could just write using the templating language of our choice in the .html file? Not sure what implications that'd have for syntax highlighting though.