Skip to content

Commit 072eb91

Browse files
committed
Update
1 parent 9196f8d commit 072eb91

File tree

2 files changed

+47
-22
lines changed

2 files changed

+47
-22
lines changed

_docpress.json

+10
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
"title": "Parts",
7777
"depth": 2,
7878
"id": "parts"
79+
},
80+
{
81+
"title": "Table of Contents",
82+
"depth": 2,
83+
"id": "table-of-contents"
7984
}
8085
]
8186
}
@@ -152,6 +157,11 @@
152157
"title": "Parts",
153158
"depth": 2,
154159
"id": "parts"
160+
},
161+
{
162+
"title": "Table of Contents",
163+
"depth": 2,
164+
"id": "table-of-contents"
155165
}
156166
]
157167
}

schema.html

+37-22
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,29 @@
3030
</code></pre>
3131
<h2 id="sample-output">Sample output</h2>
3232
<p>You&#x2019;ll get this JSON output:</p>
33-
<pre><code class="lang-json">{ &quot;<span class="hljs-attr">files</span>&quot;:
34-
{ &quot;<span class="hljs-attr">components.md</span>&quot;:
35-
{ &quot;<span class="hljs-attr">title</span>&quot;: <span class="pl-s">&quot;Components&quot;</span>,
36-
&quot;<span class="hljs-attr">name</span>&quot;: <span class="pl-s">&quot;components.md&quot;</span>,
37-
&quot;<span class="hljs-attr">sections</span>&quot;:
38-
{ &quot;<span class="hljs-attr">components</span>&quot;:
39-
{ &quot;<span class="hljs-attr">id</span>&quot;: <span class="pl-s">&quot;components&quot;</span>,
40-
&quot;<span class="hljs-attr">title</span>&quot;: <span class="pl-s">&quot;Components&quot;</span>,
41-
&quot;<span class="hljs-attr">depth</span>&quot;: <span class="hljs-number">1</span> },
42-
&quot;<span class="hljs-attr">top-header</span>&quot;:
43-
{ &quot;<span class="hljs-attr">id</span>&quot;: <span class="pl-s">&quot;top-header&quot;</span>,
44-
&quot;<span class="hljs-attr">title</span>&quot;: <span class="pl-s">&quot;Top header&quot;</span>,
45-
&quot;<span class="hljs-attr">depth</span>&quot;: <span class="hljs-number">3</span>,
46-
&quot;<span class="hljs-attr">parts</span>&quot;:
47-
{ &quot;<span class="hljs-attr">s1</span>&quot;:
48-
{ &quot;<span class="hljs-attr">type</span>&quot;: <span class="pl-s">&quot;text&quot;</span>,
49-
&quot;<span class="hljs-attr">language</span>&quot;: <span class="pl-s">&quot;html&quot;</span>,
50-
&quot;<span class="hljs-attr">content</span>&quot;: <span class="pl-s">&quot;&lt;p&gt;This is the main header partial.&lt;/p&gt;&quot;</span> },
51-
&quot;<span class="hljs-attr">s2</span>&quot;:
52-
{ &quot;<span class="hljs-attr">type</span>&quot;: <span class="pl-s">&quot;example&quot;</span>,
53-
&quot;<span class="hljs-attr">language</span>&quot;: <span class="pl-s">&quot;haml&quot;</span>,
54-
&quot;<span class="hljs-attr">content</span>&quot;: <span class="pl-s">&quot;= render &apos;components/top_header&apos;&quot;</span> } } } } } } }
33+
<pre><code class="lang-json">{ &quot;files&quot;:
34+
{ &quot;components.md&quot;:
35+
{ &quot;title&quot;: &quot;Components&quot;,
36+
&quot;name&quot;: &quot;components.md&quot;,
37+
&quot;sections&quot;:
38+
{ &quot;components&quot;:
39+
{ &quot;id&quot;: &quot;components&quot;,
40+
&quot;title&quot;: &quot;Components&quot;,
41+
&quot;depth&quot;: 1 },
42+
&quot;top-header&quot;:
43+
{ &quot;id&quot;: &quot;top-header&quot;,
44+
&quot;title&quot;: &quot;Top header&quot;,
45+
&quot;depth&quot;: 3,
46+
&quot;parts&quot;:
47+
{ &quot;s1&quot;:
48+
{ &quot;type&quot;: &quot;text&quot;,
49+
&quot;language&quot;: &quot;html&quot;,
50+
&quot;content&quot;: &quot;&lt;p&gt;This is the main header partial.&lt;/p&gt;&quot; },
51+
&quot;s2&quot;:
52+
{ &quot;type&quot;: &quot;example&quot;,
53+
&quot;language&quot;: &quot;haml&quot;,
54+
&quot;content&quot;: &quot;= render &apos;components/top_header&apos;&quot; } } } } } },
55+
&quot;toc&quot;: { ... } }
5556
</code></pre>
5657
<p>It breaks down like so:</p>
5758
<ul>
@@ -93,6 +94,18 @@ <h2 id="parts">Parts</h2>
9394
<li><code>content</code></li>
9495
<li><code>source</code> - If it was transpiled, the original source will be stored here.</li>
9596
</ul>
97+
<h2 id="table-of-contents">Table of Contents</h2>
98+
<p>A table of contents will be generated when one of the files is called <code>README.md</code>. It looks like this:</p>
99+
<pre><code class="lang-js">{ sections:
100+
[ { title: <span class="pl-s">&apos;Home&apos;</span>,
101+
source: <span class="pl-s">&apos;index.md&apos;</span>,
102+
url: <span class="pl-s">&apos;index.html&apos;</span> },
103+
{ title: <span class="pl-s">&apos;Document&apos;</span>,
104+
sections:
105+
[ { title: <span class="pl-s">&apos;Index&apos;</span>,
106+
source: <span class="pl-s">&apos;index.md&apos;</span>,
107+
url: <span class="pl-s">&apos;index.html&apos;</span> } ] } ] }
108+
</code></pre>
96109

97110
</div>
98111
<div class="footer-nav">
@@ -118,6 +131,8 @@ <h2 id="parts">Parts</h2>
118131
</li>
119132
<li class="heading-item -depth-2"><a href="#parts" class="hlink link-parts">Parts</a>
120133
</li>
134+
<li class="heading-item -depth-2"><a href="#table-of-contents" class="hlink link-table-of-contents">Table of Contents</a>
135+
</li>
121136
</ul>
122137
</li>
123138
</ul>

0 commit comments

Comments
 (0)