Your first project¶
This tutorial guides you through creating, writing, and building your first documentation project with Guidedog. The goal is modest and clear: start from a clean directory, generate both an HTML website and a printable PDF book from the same source file, and experience the live preview server.
You need a working installation of Guidedog. For PDF output, Guidedog can use its embedded compiler or an installed Typst binary (0.15.1 or newer). See Build and install Guidedog.
On macOS, you can install the official release using Homebrew:
brew install insanai/guidedog/guidedog
Project architecture and build pipeline¶
Guidedog takes a single directory of source files and compiles it into two distinct artifacts: a responsive HTML website and a typeset PDF book.
1. Create the project¶
Run the quickstart command from a folder where the target directory notes does
not yet exist:
guidedog quickstart notes -q -p "Field Notes" -a "Your name" -v 1.0
Guidedog creates a complete, self-contained project structure:
notes/
conf.toml
index.rst
_templates/
layout.html
book.typ
_static/
guidedog.css
guidedog.js
assets/
images/
audio/
video/
Understanding the files:
conf.toml: Project settings (title, author, version, language, builders).index.rst: The root document that defines your front page and table of contents._templates/layout.html: The HTML website template (Jinja)._templates/book.typ: The PDF book layout and typography template (Typst)._static/: CSS stylesheets and JavaScript enhancements.assets/: Dedicated folders for project images, diagrams, audio, and video files.
Templates in Guidedog are directly visible and editable. They are placed directly inside
your project rather than hidden within an external theme or system cache. You can modify
them at any time to customize your site and book design.
The first build creates _build for generated output.
2. Write the first page¶
Open notes/index.rst in your editor and replace its contents with the following:
Field Notes
===========
A clear explanation begins with a simple example.
Measuring a square
------------------
If the side has length :math:`s`, its area is :math:`s^2`.
.. math::
A = s^2
.. note::
State the measurement units before comparing calculations.
This page demonstrates headings, mathematical notation, and an admonition note.
3. Build and inspect the outputs¶
Compile your project into both HTML and PDF formats:
guidedog build html notes -W
guidedog build pdf notes -W
The -W flag instructs Guidedog to treat warnings as errors. Keeping this flag enabled
in your routine checks ensures that broken references or markup errors are caught early.
Now inspect the output files:
- Open
notes/_build/html/index.htmlin your web browser. You will see a clean, responsive documentation website with a theme switch, search bar, and formatted math. - Open the PDF file generated in
notes/_build/pdf/. You will see a book layout complete with running headers, page numbers, and typographic math.
Guidedog formats mathematics appropriately for each medium: using client-side MathJax for the browser, and native vector formulas for the Typst PDF engine.
4. Live preview and incremental rebuilds¶
Guidedog includes a built-in development web server:
guidedog serve notes
The terminal prints a local URL, such as http://localhost:8000. Open this address in
your browser.
Now test the live editing loop:
- Edit
notes/index.rstto add a new paragraph. - Save the file.
- Refresh your browser page.
Before serving a requested page, Guidedog checks file modification timestamps against its cached build environment. If inputs have changed, it rebuilds only the affected documents before responding to the browser request.
When you run a build without modifying any files, Guidedog reuses the cached document trees, avoiding redundant re-parsing.
Press Ctrl+C in your terminal to stop the server when you are done.
Continue to Make a small book to learn how to organize multiple chapters and cross-references.