Closed lolmaus closed 10 years ago
Okay, i understood why styleblocks are not interpreted: their code should appear as plain text, not as HTML interpreted by the browser.
But this fact does not remove the necessity to reuse existing partials to generate styleblocks. Can you think of something?
Hi, and thanks!
Yeah, this looks like a must-have feature: rendering partials with different engines and such in the styleblocks. I would probably like to have this in my styleguides some day, too.
I'm currently busy at work preparing for a startup event here in Finland. So, this and the next week are pretty busy... But I will do my best to find some time for this :) Are you in a hurry? Hehe
I'm still struggling to make middleman-kss work.
When i do <%= styleblock 'main_menu' %>
, it works fine.
But when i do <%= styleblock 'main_menu', section: '1.1' %>
, it produces this error: http://jsbin.com/eLAZilO/1/?html,output
middleman-styleguide-template's project structure does not suit me at all, so i tried to make middleman-kss work on my project structure by following its readme.
Here's my project: https://github.com/lolmaus/middleman-kss-sandbox Can you please tell me what's wrong there?
Ok, let's see...
Ah, yes. middleman-kss
is not compatible with Middleman 3.2.0, sorry. I downgraded your project to 3.0.12 and it worked :) When I get the time, I will make middleman-kss
run with Middleman 3.2.0. But not right now, sorry.
Oh my god, it works!
Thank you for support, Darep.
I'm sorry for hijacking this issue. Let's leave it open for it's main topic: implementing proper parsing of styleblocks.
I'll update the initial post and also create tickets for other issues.
PS Good luck at your event!
No problem :) And hey, thanks to you, too! I now got fresh motivation to push this project forward
Seems to be working now! For me atleast :)
:hammer:
It is common to have a Middleman partial for every module that is to be documented with KSS. The middleman-kss gem does not allow including partials into styleblocks.
E. g.
source/styleblocks/_main_menu.html.erb
:Resulting style guide's HTML:
It seems like styleblocks aren't processed at all. This problem leads to severe duplication of code and results in extra dreary work.
Also, it should be possible to write styleblocks with any of the template engines that Middleman supports.
TL/DR