The generated documentation can be hosted by liblab, or you can download it to view locally and host on a web server.
liblab hosted documentation
The easiest way to host your documentation is to use liblab. Documentation is automatically published to liblab as a part of your build once you approve the documentation.
Approve SDK documentation for publishing using the liblab CLI
Once you are happy with the documentation, you can approve it to have it published and hosted by liblab. This can be done interactively when running
✓ Doc built
SDKs downloaded successfully. You can find them inside the "output" folder
? Would you like to approve and publish these docs now? (Y/n)
Y to approve the docs, and they will be published and hosted by liblab.
? Would you like to approve and publish these docs now? Yes
The docs have been published: view them at https://docs.liblab.com/liblab/exciting.soda/0.1.0
You can also auto approve the docs during the build process by passing the
--approve-docs flag to the
liblab build command.
liblab build --approve-docs
This is useful during an automated build, such as in a CI/CD pipeline.
Approve or unapprove documentation using the liblab portal
Accessing hosted documentation
View documentation locally
When you generate your SDK documentation using the liblab CLI, you will have an option to download the documentation bundle. This bundle contains the generated documentation as a Next.js app, which can be viewed locally in your browser.
You can also download the documentation bundle from the liblab portal.
This documentation can be run in one of 2 ways:
Using a web server. From the root of the documentation bundle, run the following command to start a web server and view the documentation in your browser:
The console output will show where the documentation is being served. By default, it will be at
http://localhost:3000, but another port may be picked if 3000 is in use.
index.htmlfile in your browser. By default the documentation website has CORS enabled, so you will need to allow file access when running your browser first.
For examnple, if you use Chrome, you can pass
--allow-file-access-from-filesto the Chrome executable to allow file access. For example, on macOS run:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files
On Windows run:
Once your browser is running, open the
index.htmlfile from the downloaded docs.