1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
[section {JSON notation of tables of contents}]
The JSON format used for tables of contents is a direct translation of
the [sectref {ToC serialization format}], mapping Tcl dictionaries as
JSON objects and Tcl lists as JSON arrays.
For example, the Tcl serialization
[example {
doctools::toc {
items {
{reference {
desc {DocTools - Tables of Contents}
id introduction.man
label doctools::toc::introduction
}}
{division {
id processing.man
items {
{reference {
desc {doctoc serialization utilities}
id structure.man
label doctools::toc::structure
}}
{reference {
desc {Parsing text in doctoc format}
id parse.man
label doctools::toc::parse
}}
}
label Processing
}}
}
label {Table of Contents}
title TOC
}
}]
is equivalent to the JSON string
[example {
{
"doctools::toc" : {
"items" : [{
"reference" : {
"desc" : "DocTools - Tables of Contents",
"id" : "introduction.man",
"label" : "doctools::toc::introduction"
}
},{
"division" : {
"id" : "processing.man",
"items" : [{
"reference" : {
"desc" : "doctoc serialization utilities",
"id" : "structure.man",
"label" : "doctools::toc::structure"
}
},{
"reference" : {
"desc" : "Parsing text in doctoc format",
"id" : "parse.man",
"label" : "doctools::toc::parse"
}
}],
"label" : "Processing"
}
}],
"label" : "Table of Contents",
"title" : "TOC"
}
}
}]
|