Giter Site home page Giter Site logo

Non-mustache delimiters? about svelte HOT 7 CLOSED

sveltejs avatar sveltejs commented on September 27, 2024
Non-mustache delimiters?

from svelte.

Comments (7)

mrmartineau avatar mrmartineau commented on September 27, 2024 2

In Ractive, you allow people to change the delimeters, is it not possible in Svelte too?

If the curly braces were to be changed, my preference would be to use a similarly easy to type character like the first two options below. Presumably the chosen delimiter would need to not be used in any other way so there are no chances of conflicts.

<< hello >>

[[ hello ]]

<% hello %>

from svelte.

findborg avatar findborg commented on September 27, 2024 1

FYI Vue uses {{ for binding }} and {{{ for html blobs }}}
I think many people are worried about having conflicts with php style templating using {{....}}.

from svelte.

AfraidKnot avatar AfraidKnot commented on September 27, 2024 1

My confusion was just from using the term "Mustaches" to refer to the braces. Once I realized they were delimiters and didn't refer to the template library of the same name then it became clear. Perhaps just a documentation update is all that is needed to begin with. There are other good points here so I hope the discussion keeps going.

from svelte.

Rich-Harris avatar Rich-Harris commented on September 27, 2024 1

I've just updated the docs to make the relationship to Mustache (i.e., none) more obvious, so I'll close this as it's definitely the lowest friction solution to the problem.

@mrmartineau yep, we could add an option to control delimiters. For simplicity's sake I'm going to file that under YAGNI but it's something we could revisit in future.

from svelte.

maraisr avatar maraisr commented on September 27, 2024

what about $( starting and a ) ending?

h1 $(hello)
<h1>$(hello)</h1>

from svelte.

Ryuno-Ki avatar Ryuno-Ki commented on September 27, 2024

We had trouble with mixing Django templating interpolation ({{ … }}) with AngularJS, so we changed the latter one's to {$ … $}. (Don't ask about why we were mixing in the first place).

from svelte.

euvl avatar euvl commented on September 27, 2024

It might be reasonable just pointing out in README that it does not use proper Mustache, without
changing anything.

from svelte.

Related Issues (20)

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.