Create beautiful api documentation with gatsby and greenboard
- Generate static site from markdown
- Get all features of gatsby and react
- Fully customizable
- Dark Mode
- Uses same structure of slate docs.
Setup your folder and install gatsby, react and react-dom
mkdir my-docs
cd my-docs
yarn init
yarn add gatsby react react-domInstall greenboard
yarn add gatsby-greenboardThen add gatsby-greenboard to your gatsby-config.js.
module.exports = {
plugins: [
{
resolve: "gatsby-greenboard",
options: {},
},
],
}Now create your api documentation in data/index.html.md. You can check a sample format in here
That's it, you can now run your gatsby site using
yarn gatsby developBuild the production files
yarn gatsby buildTo get more customization fork this repo.
Clone the repo
https://github.com/shamin/greenboard.gitTravese to the folder
cd greenboardInstall dependencies
yarnTo run example locally
yarn workspace example developTo build example
yarn workspace example buildTo run the build files locally with serve
npm install -g serve
cd example/build
serveTo deploy example to github pages
yarn workspace example deployAdd the pathPrefix to gatsby-config.js in your docs folder
module.exports = {
pathPrefix: `/docs`,
}Run build command
yarn workspace example build
For more information visit https://www.gatsbyjs.org/docs/path-prefix/
If you need some help you can contact me on my email [email protected]