CodeKit2 icon indicating copy to clipboard operation
CodeKit2 copied to clipboard

Jade: including arbitrary files

Open chris-scheurle opened this issue 10 years ago • 5 comments

The Jade documentation states:

Including files that are not jade just includes the raw text.

but CodeKit does not recognize suchincludes. I also tried adding those files manually by dragging them onto the Imports/Exports panel or adding their extensions to the Generic Page Extensions in the Project Settings, but none of that works either. So, I don't get automatic recompiles, when any of the source files changes. :cry:

What I'd like to suggest: please either automatically recognizeincludes of files listet in the Generic Page Extensions setting or at least allow the user to drag arbitrary files onto the Imports/Exports panel of jade source files. In both cases: please allow image files to be used for that purpose as well (the way I see it, there is no risk of infinite loops or such, since a jade source file will never compile to an image file). Or (if you still deem this potentially harmful): consider a combination of the suggestions above: allow the user to manually drag image files and files listet in the Generic Page Extensions setting onto the Imports/Exports panel.

Oh, and just to proove there is a real world use case: currently, I am trying to includebase64ed files intodata-urls and all works fine, except for the missing automatic recompiles.

chris-scheurle avatar Nov 20 '15 17:11 chris-scheurle

Please post an example project with what you're trying to do.

The issue here is that CodeKit's linker (the thing that builds the tree of dependencies between files so that the app knows what to compile when a given file changes) does not consider EVERY file type when it sees an include in Jade. It looks for other Jade files. That's why adding the imported file types to the generic page extensions list does not work.

I need a sample to test with.

bdkjones avatar Nov 20 '15 17:11 bdkjones

It'd be cool to see things like js/css/svg/html/txt files supported. I can help setup a small test project if needed.

js/css/svg would be nice for inlining those into produced HTML, the later for items that may already be generated and would need to be converted to Jade otherwise (which I ran into in a past project when I was given html/plain-text partials to include in pages)

FWIW: I can help provide a small test project if needed.

subhaze avatar Nov 23 '15 20:11 subhaze

As @bdkjones said:

Please post an example project with what you're trying to do.

I hope this is what you wanted:

:paperclip: jade-includes.zip

chris-scheurle avatar Nov 23 '15 22:11 chris-scheurle

The part where I said

FWIW: I can help provide a small test project if needed.

Was, if You ( @chris-scheurle ) didn't have time to provided one... seems you did!... Thanks.

subhaze avatar Nov 23 '15 22:11 subhaze

Thanks guys. It will be a little bit before I can dig into this, but I will put it on my list.

bdkjones avatar Nov 24 '15 20:11 bdkjones