From the project you want to create a website for, create a new folder:
mkdir websiteInitialize that folder as a new project with its own package.json.
From now on, we'll call that folder you've just created the Ocular folder.
npm init -ythen install Ocular as a devDependency.
yarn add -D ocular-gatsbyor
npm install ocular-gatsby --save-devNow, start the Ocular project:
ocular initThis will prompt you with a few questions, and create a number of files and folders in the Ocular folder.
The most important of these file is ocular-config.js in the Ocular folder, which contains all the settings for your website. You can edit it later.
Now install any remaining packages:
yarnor
npm installYour project will need a table-of-contents.json file in the same location you have your documentation files. You can create one manually but Ocular can also create one for you by typing:
yarn build-tocor
npm run build-tocAt this stage, you can see your website by typing:
yarn startor
npm run startYou're going to need documentation files for your documentation website.
Your ocular-config.js file will contain the location of these files. Read Writing documentation to know all about that part.
And your documentation files will be available on your website!
That's all you need if you just want to have your website running on your machine. But if you want to have your site running somewhere else, such as GitHub, that's not enough.
From the ocular folder, type
yarn buildor
npm run buildAnd this will generate a static website in the folder public (a sub-folder of your Ocular folder)
You can go to that folder and test your built website by typing
yarn serveor
npm run serveYou can now safely upload the contents of this folder on a web server. If you want to deploy this website to Github Pages, and your project is already hosted on github, you can instead type:
yarn deployor
npm run deploy