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

Commit 5b281f3

Browse files
committed
docs: update docz version
1 parent 9c63c17 commit 5b281f3

File tree

4 files changed

+50
-41
lines changed

4 files changed

+50
-41
lines changed

src/docs/documentation/customizing/gatsby-theme.mdx

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ menu: Customizing
77

88
# Gatsby Theme
99

10-
If you want to use Docz in a Gatsby environment, use our `gatsby-theme-docz` is the better choice.
10+
If you want to use Docz in a Gatsby application, you can use `gatsby-theme-docz`.
1111

1212
Gatsby themes is one of the coolest features of all time in Gatsby. With the introduction of theming in Gatsby, it's easier than ever to get started building a Gatsby site. Shared functionality, data sourcing, and design can all be prepackaged as a Gatsby Theme that's an NPM install away.
1313

1414
Our theme has all components and algorithms used to render your documentation website, with it we can explore a lot of Gatsby features and put all this things together in order
15-
to create a really usefull documentation for you. Because of `gatsby-theme-docz` you can enjoy of a lot easier system to customize and improve your docs too.
15+
to create a really useful documentation website.
16+
With `gatsby-theme-docz` you can get the full power of docz in your existing Gatsby app.
1617

17-
If you like it, but you don't know what is a Gatsby theme, please read [the official docs](https://www.gatsbyjs.org/docs/themes/introduction/)
18+
If you're not sure what a Gatsby theme is, please read [the official docs](https://www.gatsbyjs.org/docs/themes/introduction/)
1819

1920
## How to use
2021

21-
It's so simple to use our Gatsby theme. First of all, just install some packages:
22+
First, install some packages:
2223

2324
```
2425
yarn add gatsby gatsby-theme-docz@next docz@next react react-dom
@@ -33,7 +34,7 @@ module.exports = {
3334
}
3435
```
3536

36-
Then, add some `.mdx` inside your project:
37+
Then, add some `.mdx` in your project:
3738

