Comments (6)
Sure, no worries.
For reference if you want to see what the changes would look like check here:
evan-gordon@b43a502
Fyi, this is the .0.
index implementation.
Forgive my erlang if it's not very good, I use Elixir typically.
from bbmustache.
Yeah i was aware of the support for assoc lists, and i thought of adding a flag for possibly enabling this feature as it's something i have to support.
Thanks for the patch i appreciate it! Though I'm sad to hear this won't be officcially supported.
I'll close the ticket then.
from bbmustache.
Hi, @evan-gordon
Can you tell me some libraries that support this syntax?
from bbmustache.
Sure!
It seems like mustache JS does:
janl/mustache.js#158
This seems to be a popular stackoverflow issue on the topic:
https://stackoverflow.com/questions/11147373/only-show-the-first-item-in-list-using-mustache/17950970#17950970
they suggest that handlebars.js supports the .[0].
synatax.
It looks like mustache.java supports it, but as an extension (not too sure what that means)
spullara/mustache.java#68
Most libraries (and the mustache spec) don't seem to document it though so it's hard to find more information than this.
from bbmustache.
Thank you for the information.
I will check and decide, so please wait for a few days. 🙇
from bbmustache.
mustache/mustache#222 (comment)
As far as I looked into it, as Ricardo said in this comment, I think that this behavior depends on the implementation of javascript.
- I am negative about adding syntax, because it possible syntax collision in the future.
- Some libraries have similar issues, but many of them are not solved.
- mustache/mustache: mustache/mustache#222
- defunkt/pystache: defunkt/pystache#196
- groue/GRMustache.swift: groue/GRMustache.swift#2
- It currently supports assoc list, so it is difficult to prioritize array and assoc list.
- If data is
[{"a", [{"0", "value"}]}]
, it is difficult to determine whethera.0
refers to"value"
or{"0", "value"}
.
- If data is
For these reasons, I will avoid official support.
FYI:
I put a patch I wrote, because I am worry about the performance waste of your implementation.
https://gist.github.com/soranoba/2d0c53b3c293beb011f5a2fcbe961648
from bbmustache.
Related Issues (20)
- Allow disabling of html escaping HOT 5
- Tag lookup doesn't descend the context stack HOT 3
- Escaping overlay vars (mustache variables) inside template files HOT 2
- Bug? intra-tag whitespace not rendering HOT 1
- Exception on missing key HOT 5
- Crash under certain conditions HOT 1
- Fix documentation link on Hexpm HOT 3
- Wrong filename for missing include errors HOT 5
- Incompatible typespecs HOT 4
- Rendering a template always accesses file on disk HOT 2
- Adding custom serialization functions to bbmustache. HOT 5
- Use a fun as Data HOT 4
- Wrong parsing when closing tag is on separate line HOT 2
- Feature request: Allow getting partials from other sources HOT 3
- Run bbmustache from command line HOT 4
- Problems loading partials on Elixir project HOT 2
- Unicode support in value fetching. HOT 1
- Variable test not matching spec HOT 4
- Anyway to skip over unclosed tags? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bbmustache.