Toml: some templating

Created on 24 Feb 2013  路  1Comment  路  Source: toml-lang/toml

I'm sure this will get shot down as adding too much complexity but hear me out as this was done in Grunt and makes Gruntfiles that much more awesome and readable. It's like SASS/LESS for config.

Format: <%= parent.child %>
Inserts: The value(s) with some intelligence as to not break anything.

[database]
name = "buckeye"
server = "192.168.1.1"
ports = [ "8001", "8001", "8002" ]
connection_max = 5000
enabled = true

[database.qa]
name = "<%= database.name%> QA"
server = "<%= database.server %>"
ports = [ <%= database.ports %>, "80003", "80004" ]
connection_max = <%= database.connection_max %>
enabled = <%= database.enabled %>

[database.stage]
<%= database.qa %>
name = "<%= database.name%> Stage"
enabled = false

>All comments

This does not seem more readable to me, and increases the difficulty of writing an implementation by a significant margin. You could always use your favorite templating language to do this already and generate the resulting file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Suhoy95 picture Suhoy95  路  4Comments

ChristianSi picture ChristianSi  路  4Comments

hukkin picture hukkin  路  4Comments

mqudsi picture mqudsi  路  3Comments

ChristianSi picture ChristianSi  路  3Comments