Skip to content

Commit

Permalink
Improved usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfr committed Mar 8, 2021
1 parent e3b3d09 commit b6fa4c1
Show file tree
Hide file tree
Showing 24 changed files with 68 additions and 21 deletions.
1 change: 1 addition & 0 deletions bedrock.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
componentCategories: {
aov: 'Overviews',
c: 'Components',
cc: 'Custom components category',
}
},
/**
Expand Down
4 changes: 2 additions & 2 deletions content/docs/patterns/doc-example-2.pug
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ p This one should be first.

p This is just an example of how you can make static docs.

p You could include real code examples here. Notice how we are referencing c-example here.
p You could include real code examples here. Notice how we are referencing <code>c-example-manual-docs</code> here.

.br-sample
.br-sample-content(style="height: 200px; overflow: scroll")
include /templates/_components/c-example/01-example
include /templates/_components/c-example-manual-docs/01-example

15 changes: 13 additions & 2 deletions content/docs/patterns/doc-example.pug
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,20 @@ h2 This is a docs page

p This is just an example of how you can make static docs.

p You could include real code examples here. Notice how we are referencing c-example here.
p This page should be second. Page order is influenced by the <code>order</code> number in the front matter.

pre
code.
---
title: Doc page example
category: Design patterns
order: 2
---


p You could include real code examples here. Notice how we are referencing <code>c-example-manual-docs</code> here.

.br-sample
.br-sample-content(style="height: 200px; overflow: scroll")
include /templates/_components/c-example/01-example
include /templates/_components/c-example-manual-docs/01-example

6 changes: 0 additions & 6 deletions content/templates/_components/c-example-2/_docs-footer.md

This file was deleted.

6 changes: 0 additions & 6 deletions content/templates/_components/c-example-2/_docs.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Custom example
containsCustom: true
---

Example that is marked as “custom”. Useful to denote a component as custom when documenting changes to a standard framework (e.g. Bootstrap).
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Footer Content
---

This example has docs the footer. Useful to maybe put a table here with props.

<table>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>Prop</td>
<td>Boolean</td>
<td>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.</td>
</tr>
<tr>
<td>Prop</td>
<td>Boolean</td>
<td>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.</td>
</tr>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Example with automatic humanized names
---

Example where we only have pug files, no markdown files. The names of the docs are automatically “humanized”.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.example
p This is an example component.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.example
p This is an example component.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.example
p This is an example component with a named source. In this case “unofficial”.
5 changes: 5 additions & 0 deletions content/templates/_components/c-example-named-source/_docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Example with named source
---

Example with a named source.
2 changes: 0 additions & 2 deletions content/templates/_components/c-example/03-with-source.pug

This file was deleted.

2 changes: 2 additions & 0 deletions content/templates/_components/cc-example/01-my-component.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.example
p This is an example component.
5 changes: 5 additions & 0 deletions content/templates/_components/cc-example/_docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Custom category
---

This example occurs in a custom category. You can define categories in `bedrock.config.js`.

This file was deleted.

0 comments on commit b6fa4c1

Please sign in to comment.