Open manland opened 9 years ago
This pull-request wants to simplify the definitions of aliases.
Here at ITK we use intensively aliases, with time our aliases.properties grownth exponentially. Lots of patterns are similare but with little changes.
So we have implemented a json parser, and we have added variable feature.
Specifications :
yoga_aliases
ressources
$
@
Examples (from tests) :
from
$child=test,child(value)
to
{ "$child": [ "test", { "child": ["value"] } ] }
Or from
$children=test,child(value,value2),child2(value3,child3(*))
{ "$children": [ "test", { "child" : [ "value", "value2" ] }, { "child2": [ "value3", { "child3": ["*"] } ] } ] }
And with variables :
{ "@variable": [ "test", "test2" ], "$variable": [ "testvar", { "childvar": [ "child", "@variable" ] } ] }
Could be represented as :
$variable=testvar,childvar(child,test,test2)
More complex variables can be used.
The JSON files must be in yoga_aliases directory in the ressources directory.
It can contain all files you want, the name of file is not used, but it needs to finish by .json.
We use a file, for a view in our application, and each file contains all requests aliases for this view.
A variable can be defined in one file and used in an other one. And a file can contain only aliases or only variables, it's as you want.
To resume :
+1 Great addition
very interesting, hoping to see some life in this project!
+1, very interesting feature!
This pull-request wants to simplify the definitions of aliases.
Here at ITK we use intensively aliases, with time our aliases.properties grownth exponentially. Lots of patterns are similare but with little changes.
So we have implemented a json parser, and we have added variable feature.
Specifications :
yoga_aliases
directory inressources
directory contains the definitions in multiple files ending by json$
for aliase and@
for variableExamples (from tests) :
from
to
Or from
to
And with variables :
Could be represented as :
More complex variables can be used.
The JSON files must be in
yoga_aliases
directory in the ressources directory.It can contain all files you want, the name of file is not used, but it needs to finish by .json.
We use a file, for a view in our application, and each file contains all requests aliases for this view.
A variable can be defined in one file and used in an other one. And a file can contain only aliases or only variables, it's as you want.
To resume :