These are chat archives for jescalan/roots

25th
Aug 2015
Michael Kornblum
@michaelkornblum
Aug 25 2015 01:01
Hello all. I was doing a little work with gulp and roots in an attempt to integrate the two engines. The reason I did this was so I could enjoy some of the tools I use on a regular basis in gulp with roots. For now, it seems to be a viable temporary solution until additional plugins are created for the roots ecosystem. The results of the experiment can be found at https:github.com/michaelkornblum/juice-bar. Please feel free to let me know what you think.
Daniel Box
@dbox
Aug 25 2015 02:08
Wow. Will check it.
James Brooks
@brks
Aug 25 2015 09:18
I'm iterating over YAML files with roots-yaml and Jade 'each' iteration to import each item of my Portfolio. Can I get it to order by age or project status (online/offline)?
Dominic Monroe
@SevereOverfl0w
Aug 25 2015 09:49
@brks You might wanna include lodash as a local. And use it to sort the items where you want to
Dominic Monroe
@SevereOverfl0w
Aug 25 2015 10:29
This is close to being a feature required in roots core (ordering of views/assets), but doesn't seem to quite fit.. (only really needed for dynamic-content, roots-yaml, & similar)
James Brooks
@brks
Aug 25 2015 11:00
This message was deleted
Dominic Monroe
@SevereOverfl0w
Aug 25 2015 11:27
Maybe we need a point to define custom sorting rules of some kind.. as part of the project, as opposed to an extension.
Jeff Escalante
@jescalan
Aug 25 2015 14:04
@michaelkornblum awesome! great work. first solid external use of roots' js api that i've seen yet
@brks yeah you can just drop a sort function into jade
like @SevereOverfl0w said, you can also define it as a local for even more of a shortcut
Pranz
@Pranz
Aug 25 2015 15:29
@jenius okay with some fixes to my extension, my extension works alongside dynamic content, but not with it
@jenius after some dynamic content has been compiled, I want it to be passed through my extension
@jenius is that possible to do?
i.e on my dynamic content which has _content: false
Dominic Monroe
@SevereOverfl0w
Aug 25 2015 15:33
@Pranz Hmm... Essentially some kind of multipass compilation.
You might be able to name the files like...
Hmm.. actually, I'm not sure.
Pranz
@Pranz
Aug 25 2015 15:34
@SevereOverfl0w essentially, I want to pass everything that will be written to HTML into a function before it's actually written
@SevereOverfl0w but I don't know how to do that
Dominic Monroe
@SevereOverfl0w
Aug 25 2015 15:35
You may be able to listen for just .html files, what are you doing to the files exactly?
Pranz
@Pranz
Aug 25 2015 15:36
@SevereOverfl0w ctx.content = typeset(ctx.content)
Dominic Monroe
@SevereOverfl0w
Aug 25 2015 15:37
So, you have a few options then.
Essentially, you need a detection method.
One option may be to detect .html files, I'm not entirely sure on how multipass compilation works.
The other would be to name the file filename.typeset.jade, and detect the .typeset file extension.
and after the jade compilation, it would become typeset, and typeset outputs html.
But as jade outputs html, you may be able to listen for that... am I making sense?
Pranz
@Pranz
Aug 25 2015 15:41
@SevereOverfl0w I tried to listen for .html but it seems it doesn't work that way
no detection
but that multipass compilation thing, if it works, is probably the best
gonna try it out
Dominic Monroe
@SevereOverfl0w
Aug 25 2015 15:42
Odd. How annoying, @jenius can confirm whether that's expected behaviour.
For now, you can either add ".html" manually, before jade, or use your custom extension ".typeset"
Pranz
@Pranz
Aug 25 2015 15:52
"The only time extensions are modified is when one or more of a file's extensions match to an installed and supported compiler"
If i understand that right it seems I'm fucked
or
oh nvm
it seems to work
Dominic Monroe
@SevereOverfl0w
Aug 25 2015 15:56
Maybe that's why it doesn't flag through as html, because you don't actually want to use multipass.
You just want to process anything that is html, after it's been compiled.
You could change your detection function to just be.. f._contents.contains('<html>') as a poor man's html detector.
Pranz
@Pranz
Aug 25 2015 16:20
@SevereOverfl0w problem is, once something is detected as dynamic content, no other extensions will detect it
Dominic Monroe
@SevereOverfl0w
Aug 25 2015 16:22
How are they processed then @Pranz ?
I suppose it's not taken out of the view compilation
Just pulled out, and not given to any other categories. Got it.
I wonder why dynamic content would need to do an extract. @jenius will have to answer that one too.
I feel like it just stops extensions from working nicely with one another.
Pranz
@Pranz
Aug 25 2015 18:46
@SevereOverfl0w oh well now I did a really ugly fix but it works and only changes a few lines
@SevereOverfl0w configured the write hook of my local copy of the dynamic_content package :p