Skip to content

Commit 89df736

Browse files
authored
Merge pull request #223 from gaeacodes/dev
add TocForIndex component in styleguide
2 parents 62fa7f1 + 592a92c commit 89df736

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

STYLE_GUIDE.md

+21-13
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ For example, when method and title are the same:
142142

143143
We've got a few **MDX** components we use across the Docs. Below is a walkthrough of how to start writing and using the components that make up the Docs.
144144

145-
IMPORTANT: Alwats use double quotes inside mdx tags.
145+
IMPORTANT: Always use double quotes inside mdx tags.
146146

147147
Example:
148148

@@ -288,18 +288,18 @@ This renders a button with a specified text based on its state (expanded or coll
288288
You'll mostly use this for API, Commands, etc. Responses, which should be wrapped with the `CollapsibleSection` tags, for example:
289289

290290
```mdx
291-
<CollapsibleSection expandedText='Hide Response' collapsedText='Show Response'>
292-
#### Response (ready, successful)
293-
294-
```json
295-
{
296-
"mmrpc": "2.0",
297-
"result": "success",
298-
"id": null
299-
}
300-
```
301-
302-
</CollapsibleSection>
291+
<CollapsibleSection expandedText='Hide Response' collapsedText='Show Response'>
292+
#### Response (ready, successful)
293+
294+
```json
295+
{
296+
"mmrpc": "2.0",
297+
"result": "success",
298+
"id": null
299+
}
300+
```
301+
302+
</CollapsibleSection>
303303
```
304304

305305
The `CollapsibleSection` tags should also wrap all error responses (as a group), with the `expandedText` and `collapsedText` values set to '**Show Error Responses**' and '**Hide Error Responses' respectively**.
@@ -407,6 +407,14 @@ Rendered as:
407407

408408
![Tag component](style-guide-images/crude-tag-ui.png)
409409

410+
## ToCForIndex
411+
412+
This component can be included in the root index.mdx files in any of the directories that hold a specific category of docs. This component will populate a list with the table of contents for the section.
413+
414+
Rendered as:
415+
416+
![TocForIndex component](style-guide-images/toc-for-index.png)
417+
410418
## Navbar (Top)
411419

412420
Top navbar's navigation data/dropdown list is manually populated. This file can be found at [src/data/navbar.json](src/data/navbar.json). If you're working on a very important new page, which links to a whole new category or an index, this is where to add them.

style-guide-images/toc-for-index.png

64 KB
Loading

0 commit comments

Comments
 (0)