Closed talyguryn closed 3 years ago
I think the type
is not useful.
That's for a homogeneous list:
{
"type" : "list",
"data" : {
"style" : "unordered",
"items" : [
{
"content": "Just a text item",
"items": []
},
{
"content": "The second text item",
"items": [
{
"content": "Nested item" ,
"items": []
}
]
}
]
}
}
And that's for an inhomogeneous list:
{
"type" : "list",
"data" : {
"style" : "unordered",
"items" : [
{
"content": "Just a text item",
"items": []
},
{
"content": "The second text item",
"style" : "ordered",
"items": [
{
"content": "Nested item" ,
"items": []
}
]
}
]
}
}
But I don't like that the style
is not a required field in this case.
Just a side note as it's not explicitly specified in Taly's design. The strings should also allow for HTML formatting.
@alexanderjulmer yeah, is is not a problem. you'll be able to allow html tags there
{ "content": "Just a text item", "items": [] }
why is it a good idea to store items and content in each block?
because list might be like this:
- item content-1
-- subitem content-1
-- subitem content-2
-- subitem content-3
- item content-2
-- subitem content-1
hm. does a parent item should exist for each sublist?
I think yes, otherwise it will look like a sequence of sublists.
it looks almost the same as for
list
tool, but all elements now are objects. strings has type "string", nested lists has type "list" (a recursion). this way you can use any nesting level as you need.