Welcome to the Dokz documentation!
Dokz is a documentation site generator that compiles your markdown down to a static react site
The markdown extension used is mdx
, it has all the markdown features plus you can import, export and render react components 🔥
Dokz uses Next.js under the hood, check out Next.js if you never heard about it
We recommend creating a new Dokz app using create-dokz-app
, which sets up everything automatically for you. To create a project, run:
1npm init dokz-app2# or3yarn create dokz-app
After the installation is complete run npm run dev
to start the development server. Try editing pages/index.mdx
and see the result on your browser.
warning: you should use npm init dokz-app
if you start from scratch
You can also install dokz
in an existing nextjs application:
1npm install dokz @emotion/react @chakra-ui/react @emotion/styled framer-motion2# or3yarn add dokz @emotion/react @emotion/styled @chakra-ui/react framer-motion
Add the dokz provider to the main nextjs entry point
1// _app.jsx2import { DokzProvider } from 'dokz'3import { ChakraProvider } from '@chakra-ui/react'4import React from 'react'56export default function App(props) {7const { Component, pageProps } = props8return (9<ChakraProvider resetCSS>10<DokzProvider headerLogo={<img src='/logo.svg' width='100px' />}>11<Component {...pageProps} />12</DokzProvider>13</ChakraProvider>14)15}
Add withDokz
in the next.config.js
file
1const { withDokz } = require('dokz/dist/plugin')23module.exports = withDokz()
Create a new mdx document inside tha pages
folder, for example index.mdx
1# Heading23Ullamco ipsum id irure do occaecat minim. Cupidatat exercitation magna sit sunt aliqua voluptate excepteur amet dolor ea do. Consectetur veniam deserunt ullamco irure ullamco. Voluptate magna tempor elit voluptate velit enim dolor nulla sit fugiat exercitation. Anim deserunt Lorem aliquip cillum duis deserunt consequat sit culpa commodo.45> Node this is important67## Subjeading89Quis anim minim ullamco aliquip excepteur do pariatur eiusmod duis eu non. Duis deserunt Lorem nulla non duis voluptate dolore et. Do veniam mollit in do ad id enim anim dolore sint labore quis consequat.
To start developing your application execute npm run dev
. This starts the development server on http://localhost:3000
.
Visit http://localhost:3000
to view your application.