Code Monkey home page Code Monkey logo

Comments (5)

drkibitz avatar drkibitz commented on May 18, 2024

Thanks a lot for the feedback, the includes is definitely a nice addition, and honestly, partials were an afterthought for me, definitely needs work :/ Will hopefully get something in there more flexible and intuitive.

As for a default delimiter name, would love any suggestions. I went with {build{ because 1. I didn't have time to think about it too long, and 2. it needed to be different than the doT default.

Actually, since it is specific to language comment formats maybe something as simple as:

<!--{=foo}-->
/*{=foo}*/
#{=foo}#

I can't think of any reason these would collide with post built templates. I think the differentiation is pretty clear.

One more suggestion to myself, was to add a configuration that can be loaded from the cwd, or passed as a parameter. This way many more advanced augmentations will be allowed such as custom types, changing default types, and of course predefining any number of defs, vars, and partials.

Thanks again!

from node-samson.

drkibitz avatar drkibitz commented on May 18, 2024

Ok, so the first thing first was to shorten the default delimiters, which I went with my previous suggestion to myself.
2nd - Thing on my priority list is to simplify def object passage.
3rd - Allow for a custom module argument containing all script options, and default def object (containing partials, templates).
4th - Have a separate build preprocess that actually compiles templates into multiple modules, or one big concatenated module, with optional namespaces.

from node-samson.

drkibitz avatar drkibitz commented on May 18, 2024

I just realized #{var}# is incompatible with regular expressions in some languages, namely Ruby.

I need a better delimiter for either just Ruby, or in general. I'm still skeptical in using #{{var}}# because I am worried it will conflict with runtime templates using doT default delimiters.

Any suggestions here?

from node-samson.

drkibitz avatar drkibitz commented on May 18, 2024

I guess the only way to see if #{{var}}# will conflict with anything is to try it ;)

from node-samson.

olado avatar olado commented on May 18, 2024

About 4th point - just to make sure we are on the same page - given a template (that may use sub-templates) the output would be a JavaScript module that can be included in projects.
#{{ would conflict with default evaluation {{ I guess. What about (| and |)?

from node-samson.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.