Skip to content

Commit

Permalink
docs: expand writing docs doc
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrTopi committed Nov 20, 2023
1 parent eef7161 commit d004323
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
32 changes: 30 additions & 2 deletions docs/contributor-docs/writing-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type: embed

The most complex type is the `type: example`. It will render as the `embed` did, but it also provides access to the code, which is editable and the changes reflect on the rendered view immediately.

There are to ways these examples can be written.
There are two ways these examples can be written.

In the first example, a valid `ReactNode` is enough and the docs system will take care of the rendering.
In the second example, a whole `component` is needed and it must be `rendered` with the built in `render` method at the very end of the example
Expand Down Expand Up @@ -348,7 +348,35 @@ type: code

The compiler will strip the postfix and calculate the language and type from it as well.

### Other Stuff... WIP
## Named files

Under the docs folder, there are additional folders, which are containing `.md` files, which are for general documentation. These need a `frontmatter`:

```md
---
type: code
---

---

title: Writing Docs
category: Contributor Guides
order: 6

---
```

The `title` will be used as the name of the menuitem in the docs page.

The `order` will determine the order under the `category` it's placed

The `category` is the category under which the doc will be palced in the menu tree. If you want to add another `category`, you have to register it in two places:

`packages/__docs__/src/Search/index.tsx` for the search function to work and

`packages/__docs__/src/Nav/index.tsx` to determine the order of the categories

## Additional information

There are automatically generated parts of the documentation, such as:

Expand Down
4 changes: 0 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,5 @@
},
"browserslist": [
"extends @instructure/browserslist-config-instui"
],
"dependencies": {
"marked-react": "^2.0.0",
"uuid": "^9.0.1"
}
]
}

0 comments on commit d004323

Please sign in to comment.