The project configuration is used when you need to define some specific customizations on your project. Like use plugins, chose themes, set project title, and other things.
To customize your project configuration you can use doczrc.js
following this reference.
You can also create a .env
file or use an existing .env
file. You can then define customizations via DOCZ_<config-variable>
.
You can also pass customizations as arguments to the docz dev
command: docz dev --typescript --port=4838
string
process.env.DOCZ_BASE || '/'
The base URL of the site will be deployed at. You will need to set this if you plan to deploy your site under a subpath, for example, GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/, the base should be set to /bar/
.
It should always start and end with a slash.
The base is automatically prepended to all URLs that start with /
in other options, so you only need to specify it once.
string
process.env.DOCZ_SOURCE || './'
Define the source folder of your components. Only the files in this folder will be parsed. Every file out of this folder will not be found.
Tips and tricks
If you want to boost performance, you can limit the amount of files parsed by passing your source folder here!
string
or Array<string>
process.env.DOCZ_FILES || '**/*.{md,markdown,mdx}'
Glob pattern used to find your files.
By default, Docz finds all files inside the source folder that have a .mdx
extension.
As of v0.10, you can customize it to resolve other filetypes:
// doczrc.js export default { files: '**/*.{md,markdown,mdx}' // or files: ['**/*.{md,markdown,mdx}'] }
You can be more specific if you want and change this glob to find other rules.
It is important to keep the
.mdx
extension in this string if you specify it
string[]
['readme.md', 'changelog.md', 'code_of_conduct.md', 'contributing.md', 'license.md'],
Option used to ignore files to be parsed by docz.
string
process.env.DOCZ_DEST || '.docz/dist'
Specify the output directory for docz build
string
process.env.DOCZ_TITLE || name as defined in package.json
The title for your site. This will be the prefix for all page titles and displayed in the sidebar in the default theme.
string
process.env.DOCZ_DESCRIPTION || description as defined in package.json
The description for the site. It will be rendered as a <meta>
tag in the page HTML.
boolean
process.env.DOCZ_TYPESCRIPT || false
This option is used if you need to import Typescript components inside your .mdx
files.
boolean
process.env.DOCZ_PROPS_PARSER || true
To be able to use the <Props />
component and parse properties of your components, we need to run a lot of processes that have some costs on the build process. If you need to disable this process to improve performance, you can set this property to false
.
String
'docz.json | .doczrc | doczrc.json |doczrc.js | docz.config.js | docz.config.json'
Use this option to change the filepath of Docz config file.
string
/public
Option used to set a public folder of your project
export default { public: '/public' }
Then you can get assets from your folder:
// my-file.mdx # Hello 
boolean
process.env.DEBUG || false
Use this setting to debug your application and remove all progress bar from bundler.
string
master
Branch used to edit your document when clicking on Github button.
string
process.env.DOCZ_HOST || '127.0.0.1'
Specify the host to use for the dev server.
number
p
process.env.DOCZ_PORT || 3000
Specify the port to use for the dev server.
This property was removed in the v2
Get more information about how to use it here
This property was removed in the v2.
Get more information about how to use it here
Object
{}
This is the config that you can use to customize your theme. By default, each theme has its own themeConfig
that you can modify, so this object may vary according to each theme.
You can see the theme config of default theme here
Array[]
null
Use this option to specify the order of your documents in the menu. You can pass a simple string or
if you want to order a nested menu you can pass an object with the name of your document and the menu
order of it.
export default { menu: [ 'Getting Started', { name: 'Components', menu: ['Alert', 'Button'] } ] }
Array
[]
Specify an array of plugins that you want to use.
Array
[]
Array of remark plugins to manipulate the MDXAST
Array
[]
Array of rehype plugins to manipulate the MDXHAST
This property was removed in v2. Use Gatsby hooks instead.
More info about it here
This property was removed in v2. Use Gatsby hooks instead.
More info about it here
This property was removed in v2. Use Gatsby hooks instead.
More info about it here