The source of https://docs.aidbox.app.
Run make init
to set up the pre-push git hook. This hook will automatically run mandatory checks.
docker pull ghcr.io/healthsamurai/documentation:latest && docker run -p 8081:8081 -e DOCS_PREFIX=/docs --rm ghcr.io/healthsamurai/documentation:latest
And go to http://localhost:8081
.
PORT=8081
Specifies the port number on which the documentation server will run. Default: 8081
.
DEV=true
Enables development mode. When set to true
, the server reads, parses and renders files on every request, allowing for live updates during development. Default: false
.
BASE_URL=http://localhost:8081
The base URL of the documentation site. This is used in:
- Meta tags for SEO
- Sitemap generation
- robots.txt file
- Absolute URL construction
Default: http://localhost:8081
.
DOCS_PREFIX=/aidbox
URL path prefix for documentation pages. The full URL for any page is constructed as:
FULL_URL = BASE_URL + DOCS_PREFIX + relative-url
This allows serving documentation under a subdirectory. Also used in meta tags, sitemap, and robots.txt.
Default: /aidbox
.
VERSION=v1.0.0
Version identifier for the build. Used during the build process to tag the application version. If not specified, defaults to the short Git commit hash from the current HEAD.
Default: Git short commit hash (e.g., a1b2c3d
).
WORKDIR=/path/to/docs
Working directory for the build process. When specified, the build will copy files from this directory instead of the default docs
directory. This is useful for building documentation from a custom location.
Default: Uses docs
directory in the project root.
npm install -D tailwindcss@3
make tailwind
git submodule update --init --recursive
make repl
This documentation system supports hosting multiple product documentation under a single deployment using the products.yaml
configuration file.
The products.yaml
file should be placed in the root of your documentation directory (e.g., docs-new/products.yaml
). Here's the structure:
root-redirect: "/aidbox" # Optional: redirect from "/" to a specific product
products:
- id: aidbox # Unique identifier for the product
name: "Aidbox Docs" # Display name shown in the UI
path: /aidbox # URL path prefix for this product
config: ./aidbox/.gitbook.yaml # Path to GitBook config
logo: .gitbook/assets/logo.jpg # Optional: product logo
links: # Optional: navigation links for this product
- text: "Getting Started"
href: "/getting-started"
- text: "External Link"
href: "https://example.com"
target: "_blank"
- id: forms
name: "Forms Documentation"
path: /forms
config: ./forms/.gitbook.yaml
# ... additional configuration
Each product should have its own folder with the following structure:
docs-new/
├── products.yaml # Main products configuration
├── aidbox/ # Product folder (matches product.id)
│ ├── .gitbook.yaml # GitBook configuration
│ └── docs/ # Documentation content
│ ├── readme/ # README location (defined in .gitbook.yaml)
│ │ └── README.md
│ ├── SUMMARY.md # Table of contents
│ └── ... # Other documentation files
└── forms/ # Another product
├── .gitbook.yaml
└── docs/
└── ...
Each product needs a .gitbook.yaml
file with the following structure:
root: ./docs/ # Root directory for documentation files
structure:
readme: readme/README.md # Path to main README relative to root
summary: SUMMARY.md # Path to SUMMARY.md relative to root
redirects: # Optional: URL redirects
- The system reads
products.yaml
to discover available products - Each product configuration is loaded from its respective
.gitbook.yaml
- URLs are constructed as:
BASE_URL + DOCS_PREFIX + product.path + page-path
- The
root-redirect
option (if specified) redirects the root URL to a specific product
When using multiple products, the DOCS_PREFIX
environment variable affects all product URLs. For example:
- With
DOCS_PREFIX=/docs
and product path/aidbox
- The full product URL becomes:
https://example.com/docs/aidbox