Getting Started

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

Setup

We recommend creating a new Dokz app using create-dokz-app, which sets up everything automatically for you. To create a project, run:

npm init dokz-app
# or
yarn 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.

Manual Setup

warning: you should use npm init dokz-app if you start from scratch

You can also install dokz in an existing nextjs application:

npm install dokz @emotion/react @chakra-ui/react @emotion/styled framer-motion
# or
yarn add dokz @emotion/react @emotion/styled @chakra-ui/react framer-motion

Add the dokz provider to the main nextjs entry point

// _app.jsx
import { DokzProvider } from 'dokz'
import { ChakraProvider } from '@chakra-ui/react'
import React from 'react'

export default function App(props) {
    const { Component, pageProps } = props
    
    return (
        <ChakraProvider resetCSS>
            <DokzProvider headerLogo={<img src='/logo.svg' width='100px' />}>
                <Component {...pageProps} />
            </DokzProvider>
        </ChakraProvider>
    )
}

Add withDokz in the next.config.js file

const { withDokz } = require('dokz/dist/plugin')

module.exports = withDokz()

Create a new mdx document inside tha pages folder, for example index.mdx

# Heading

Ullamco 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.

> Node this is important

## Subjeading

Quis 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.