<script src="https://cdn.jsdelivr.net/gh/HasanDelibas/[email protected]/dion.js"></script>
Dion.parse( string, DIRECTIVE="-", SEPERATOR="/" , ASSIGN="=")
Dion.define(object,['path','to'],value)
let object = {
path:{
to:{
value: "Hello World"
},
any:{},
other:{}
}
}
Dion.default( object, "path/_/value", "Hello World" )
console.log( object )
{
path:{
to:{
value: "Hello World"
},
any:{
value: "Hello World"
},
other:{
value: "Hello World"
}
}
}
- Every data starts with
-
character. - Use for access child item
/
character for path. - Use
=
for assing inline value.
.dion
- path/to/value=true
.json
{
"path": {
"to": {
"value": true
}
}
}
.dion
- string="Hello World!"
- number=15
- boolean=true
- text="Hello World!\nThis is a new line."
.json
{
"string": "Hello World!",
"number": 15,
"boolean": true,
"text": "Hello World!\nThis is a new line."
}
.dion
- files/0/name="main.py"
- files/0/data
import math
print( "math library loaded" )
# calc sin(30)
print( math.sin( math.radians(30) ) )
.json
{
"files": [
{
"name": "main.py",
"data": "import math\nprint( \"math library loaded\" )\n# calc sin(30)\nprint( math.sin( math.radians(30) ) )"
}
]
}
.dion
- path/to/"custom/path" = true
.json
{
"path": {
"to": {
"custom/path": true
}
}
}
.dion
- path/to/value
− This is a minus character
.json
{
"path": {
"to": {
"value": "- This is a minus character"
}
}
}
.dion
- path/to/value:
- name="Hasan"
- surname="Delibas"
# Rebase
- :
- foo="bar"
.json
{
"path": {
"to": {
"value": {
"name": "Hasan",
"surname": "Delibas"
}
}
},
"foo": "bar"
}