-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom type support #2
Comments
+1, I think Otherwise, can you think of a good way to extend this through Duo's API? |
Well, I had something other than HTML in mind, namely that I haven't come up with a gameplan over in duo-land yet, but perhaps something like: Duo(root)
.type("assets", require("duo-assets"))
.entry("client.assets", "assets"); |
hm, so basically this would walk What about using Otherwise if we covered |
Could you include an example of Including static HTML support is necessary, but it won't cover everything. Specifically, it breaks down when you're considering any template library, especially non-HTML-ish ones like jade. (especially if there are files included via dynamic attributes) Duo can't possibly predict all of these scenarios, nor should it, which is why configurability should be reached for. |
So the way I see it going down is all the high-level languages will be compiled first. In the same way that
|
For the includes stuff. This won't work yet, but i think it'd be easy to fix:
We're basically injecting information directly into the duo.json with include. Then we have something at the end run through the |
I'm really talking about server-side templates here, which don't need to be processed by duo or sent to the client. (besides, if they are generated per-user with database info, that limits what duo can pick up anyways) However, the assets that these templates reference need to make it into the That being said, since these assets don't make sense to be referenced in my JS/CSS entry files, duo needs a way to be informed about them. For consistency, I thought a new/custom entry type made sense. I get that this new entry file type is basically a manifest. (which people seem to be knee-jerking against right now) But, if I'm going to be ditching the As far as your includes example, where exactly is |
Yah same page. So I'm wondering if it makes sense to run through the build so all our assets get symlinked from our jade file, but throw away the output (the built html).
Good point. My confusion is more like... what is var src = yield duo(root)
.entry('some-image-asset.png')
.run();
This would be from the |
If duo can be fed assets like that, if it could also support either globs or copying entire folders, that would be enough for me. (easy enough to put that in a makefile) $ duo pages/home/public/
# copies to build/pages/home/public/
$ duo pages/home/images/*.png
# copies all the png files to build/pages/home/images/ Is that what you are thinking? |
Okay, we'll need a few tests around this, but I think all that is required is removing this line: |
Yah, I think that would be pretty cool actually |
Could even run those kinds of things through plugins too. That could lead to using duo as a complete asset pipeline, applying compression on images, minification, etc! (awesome) I'm guessing up-front the CLI would convert globs and folders into lists of files. |
It would be awesome if this lib would allow custom types to be registered from the outside, this would be a great first-step to solving duojs/duo#171
The text was updated successfully, but these errors were encountered: