π§ Sphinx IntegrationΒΆ
How to integrate Introligo with your Sphinx project
What is Sphinx?ΒΆ
Sphinx is a powerful documentation generator that converts reStructuredText (RST) files into beautiful HTML, PDF, and other formats. Itβs the standard tool for Python documentation and is used by thousands of projects.
Introligo makes Sphinx even easier by: - Auto-generating complex RST structures from simple YAML - Automatically creating conf.py configuration files - Managing themes and color palettes - Organizing hierarchical documentation
Why Use Introligo with Sphinx?ΒΆ
Traditional Sphinx WorkflowΒΆ
1. Write RST files manually
2. Create and maintain conf.py
3. Manage toctree directives
4. Keep navigation in sync
5. Update theme configuration
Introligo WorkflowΒΆ
1. Write simple YAML configuration
2. Run: python -m introligo config.yaml -o docs
3. Run: sphinx-build -b html docs docs/_build/html
Thatβs it! Introligo handles: - β RST file generation - β conf.py creation - β Theme configuration - β Navigation structure - β Color palette management
What Youβll LearnΒΆ
In this tutorial, youβll learn how to:
Set Up Sphinx with Introligo - Install dependencies - Create your first configuration - Generate documentation
Configure Sphinx Settings - Project information - Extensions and features - Build options
Work with Themes and Colors - Choose and configure themes - Use built-in color palettes - Create custom palettes
Advanced Features - Autodoc for Python API docs - Breathe for C/C++ documentation - Custom extensions - Multi-language support
PrerequisitesΒΆ
Before starting, you should have: - Python 3.8 or higher installed - Basic understanding of YAML syntax - Familiarity with command-line tools - (Optional) Knowledge of reStructuredText
InstallationΒΆ
Install Introligo and Sphinx:
# Install required packages
pip install PyYAML jinja2 sphinx furo
# Optional: For C/C++ documentation
pip install breathe
Your First DocumentationΒΆ
Letβs create a minimal documentation project:
Step 1: Create ConfigurationΒΆ
Create introligo_config.yaml:
index:
title: "My Project Documentation"
description: "A simple documentation project"
generate_index: true
sphinx:
project: "My Project"
author: "Your Name"
html_theme: "furo"
palette: "celin"
extensions:
- "sphinx.ext.autodoc"
modules:
getting_started:
title: "Getting Started"
description: "Introduction to my project"
overview: |
Welcome to my project! This documentation will help you get started.
Step 2: Generate DocumentationΒΆ
# Generate RST files and conf.py
python -m introligo introligo_config.yaml -o docs
# Build HTML
cd docs
sphinx-build -b html . _build/html
Step 3: View Your DocumentationΒΆ
# Serve locally
python -m http.server 8000 --directory _build/html
Open http://localhost:8000 in your browser!
What Just Happened?ΒΆ
When you ran Introligo:
Generated RST files - Created structured documentation pages
Created conf.py - Sphinx configuration with your settings
Applied Celin palette - Beautiful cosmic colors automatically configured
Built navigation - Hierarchical structure with toctrees
When you ran Sphinx:
Processed RST files - Converted to HTML
Applied Furo theme - Modern, responsive design
Added colors - Your chosen palette (Celin)
Generated search - Full-text search functionality
Next StepsΒΆ
Now that you have basic documentation working:
Explore Themes - Try different Sphinx themes
Add Content - Create more documentation pages
Customize Colors - Use or create color palettes
Enable Features - Add extensions like autodoc
Continue to the next section to learn more about Sphinx configuration!