UNPKG

5.02 kBHTMLView Raw
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8">
5<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
6<title>JSON data structure spec</title>
7<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
8
9 <link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
10 <link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
11</head>
12<body>
13<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
14 style="width:0;height:0;position:absolute;overflow:hidden;">
15 <defs>
16 <symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
17 <path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
18 </symbol>
19 <symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
20 <path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
21 </symbol>
22 <symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
23 <path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
24 </symbol>
25 <symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
26 <path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
27 </symbol>
28 </defs>
29</svg>
30<nav id="toc">
31 <div id="toc-body" class="toc-body"></div>
32</nav>
33<article id="markdown">
34 <nav id="markdown-header" class="markdown-header">
35 <svg class="si" id="toggle-toc" width="24" height="24">
36 <use xlink:href="#si-zfinder-collapse-left"></use>
37 </svg>
38 <svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
39 <use xlink:href="#si-zfinder-fullscreen"></use>
40 </svg>
41 </nav>
42 <div id="markdown-body" class="markdown-body"><h1>JSON data structure spec</h1>
43<h2>example</h2>
44<ul>
45<li><a href="../spec/fixtures/bookstore.json">bookstore.json</a></li>
46<li><a href="../spec/fixtures/cd-catalog.json">cd-catalog.json</a></li>
47<li><a href="../spec/fixtures/large.json">large.json</a></li>
48<li><a href="../spec/fixtures/menu.json">menu.json</a></li>
49<li><a href="../spec/fixtures/mmap-content.json">mmap-content.json</a></li>
50<li><a href="../spec/fixtures/note.json">note.json</a></li>
51<li><a href="../spec/fixtures/svg.json">svg.json</a></li>
52</ul>
53<h2>nodes</h2>
54<h3>Document</h3>
55<p>Root node of the whole document.</p>
56<p>structure:</p>
57<pre><code class="language-javascript">{
58 <span class="hljs-attr">type</span>: <span class="hljs-string">'Document'</span>,
59 <span class="hljs-attr">children</span>: [<span class="hljs-comment">/* */</span>],
60}
61</code></pre>
62<h3>ProcessingInstruction</h3>
63<p>ProcessingInstruction node (like <code>&lt;?xml-stylesheet type=&quot;text/css&quot; href=&quot;./bootstore.css&quot;?&gt;</code>).</p>
64<p>structure:</p>
65<pre><code class="language-javascript">{
66 <span class="hljs-string">"type"</span>: <span class="hljs-string">"ProcessingInstruction"</span>,
67 <span class="hljs-string">"tag"</span>: <span class="hljs-string">"xml-stylesheet"</span>,
68 <span class="hljs-string">"data"</span>: <span class="hljs-string">"type=\"text/css\" href=\"./bootstore.css\""</span>
69}
70</code></pre>
71<h3>Comment</h3>
72<p>Comment node (like <code>&lt;!-- some comments --&gt;</code>).</p>
73<p>structure:</p>
74<pre><code class="language-javascript">{
75 <span class="hljs-string">"type"</span>: <span class="hljs-string">"Comment"</span>,
76 <span class="hljs-string">"data"</span>: <span class="hljs-string">" some comments "</span>
77}
78</code></pre>
79<h3>Element</h3>
80<p>Normal Element node (like <code>&lt;book category=&quot;COOKING&quot;&gt;&lt;/book&gt;</code>).</p>
81<p>structure:</p>
82<pre><code class="language-javascript">{
83 <span class="hljs-string">"type"</span>: <span class="hljs-string">"Element"</span>,
84 <span class="hljs-string">"tag"</span>: <span class="hljs-string">"bookstore"</span>,
85 <span class="hljs-string">"children"</span>: [<span class="hljs-comment">/* */</span>]
86}
87</code></pre>
88<h3>TextNode</h3>
89<p>TextNode (like <code>Everyday Italian</code>).</p>
90<p>structure:</p>
91<pre><code class="language-javascript">{
92 <span class="hljs-string">"type"</span>: <span class="hljs-string">"TextNode"</span>,
93 <span class="hljs-string">"text"</span>: <span class="hljs-string">"Everyday Italian"</span>
94}
95</code></pre>
96<h3>DocumentType</h3>
97<h3>DocumentFragment</h3>
98<h3>CDATASection</h3>
99</div>
100</article>
101<div id="loading">
102 <div class="sk-double-bounce">
103 <div class="sk-child sk-double-bounce1"></div>
104 <div class="sk-child sk-double-bounce2"></div>
105 </div>
106</div>
107
108<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
109<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
110<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
111</body>
112</html>