3839
```markdown
3940
---
@@ -59,7 +60,7 @@ If everything works, you should see something like this:
5960
## Configuration
6061

6162
Set your config by using `doczrc.js` file ([see all available](https://www.docz.site/docs/project-configuration)) or if you want to
62-
set some defaults for your theme, use `options` on plugin definition:
63+
set some defaults for your theme, use `options` in the plugin definition:
6364

6465
```js
6566
// gatsby-config.js
@@ -92,7 +93,7 @@ export default {
9293

9394
## Customizing components
9495

95-
Components shadowing is one of the best things included in the new Gatsby theme feature, with it is possible to replace theme files just by creating your own file following a file naming convetion.
96+
Components shadowing is one of the best things included in the new Gatsby theme feature, with it, it is possible to replace theme files just by creating your own file following a file naming convention.
9697

9798
Example: If you're using our `gatsby-theme-docz` which has a `Header` component located at `src/components/Header/index.js` you can override the component by creating `src/gatsby-theme-docz/components/Header/index.js`. Cool right?
9899

@@ -112,7 +113,11 @@ Easy, right?
112113

113114
## Creating your own Docz theme
114115

115-
One of the coolest thing of Docz is that you can create your own theme if you want from scratch and use all benefits of it. The oldest way to acomplish that is by using the `theme` property inside the `doczrc.js` file. Now, if you want to create your own theme, just create a file located at `src/gatsby-theme-docz/index.js`
116+
One of the coolest thing of Docz is that you can create your own theme if you want from scratch and keep all docz's benefits.
117+
118+
Previously, this was accomplished by using the `theme` property inside the `doczrc.js` file.
119+
120+
Starting from v2, if you want to create your own theme, just create a file located at `src/gatsby-theme-docz/index.js`
116121

117122
```js
118123
import React from 'react'
@@ -170,9 +175,11 @@ export default ({ children }) => (
170175

171176
## Theme UI integrated
172177

173-
As default theme system we are using the [Theme-UI](https://theme-ui.com/), it's a library for build consistent, themeable React apps based on constraint-based design principles.
178+
Docz's code uses [Theme-UI](https://theme-ui.com/) as the default theme system.
179+
180+
[Theme-UI](https://theme-ui.com/) is a library for building consistent, themeable React apps based on constraint-based design principles.
174181

175-
You can modify our based theme creating your own style, combining these modifications with the component shadowing and creating a totally differente documentation.
182+
You can modify the default theme and create your own style by combining these modifications with component shadowing.
176183

177184
Check our [base theme object](https://github.com/pedronauck/docz/blob/feat/gatsby/core/gatsby-theme-docz/src/theme/index.js) to see the properties.
178185

@@ -191,7 +198,7 @@ export default {
191198
}
192199
```
193200

194-
Or, to create your own theme it's easy, just create this file in the root of your project: `src/gatsby-theme-docz/theme/index.js`.
201+
Or, to create your own theme, just create this file in the root of your project: `src/gatsby-theme-docz/theme/index.js`.
195202

196203
```js
197204
import baseTheme from 'gatsby-theme-docz/src/theme'
@@ -208,7 +215,7 @@ export default merge(baseTheme, {
208215

209216
## Changing code highlight
210217

211-
Both code highlights shortcodes and the `<Playground>` component are using [prism-react-renderer](https://github.com/FormidableLabs/prism-react-renderer) to highlight the code.
218+
Both code highlights shortcodes and the `<Playground>` component use [prism-react-renderer](https://github.com/FormidableLabs/prism-react-renderer) to highlight the code.
212219
If you want to modify and use another PrismJS theme, you can do that just passing a `prismTheme` property for your theme.
213220

214221
```js
@@ -260,11 +267,11 @@ export default {
260267

261268
## Getting data
262269

263-
Using our Gatsby Theme you can enjoy all our hooks to get data for your pages and also get data from Gatsby.
270+
Using our Gatsby Theme you can use all Gatsby hooks to get data for your pages and from Gatsby.
264271
So, you can create isolated pages on Gatsby using gatsby pages and get data from Docz or maybe pass data
265272
for your Docz documents using source from gatsby.
266273

267-
Imagine, that you have your home page inside `/pages` and you want to show all documents parsed from Docz. You can easy get this by doing:
274+
Imagine, that you have your home page inside `/pages` and you want to show all documents parsed from Docz. You can get this by doing:
268275

269276
```js
270277
import React from 'react'

src/docs/documentation/customizing/powered-by-gatsby.mdx

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,54 @@ menu: Customizing
88
# Powered by Gatsby
99

1010
[Gatsby](https://gatsbyjs.org) is a blazing fast modern site generator for React and one of the greatest modern tools
11-
of the new frontend era. It has a huge ecosystem and community around it and a very concise team behind.
11+
of the new frontend era. It has a huge ecosystem and community around it and a very talented team behind it.
1212

13-
The Docz core since the new v2 is entirely build around Gatsby, this is the biggest change
13+
Starting from v2, docz's core is entirely built around Gatsby, this is the biggest change
1414
in the project since its creation and one of the best things that we could make for the tool.
1515

16-
Using Gatsby as bundler behind the scenes we won a lot of benefits like:
16+
Using Gatsby as bundler behind the scenes gives you a lot of benefits like :
1717

18-
* Stay focused in create features instead of lead with bundler management
18+
* Stay focused on creating features instead of worrying about bundler management
1919
* Static and optimized builds by default
2020
* Fast dev-experience and better workflow
2121
* Huge ecosystem of tools, plugins and community
2222
* Better and easy way to customize things inside Docz
23-
* More power in order to create your documentation
2423

2524
## Gatsby API and Hooks
2625

27-
Gatsby has a pretty damn good [API for developers](https://www.gatsbyjs.org/docs/api-reference/) and a lot of hooks and life cycle methods that you can use in order to customize the process of
28-
your bundle. Indeed you can hook into it in a lot of ways and all these hooks
29-
and properties you can use with Docz.
26+
Gatsby has an extensive [API for developers](https://www.gatsbyjs.org/docs/api-reference/) and a lot of hooks and lifecycle methods that you can use in order to customize your build process.
3027

31-
> Check [all Gatsby API references](https://www.gatsbyjs.org/docs/api-reference/) here
28+
You can hook into it in a lot of ways and all of these hooks and properties are available when you use docz.
3229

33-
So, if you want to use any of those Gatsby configurations file inside your Docz project, create it in the root and we'll handle them for you.
30+
> Check [the Gatsby API reference](https://www.gatsbyjs.org/docs/api-reference/) here.
3431
35-
If you want to make some change in the webpack configuration, you can use
36-
the `onCreateWebpackConfig` hook inside the `gatsby-node.js` file:
32+
If you want to use any of those Gatsby configurations file inside your Docz project,
33+
create it in the root and docz will do the rest.
34+
35+
If you want to make some changes to your webpack configuration, you can use
36+
the `onCreateWebpackConfig` hook by exporting a function from the `gatsby-node.js` file.
37+
38+
For example to create aliases or change how your modules are resolved, you can do something like the below example :
3739

3840
```js
3941
// gatsby-node.js
40-
exports.onCreateWebpackConfig = ({ actions }) => {
41-
actions.setWebpackConfig({
42-
module: {
43-
rules: [
44-
{
45-
test: 'my-css',
46-
use: [loaders.style(), loaders.css()]
47-
},
48-
],
42+
const path = require('path')
43+
44+
exports.onCreateWebpackConfig = args => {
45+
args.actions.setWebpackConfig({
46+
resolve: {
47+
modules: [path.resolve(__dirname, '../src'), 'node_modules'],
48+
alias: {
49+
'@': path.resolve(__dirname, '../src/components/'),
50+
},
4951
},
5052
})
5153
}
5254
```
5355

54-
Or if you want to change your Babel configuration you can use `onCreateBabelConfig` hook for this:
56+
> ⚠ Note the '..' in the path because the docz gatsby project lives in the `.docz` directory
57+
58+
Or if you want to change your Babel configuration you can use the `onCreateBabelConfig` hook for this:
5559

5660
```js
5761
// gatsby-node.js
@@ -65,4 +69,4 @@ exports.onCreateBabelConfig = ({ actions }) => {
6569
}
6670
```
6771

68-
Indeed you have a lot of hooks and actions that you can use to modify or get some information about your bundler process.
72+
You can use these hooks and actions to modify or get information about your bundler process.

src/docs/documentation/references/project-configuration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Then you can get assets from your folder:
137137
// my-file.mdx
138138
# Hello
139139
140-
![](/public/some-image.png)
140+
![placeholder image](/public/some-image.png)
141141
```
142142

143143
### debug

src/docs/home/components/HowTo.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ export const HowTo = () => (
8484
<Container>
8585
<Title>How to</Title>
8686
<Text>Install Docz as a dependency</Text>
87-
<Pre className="language-bash">
88-
$ yarn add docz@next react react-dom --dev
89-
</Pre>
87+
<Pre className="language-bash">$ yarn add docz react react-dom --dev</Pre>
9088
<Text>
9189
Create an <code>.mdx</code> file anywhere in your project
9290
</Text>

0 commit comments

Comments
 (0)