Move a Sphinx project to Guidedog¶
Guidedog is designed with Sphinx compatibility in mind. It uses the familiar directory structure, understands standard reStructuredText and MyST Markdown markup, recognizes the same configuration setting names, and implements Sphinx’s Jinja template variables.
However, there is an essential architectural difference: Sphinx executes arbitrary
Python code in conf.py and relies on a Python virtual environment with external packages.
Guidedog, by contrast, operates as a standalone compiled executable that reads pure data
from conf.toml. It does not execute Python scripts.
Migrating a project therefore centers on separating declarative configuration data from executable Python logic.
Migration workflow¶
The migration process follows a structured sequence:
Step 1: Automated configuration migration¶
Guidedog provides an automated migration tool that parses your existing conf.py:
guidedog migrate path/to/conf.py
What guidedog migrate does:
- It extracts literal configuration values (strings, numbers, booleans, lists, and tables)
and converts them to standard TOML syntax in
conf.toml. - It detects standard Sphinx settings (such as
project,author,extensions,templates_path,html_theme,intersphinx_mapping, andhtml_context) and maps them cleanly. - It identifies dynamically computed expressions (such as Python calls like
version = get_version()orgit_revision = subprocess.check_output(...)). Because Guidedog does not execute Python, it flags these computed values in its migration report so you can provide explicit, static values inconf.toml.
Review the generated conf.toml and replace any flagged expressions with static values.
Step 2: The three-pass verification strategy¶
Once conf.toml is created, work through the migration in three focused passes:
Pass 1: Verify the document graph¶
Check that Guidedog discovers all documents and builds the expected hierarchy:
-
Verify that
root_docpoints to your primary entry point (usuallyindexorcontents). -
Confirm that
source_suffixlists all extensions you use (for example,[".rst", ".md"]). -
Check
exclude_patternsto ensure build folders, virtual environments, and temporary files are excluded. -
Run a quick semantic check using the dummy builder:
guidedog build dummy path/to/docs -n -W
The dummy builder checks every document and link without writing HTML files. Address any warnings about missing documents or malformed file includes.
Pass 2: Verify references, domains, and custom objects¶
Next, verify that cross-references and domain directives resolve:
- Standard domains: Guidedog natively supports the standard Python, C, C++, and JavaScript
domains, along with standard role syntax like
:py:func:,:c:type:, and:cpp:class:. - Intersphinx links: If your Sphinx project linked to external documentation via Intersphinx,
keep your
[intersphinx_mapping]inconf.toml. Guidedog fetches and parses standardobjects.invfiles natively. - Declarative custom object types: In Sphinx, projects often wrote small Python extensions
calling
app.add_object_type()to create custom directives and roles (such as.. confval::or.. setting::). In Guidedog, you define these declaratively inconf.tomlunder[[object_types]]without writing any code. See Declaring object types.
Pass 3: Verify presentation and templates¶
Finally, verify the rendered visual appearance:
-
HTML website: Run
guidedog build html path/to/docs -Wand inspect the generated pages. -
Jinja templates: Guidedog’s native Jinja engine supports block inheritance:
{% extends "!layout.html" %} {% block extrahead %} <link rel="stylesheet" href="{{ pathto('_static/custom.css', 1) }}"> {% endblock %} -
PDF books: Build a PDF book with
guidedog build pdf path/to/docs -W. Guidedog typesets the book using Typst and_templates/book.typ, providing instant vector math, proper hyphenation, and running headers without requiring a LaTeX installation.
Configuration settings mapping¶
Here is how common Sphinx conf.py variables correspond to Guidedog’s conf.toml:
| Sphinx (conf.py) | Guidedog (conf.toml) | Notes |
|---|---|---|
project = 'Manual' |
project = "Manual" |
Standard string setting. |
version = '1.0' |
version = "1.0" |
Documented version number. |
extensions = [...] |
extensions = [...] |
Built-in extensions (graphviz, mathjax, intersphinx, myst_parser). |
source_suffix = ['.rst', '.md'] |
source_suffix = [".rst", ".md"] |
Supported source formats. |
root_doc = 'index' |
root_doc = "index" |
Entry document name (without extension). |
html_static_path = ['_static'] |
html_static_path = ["_static"] |
Custom styles and script folders. |
templates_path = ['_templates'] |
templates_path = ["_templates"] |
Jinja template directory. |
html_context = {...} |
[html_context] |
Passed directly to Jinja templates. |
Handling custom Python extensions¶
If your Sphinx documentation relies on extensive Python extensions that inspect Python ASTs or modify Sphinx internal classes, evaluate your options:
- Declarative object types: If the extension simply created custom directives or roles,
replace it with
[[object_types]]inconf.toml. - Build plugins (Guidedog 0.6.2): If your extension transformed source text, injected custom HTML wrappers, or generated static assets, implement a native build plugin in Odin using the typed plugin interface described in Write a native plugin.
- Static API extraction: Guidedog already reads Python docstrings and Odin declarations without running the documented code. Use Document a codebase. Runtime-generated objects may need explicit RST descriptions.
See Compatibility with Sphinx for a detailed breakdown of Sphinx compatibility evidence and retained limitations.