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