Help & Troubleshooting
Get help with common issues and questions about OkiDoki.
Quick Solutions
Installation Issues
Problem: npm install -g okidoki
fails with permission errors
# Solution 1: Use npx to run without installation (recommended)
npx okidoki init
npx okidoki generate
# etc.
# Solution 2: Configure npm to use a different directory
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
npm install -g okidoki
# Solution 3: Use sudo (not recommended)
sudo npm install -g okidoki
Problem: “okidoki command not found” after installation
# Check if it's installed
npm list -g --depth=0 | grep okidoki
# If installed but not found, check your PATH
echo $PATH
which okidoki
# Add npm global bin to PATH
export PATH=$(npm config get prefix)/bin:$PATH
Build Issues
Problem: okidoki generate
fails with “file not found” error
- Check: Ensure you’re in the project root directory
- Check: Verify
okidoki.yaml
andsidebars.yaml
exist - Check: Confirm
docs/
directory exists with markdown files
Problem: Generated site has broken links
- Check: Verify all links in
sidebars.yaml
point to existing files - Check: Ensure file paths use forward slashes, even on Windows
- Check: Verify image paths are correct relative to
docs/
directory - GitHub Pages: If deploying to
username.github.io/repository-name
, addbaseUrl: "/repository-name/"
tookidoki.yaml
Problem: Build is slow or hangs
- Check: Large image files in docs directory (compress them)
- Check: Too many files in docs directory (organize in subdirectories)
- Solution: Run
okidoki generate --verbose
(or-v
) for detailed output
CLI Reference
Command: okidoki init
Initialize a new documentation project with the following options:
Option | Short | Description | Default |
---|---|---|---|
--output |
-o |
Output directory | (current directory) |
--config |
-c |
Path to create okidoki configuration file | "okidoki.yaml" |
--sidebars |
-b |
Path to create sidebars configuration file | "sidebars.yaml" |
--dev |
-d |
Create a package.json with development scripts (nodemon, concurrently) | false |
--help |
Show help information | ||
--version |
Show version number |
Usage Examples
# Initialize in current directory
okidoki init
# Initialize in a specific directory
okidoki init --output ./my-docs
# Create with custom config file names
okidoki init --config ./config.yaml --sidebars ./navigation.yaml
# Include development setup with package.json
okidoki init --dev
# Initialize with all options
okidoki init -o ./documentation -c ./my-config.yaml -b ./my-sidebars.yaml -d
The init
command creates:
okidoki.yaml
- Main configuration filesidebars.yaml
- Navigation structure filedocs/
directory with sample markdown filespackage.json
with development scripts (when using--dev
)
Command: okidoki generate
Generate documentation from markdown files. This command automatically creates:
- Static HTML files for all markdown documents
- Search index for full-text search functionality
sitemap.xml
for SEO and search engine indexing- Optimized CSS and JavaScript bundles
Options:
Option | Short | Description | Default |
---|---|---|---|
--source |
-s |
Source directory containing markdown files | "docs" |
--output |
-o |
Output directory for generated files | (auto-generated) |
--config |
-c |
Path to okidoki configuration file | "okidoki.yaml" |
--sidebars |
-b |
Path to sidebars configuration file | "sidebars.yaml" |
--verbose |
-v |
Enable verbose logging | false |
--help |
Show help information | ||
--version |
Show version number |
Usage Examples
# Basic usage (uses default settings)
okidoki generate
# Specify custom directories
okidoki generate --source ./documentation --output ./website
# Use custom configuration files
okidoki generate --config ./config/okidoki.yaml --sidebars ./config/nav.yaml
# Enable verbose logging for troubleshooting
okidoki generate -v
# Combine multiple options
okidoki generate -s ./docs -o ./public -c ./my-config.yaml -v
Command: okidoki openapi
Convert OpenAPI specification files to structured markdown documentation. This command automatically:
- Parses OpenAPI 3.x specification files (JSON or YAML format)
- Generates comprehensive API documentation
- Integrates seamlessly with your existing documentation structure
- Updates navigation configuration automatically
Options:
Option | Short | Description | Default |
---|---|---|---|
--input |
-i |
Path to OpenAPI specification file (JSON or YAML) | (required) |
--output |
-o |
Output markdown file path | (auto-generated) |
--title |
-t |
Title for the generated documentation | (auto-generated) |
--description |
-d |
Description for the generated documentation | (auto-generated) |
--docs |
Target docs directory | "docs" |
|
--sidebars |
-b |
Path to sidebars configuration file | "sidebars.yaml" |
--config |
-c |
Path to okidoki configuration file | "okidoki.yaml" |
--help |
Show help information | ||
--version |
Show version number |
Usage Examples
# Convert OpenAPI spec to markdown (basic usage)
okidoki openapi -i api-spec.yaml
# Specify custom output file and title
okidoki openapi -i api-spec.json -o my-api-docs.md -t "My API Reference"
# Full customization with description
okidoki openapi -i openapi.yaml -o api-reference.md -t "Complete API Guide" -d "Full documentation for our REST API"
# Custom docs directory and config files
okidoki openapi -i spec.yaml --docs documentation -c config/okidoki.yaml -b config/nav.yaml
Frequently Asked Questions
General Questions
Q: What file formats does OkiDoki support? A: OkiDoki primarily works with Markdown (.md) files. Images (PNG, JPG, GIF, SVG) and other assets are supported in the docs directory.
Q: Can I use custom CSS or JavaScript? A: Currently, OkiDoki uses built-in themes. Custom styling options may be added in future versions.
Q: How do I change the theme?
A: Edit the theme
section in your okidoki.yaml
file:
site:
theme:
light: "fantasy"
dark: "forest"
Q: Can I have multiple documentation sites?
A: Yes! Each site needs its own directory with separate okidoki.yaml
and sidebars.yaml
files.
Q: How do I add a favicon?
A: Add your favicon file to the docs directory and reference it in okidoki.yaml
:
site:
favicon: "favicon.ico"
Configuration Questions
Q: How do I organize my documentation into sections?
A: Use the hierarchical structure in sidebars.yaml
:
menu:
- title: "Getting Started"
items:
- title: "Installation"
document: "/install.md"
- title: "Quick Start"
document: "/quickstart.md"
Q: Can I link to external websites?
A: Yes! Use the url
property instead of document
:
menu:
- title: "GitHub Repository"
url: "https://github.com/example/repo"
Q: How do I use global variables?
A: Define them in okidoki.yaml
and use in markdown:
globals:
version: "1.0.0"
api_url: "https://api.example.com"
Then in markdown: Current version: 1.1.34
Content Questions
Q: How do I add syntax highlighting to code blocks? A: Specify the language after the opening backticks:
```javascript
function hello() {
console.log("Hello, world!");
}
```
Q: Can I include HTML in my markdown? A: Yes, standard HTML tags work within markdown files.
Q: How do I create tables? A: Use standard markdown table syntax:
| Header 1 | Header 2 |
|----------|----------|
| Cell 1 | Cell 2 |
Q: How do I add badges to my documentation? A: Use the Handlebars badge helper:
{{badge "My Badge Text" "primary"}}
Or inline: Some text {{badge "Active" "success"}} more text
Common Error Messages
“Invalid YAML syntax”
Error: Configuration file has syntax errors Solutions:
- Validate your YAML using an online YAML validator
- Check for proper indentation (use spaces, not tabs)
- Ensure all strings with special characters are quoted
“Document not found”
Error: Referenced markdown file doesn’t exist Solutions:
- Check the file path in
sidebars.yaml
- Verify the file exists in the docs directory
- Check for typos in filename or path
“Permission denied”
Error: Can’t write to output directory Solutions:
- Check directory permissions:
ls -la dist/
- Try running with elevated permissions
- Change output directory in
okidoki.yaml
“Theme not found”
Error: Specified theme doesn’t exist Solutions:
- Check available themes in the reference documentation
- Verify spelling in
okidoki.yaml
- Use default themes:
fantasy
(light) orforest
(dark)
Sidebar badges showing “undefined”
Error: Badge text in sidebars.yaml shows as “undefined” in navigation Cause: Using incorrect badge format (string instead of object) Solution: Use the correct badge object format:
# ❌ Incorrect (shows "undefined")
menu:
- title: "Features"
document: /features.md
badge: "new"
# ✅ Correct format
menu:
- title: "Features"
document: /features.md
badge:
variant: "info"
text: "new"
Available badge variants: info
, success
, warning
, error
, neutral
Badge syntax not working
Error: {{badge "My Badge" "xxprimaryxx"}}
not rendering properly
Solutions:
- Ensure you’re using the correct badge syntax with three colons
- Check that badges are supported in your version of OkiDoki
- Try using inline badges:
{{badge "Status: Active" "success"}} within text
- Verify the badge type exists (primary, secondary, accent, info, success, warning, error)
Performance Issues
Slow Build Times
Symptoms: okidoki generate
takes more than a few seconds
Solutions:
- Optimize images: Compress large images or use web-optimized formats
- Reduce file count: Organize content into fewer, larger files
- Clean output: Delete and regenerate the
dist/
directory - Check system resources: Ensure sufficient RAM and disk space
Large Generated Sites
Symptoms: dist/
directory is unexpectedly large
Solutions:
- Compress images: Use tools like
imageoptim
or online compressors - Remove unnecessary files: Clean up docs directory of unused assets
- Check duplicates: Ensure no duplicate images or files
Getting Support
Before Asking for Help
- Check this help page - Many common issues are covered here
- Review the error message - Often contains helpful information
- Try the verbose flag - Run
okidoki generate --verbose
(or-v
) for detailed output - Check file permissions - Ensure OkiDoki can read/write necessary files
Reporting Issues
When reporting a problem, please include:
- OkiDoki version:
okidoki --version
- Operating system: (Windows, macOS, Linux)
- Node.js version:
node --version
- Error message: Full error text
- Configuration files: Your
okidoki.yaml
andsidebars.yaml
- Steps to reproduce: What you did when the error occurred
Community Resources
- Documentation: Reference Guide
- Examples: Markdown Examples
- Getting Started: Quick Start Guide
Debug Mode
Enable verbose logging to troubleshoot build issues:
# Enable debug output (long form)
okidoki generate --verbose
# Enable debug output (short form)
okidoki generate -v
# Alternative: set environment variable
DEBUG=okidoki okidoki generate
This will show:
- File processing steps
- Theme loading information
- Search index generation
- Asset copying details
Version Information
Current OkiDoki version: 1.1.34
Compatibility
- Node.js: Requires version 14 or higher
- Browsers: Modern browsers (Chrome, Firefox, Safari, Edge)
- Operating Systems: Windows, macOS, Linux
Reset and Clean Installation
If you’re experiencing persistent issues, try a clean installation:
# Uninstall OkiDoki
npm uninstall -g okidoki
# Clear npm cache
npm cache clean --force
# Reinstall OkiDoki
npm install -g okidoki
# Verify installation
okidoki --version
For project-specific issues:
# Remove generated files
rm -rf dist/
# Regenerate documentation
okidoki generate
Still need help? Check the Quick Start Guide or review the complete Documentation Reference.