Skip to content

Commit f8ca462

Browse files
authored
Merge pull request #172 from primer/release-0.24.0
Release 0.24.0
2 parents 49f1a78 + c5a68a9 commit f8ca462

File tree

21 files changed

+6030
-4398
lines changed

21 files changed

+6030
-4398
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,25 @@ title: Contributing
44

55
We appreciate your contribution and hope that this document helps you along the way. If you have any questions or problems, don't hesitate to [file an issue](https://github.com/primer/doctocat/issues/new).
66

7-
_Note: These guidelines are for contributing to the theme itself, if you are looking for help running a Doctocat site for another project locally, check out the [Local Development](/usage/local-development) docs in the Usage section._
7+
<Note>
8+
9+
10+
These guidelines are for contributing to the theme itself, if you are looking for help running a Doctocat site for another project locally, check out the [Local Development](/usage/local-development) docs in the Usage section.
11+
12+
</Note>
13+
14+
815
## Local development
916

1017
Run the following commands to begin local development:
1118

12-
_Note: These steps require [Node.js](https://nodejs.org) and [Yarn](https://yarnpkg.com) to be set up locally._
19+
<Note>
20+
21+
22+
These steps require [Node.js](https://nodejs.org) and [Yarn](https://yarnpkg.com) to be set up locally.
23+
24+
</Note>
25+
1326

1427
```shell
1528
# Clone the repository

docs/content/components/caption.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@ import {Caption} from '@primer/gatsby-theme-doctocat'
1515
```
1616

1717
## Example
18+
1819
```jsx live
1920
<Flex alignItems="center" flexDirection="column">
20-
<img alt="" src="https://s3.us-west-2.amazonaws.com/photos.puppyspot.com/breeds/245/card/500000291_medium.jpg" />
21+
<img
22+
alt=""
23+
src="https://s3.us-west-2.amazonaws.com/photos.puppyspot.com/breeds/245/card/500000291_medium.jpg"
24+
/>
2125
<Caption>A beautiful husky puppy.</Caption>
2226
</Flex>
2327
```
2428

25-
_Note: Be sure to provide enough detail in your caption so users with assistive technology have adequate context. An empty alt tag `alt=""` should be used on the `img` in cases where the caption describes the image, thus making the image decorative in purpose._
29+
<Note variant="warning">
30+
31+
32+
Be sure to provide enough detail in your caption so users with assistive technology have adequate context. An empty alt tag `alt=""` should be used on the `img` in cases where the caption describes the image, thus making the image decorative in purpose.
33+
34+
</Note>
35+

docs/content/components/note.mdx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Note
3+
status: New
4+
source: https://github.com/primer/doctocat/blob/master/theme/src/components/note.js
5+
---
6+
7+
Use the `Note` component to call out information in documentation pages.
8+
9+
## Usage
10+
11+
`Note` is a [shortcode](https://mdxjs.com/blog/shortcodes), meaning it's globally available in all `.md` and `.mdx` files. So you can use the `Note` component in any `.md` or `.mdx` file without importing it.
12+
13+
```jsx live
14+
<Note>Your note goes here</Note>
15+
```
16+
17+
To write markdown syntax inside of a `Note`, make sure to add extra newlines to seperate the content from the opening and
18+
closing tags:
19+
20+
```
21+
blah blah blah
22+
23+
<Note>
24+
25+
Your _note_ goes **here**.
26+
27+
</Note>
28+
29+
blah blah blah
30+
```
31+
32+
## Variants
33+
34+
### Info (default)
35+
36+
Use the `info` variant to call out neutral information.
37+
38+
```jsx live
39+
<Note>Your note goes here</Note>
40+
```
41+
42+
### Warning
43+
44+
Use the `warning` variant to indicate that extra care should be taken.
45+
46+
```jsx live
47+
<Note variant="warning">Don't forget to give your images alt text.</Note>
48+
```
49+
50+
### Danger
51+
52+
Use the `danger` variant to indicate that something bad could happen if the reader ignores the note.
53+
54+
```jsx live
55+
<Note variant="danger">Don't cut the red wire!</Note>
56+
```

docs/content/getting-started/gatsby-cli.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ title: Gatsby CLI
44

55
Follow these steps to create a new site using the [Gatsby CLI](https://www.gatsbyjs.org/docs/gatsby-cli/):
66

7-
_Note: This guide assumes that you have some familiarity with the command line, and have Node.js and npm installed locally. Check out [nodejs.org](https://nodejs.org) for more information. You will need npm v5.2.0 or higher to use the [`npx`](https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner) command in step 1._
7+
<Note>
8+
9+
10+
This guide assumes that you have some familiarity with the command line, and have Node.js and npm installed locally. Check out [nodejs.org](https://nodejs.org) for more information. You will need npm v5.2.0 or higher to use the [`npx`](https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner) command in step 1.
11+
12+
</Note>
13+
814

915
## 1. Scaffold a new site
1016

docs/content/usage/front-matter.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ If the `source` front matter variable is defined, Doctocat will add a source cod
6666
<SourceLink href="#" />
6767
</BorderBox>
6868

69-
_Note: This source code link is not the same as the "Edit this page on GitHub" link that is automatically added to the bottom of every page. The source code link should point to code that is relevant to the page. The "Edit this page on GitHub" link points to the Markdown file for the page itself._
69+
<Note>
70+
71+
72+
This source code link is not the same as the "Edit this page on GitHub" link that is automatically added to the bottom of every page. The source code link should point to code that is relevant to the page. The "Edit this page on GitHub" link points to the Markdown file for the page itself.
73+
74+
</Note>
75+
7076

7177
## Additional contributors
7278

docs/content/usage/live-code.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ export default {
3939
}
4040
```
4141

42-
**Note:** make sure to place `live-code-scope.js` in the root of your `gatsby-theme-doctocat` folder. Shadowed files must be present in the same location as they exist in the theme repository.
42+
<Note variant="warning">
43+
44+
45+
Make sure to place `live-code-scope.js` in the root of your `gatsby-theme-doctocat` folder. Shadowed files must be present in the same location as they exist in the theme repository.
46+
47+
</Note>
48+
4349

4450
Every property on the object exported by `live-code-scope.js` will be available as a variable in the code:
4551

@@ -89,9 +95,9 @@ function DemoApp() {
8995

9096
return (
9197
<div>
92-
<button onClick={() => setCount(n => n - 1)}>-</button>
98+
<button onClick={() => setCount((n) => n - 1)}>-</button>
9399
{count}
94-
<button onClick={() => setCount(n => n + 1)}>+</button>
100+
<button onClick={() => setCount((n) => n + 1)}>+</button>
95101
</div>
96102
)
97103
}
@@ -106,9 +112,9 @@ function DemoApp() {
106112

107113
return (
108114
<div style={{textAlign: 'center'}}>
109-
<button onClick={() => setCount(n => n - 1)}>-</button>
115+
<button onClick={() => setCount((n) => n - 1)}>-</button>
110116
{count}
111-
<button onClick={() => setCount(n => n + 1)}>+</button>
117+
<button onClick={() => setCount((n) => n + 1)}>+</button>
112118
</div>
113119
)
114120
}

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
"@primer/components": "^20.0.0",
1212
"@primer/css": "^12.4.1",
1313
"@primer/gatsby-theme-doctocat": "*",
14-
"gatsby": "^2.13.52",
14+
"gatsby": "^2.24.52",
1515
"gatsby-plugin-sass": "^2.1.0",
1616
"node-sass": "^4.12.0",
17-
"react": "^16.8.6",
18-
"react-dom": "^16.8.6"
17+
"react": "^16.13.1",
18+
"react-dom": "^16.13.1"
1919
},
2020
"repository": "primer/doctocat"
2121
}

docs/src/@primer/gatsby-theme-doctocat/nav.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@
2525
url: /components/caption
2626
- title: Do/Don't
2727
url: /components/do-dont
28+
- title: Note
29+
url: /components/note
2830
- title: Contributing
2931
url: /contributing

theme/gatsby-node.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ exports.createPages = async ({graphql, actions}, themeOptions) => {
1616
fileAbsolutePath
1717
frontmatter {
1818
title
19+
status
20+
source
21+
additionalContributors
1922
}
20-
tableOfContents
23+
tableOfContents(maxDepth: 3)
2124
parent {
2225
... on File {
2326
relativeDirectory
@@ -71,7 +74,7 @@ exports.createPages = async ({graphql, actions}, themeOptions) => {
7174
// for us here, and does on the first build,
7275
// but when HMR kicks in the frontmatter is lost.
7376
// The solution is to include it here explicitly.
74-
// frontmatter: node.frontmatter
77+
frontmatter: node.frontmatter,
7578
},
7679
})
7780
}),

theme/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export {default as Frame} from './src/components/frame'
66
export {default as Head} from './src/components/head'
77
export {default as Header} from './src/components/header'
88
export {default as Hero} from './src/components/hero'
9+
export {default as Note} from './src/components/note'
910
export {default as HeroLayout} from './src/components/hero-layout'
1011
export {default as Sidebar} from './src/components/sidebar'
1112
export {default as SourceLink} from './src/components/source-link'

0 commit comments

Comments
 (0)