Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Commit e6ee121

Browse files
committed
docs: add v2 docs
1 parent a25865c commit e6ee121

23 files changed

Lines changed: 593 additions & 809 deletions

doczrc.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,22 @@ export default {
2424
'Introduction',
2525
'Getting started',
2626
'Writing MDX',
27-
'Customizing',
2827
'Built-ins components',
2928
'Document settings',
3029
'Deploying your docs',
3130
],
3231
},
32+
{
33+
name: 'Customizing',
34+
menu: ['Powered by Gatsby', 'Gatsby Theme', 'Creating your themes'],
35+
},
3336
{
3437
name: 'References',
3538
menu: [
3639
'Migration Guide',
3740
'Project Configuration',
3841
'Components & Hooks API',
39-
'Gatsby Theme',
4042
'Creating Plugins',
41-
'Creating Themes',
4243
'MDX Plugins',
4344
],
4445
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"docz": "^1.0.0",
1313
"facepaint": "^1.2.1",
1414
"keyboardjs": "^2.5.1",
15+
"lodash": "^4.17.14",
1516
"prismjs": "^1.15.0",
1617
"react": "^16.8.3",
1718
"react-dom": "^16.8.3",
-187 KB
Binary file not shown.

public/images/header-img.png

255 KB
Loading

src/docs/documentation/references/creating-themes.mdx renamed to src/docs/documentation/customizing/creating-your-themes.mdx

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
name: Creating Themes
3-
route: /docs/creating-themes
2+
name: Creating your themes
3+
route: /docs/creating-your-themes
44
parent: Documentation
5-
menu: References
5+
menu: Customizing
66
---
77

8-
# Creating Themes
8+
# Creating your themes
99

1010
One of the main features of Docz is that you can create your own theme from scratch and just use data parsed from Docz.
1111
We provide a bunch of components that can help you to create your own theme without pain.
@@ -16,30 +16,23 @@ Let's use this project structure through the following examples:
1616
pages/
1717
hello-world.mdx
1818
src/
19+
gatsby-theme-docz/
20+
index.js
1921
ui/
2022
Page.js
21-
theme.js
2223
doczrc.js
2324
package.json
2425
```
2526

26-
## Setting theme filepath
27-
28-
First of all, you need to set the path of your theme in the [Project Configuration](/docs/project-configuration) by changing the `theme` property.
29-
30-
```js
31-
// doczrc.js
32-
export default {
33-
theme: 'src/theme',
34-
}
35-
```
27+
The oldest way to acomplish that is by using the `theme` property inside the `doczrc.js` file. Now, if you want to create
28+
your own theme, just create a file located at `src/gatsby-theme-docz/index.js`
3629

3730
## Creating your theme component
3831

3932
Then just create your component passing the `children` inside it and export it as default using the [`theme()`](/docs/components-api) high order component as an enhancer.
4033

4134
```js
42-
// src/theme.js
35+
// src/gatsby-theme-docz/index.js
4336
import React from 'react'
4437
import { theme } from 'docz'
4538

@@ -60,7 +53,7 @@ Each theme has your own default `themeConfig` object that define whatever you wa
6053
It's very useful to set something like custom fonts, colors, spaces, some styles properties and other project global variables.
6154

6255
```js
63-
// src/theme.js
56+
// src/gatsby-theme-docz/index.js
6457
import React from 'react'
6558
import { theme } from 'docz'
6659

@@ -81,7 +74,7 @@ By default, Docz will use this object as default configuration and merge it with
8174
Using together with `useConfig` hook you can do a lot of things, like use css-in-js theming or retrieve props from your `themeConfig` in a deep render component.
8275

8376
```js
84-
// src/theme.js
77+
// src/gatsby-theme-docz/index.js
8578
import React from 'react'
8679
import { theme, useConfig } from 'docz'
8780
import { ThemeProvider } from 'emotion-theming'
@@ -113,7 +106,7 @@ provide for MDX and Docz each component that you want to render inside your docu
113106
components passed to the provider, you can easily change how your mdx file will be rendered and change default behaviors and styles.
114107

115108
```js
116-
// src/theme.js
109+
// src/gatsby-theme-docz/index.js
117110
import React from 'react'
118111
import { theme, useConfig, ComponentsProvider } from 'docz'
119112
import { ThemeProvider } from 'emotion-theming'
@@ -193,7 +186,7 @@ export const Menu = () => {
193186
Now you have a fully functional navigation to your documentation and you can simply use it your `<Menu />` component inside your theme:
194187

195188
```js
196-
// src/theme.js
189+
// src/gatsby-theme-docz/index.js
197190
import React from 'react'
198191
import { theme, useConfig, ComponentsProvider } from 'docz'
199192
import { ThemeProvider } from 'emotion-theming'

0 commit comments

Comments
 (0)