Phantom Documentation Kit¶
This kit was developed to provide an easy and unique documentation experience for the Phantom Wireguard software documentation process.
When the industrial power and flexibility of the MkDocs library met our needs, the Phantom Documentation Kit was born.
The features and components we needed in the documentation process were developed and gathered under this framework.
Quick Start¶
Prerequisites¶
Python Packages¶
Install the required Python packages by running the following command in the project directory:
Node.js Installation¶
The Vendor Builder and Image Optimizer tools in Phantom Documentation Kit require
Node.js 22 or higher. For more detailed information about these tools,
you can refer to the Tools documentation.
- Check your current version:
node --version - Download Node.js: https://nodejs.org/en/download
1. Development Server (serve.py)¶
To view and develop your documentation locally:
Open http://localhost:8000 in your browser.
2. Building Documentation (build.py)¶
To generate production-ready static HTML:
The compiled files are created in the outputs/site/ directory.
Configuration (config.json)¶
Edit the config.json file to customize project settings:
{
"paths": {
"output_dir": "outputs/www",
"vendor_dir": "overrides/assets/vendor",
"vendor_builder_dir": "tools/vendor-builder"
},
"build": {
"clean_before_build": true,
"check_vendor_dependencies": true
},
"serve": {
"port": 8000,
"host": "localhost",
"check_vendor_dependencies": true
},
"docker": {
"image_name": "phantom-docs-kit",
"build_tag": "latest",
"container_prefix": "phantom-docs"
},
"logging": {
"enabled": true,
"console_level": "INFO",
"file_level": "DEBUG",
"log_directory": "logs",
"max_file_size": "10MB",
"backup_count": 5,
"timestamp_format": "%Y-%m-%d %H:%M:%S",
"log_filename_pattern": "phantom-{mode}-{date}-{time}.log"
}
}
Advanced Usage¶
Running with Docker¶
Execute the following commands to run easily on Docker.
Running in Remote Environments with Docker¶
If you want to work in a remote environment with Docker, Mutagen installation is required for file synchronization and port forwarding. Mutagen enables you to work in a remote Docker environment as if you were working in your local environment.
To install Mutagen on your Mac device, run the following command:
After installation is complete, run the following command in Terminal to verify the installation status:
Docker SDK and Mutagen will recognize your remote server through the DOCKER_HOST environment variable.
SSH access must be established without any obstacles between your development device and the remote server with Docker installed.
Example steps are below:
If you don't have an SSH key, generate one on your local machine:
Copy the public key to the remote server:
Test your connection:
If you've successfully reached this point, define the DOCKER_HOST environment variable with
your remote server's information:
Then ensure you're in the project directory and run the serve command:
Phantom Documentation Kit
Terminal RecordingRun the following command for build:
Phantom Documentation Kit
Terminal RecordingOne important detail to note is that when you build in a remote environment with Docker, the build outputs
are saved in the output directory archived as phantom-docs-build-docker-remote-{timestamp}.tar.gz.
Command Parameters¶
| Parameter | Description |
|---|---|
--docker |
Run inside Docker container |
--verbose |
Detailed log output |
--quiet |
Minimal log output |
System Requirements¶
- Python 3.8+
- Node.js 22+
- Docker (optional)
First Run¶
When running for the first time, the system automatically:
- Checks for missing dependencies
- Compiles vendor files (JavaScript/CSS)
- Starts the MkDocs server