# Quick start

This quick start creates a DocInsight project that combines a Markdown guide with API reference generated from one or more existing Delphi projects. Follow it to check the project, build the HTML site, and open the site in your browser. If you have not installed DocInsight yet, see Install DocInsight.

If you already have a legacy `.diproj` manifest, skip the template workflow and migrate the existing project.

## Create a documentation project

Open a terminal in the repository root that contains your Delphi projects, then run:

shell

    docinsight init --template delphi

The initializer guides you through three settings:

1. Enter the path to an existing `.groupproj`, `.dproj`, `.dpr`, or `.dpk` file, relative to the repository root, such as `Packages/MyLibrary.dproj`.

2. Select the Delphi compiler version used by the project, such as `delphi_13`.

3. Select the target platform to analyze, such as `Win32`.

DocInsight derives the project name and title from the current directory name. Pass `--name` and `--title` to set them explicitly:

shell

    docinsight init --template delphi --name my-library --title "My Library"

The examples below assume the project root folder is named `my-library`, with `Packages/MyLibrary.dproj` selected for Delphi 13 and Win32.

The `delphi` template creates `docinsight.json` and a starter Markdown guide alongside the existing Delphi project:

text

    my-library/
    |-- docinsight.json
    |-- docs/
    |   |-- overview.md
    |   `-- toc.md
    `-- Packages/
        `-- MyLibrary.dproj

The generated manifest defines a Delphi source, Markdown guide content, Delphi API content, and an HTML output target that contains both:

json

    {
      "edition": "2026",
      "project": {
        "name": "my-library",
        "title": "My Library"
      },
      "sources": {
        "main": {
          "type": "delphi",
          "files": ["Packages/MyLibrary.dproj"],
          "options": {
            "compiler": "delphi_13",
            "platform": "Win32"
          }
        }
      },
      "content": {
        "docs": {
          "title": "Guide",
          "type": "markdown",
          "root": "docs",
          "mount": "/"
        },
        "api": {
          "title": "API Reference",
          "type": "delphi",
          "source": "main"
        }
      },
      "output": {
        "default_targets": ["site"],
        "targets": {
          "site": {
            "type": "html",
            "path": "dist/docs/site",
            "content": ["docs", "api"]
          }
        }
      }
    }

The generated `docs/overview.md` is the first guide topic. The generated `docs/toc.md` makes it the default topic and places it in the navigation. Edit these files as the guide grows.

### Create a Markdown-only project

If you only need Markdown documentation, use the `markdown` template instead:

shell

    docinsight init --template markdown

## Migrate a legacy project

Import an existing `.diproj` manifest instead of selecting a template:

shell

    docinsight init --from-legacy MyLibrary.diproj

DocInsight converts the legacy configuration to `docinsight.json` and creates starter Markdown guide files when needed.

## Check the documentation project

Run `docinsight check` before building or publishing:

shell

    docinsight check

The check command validates the project manifest, configured content, and source files without writing generated output. It analyzes the selected Delphi source and reports documentation problems it finds there.

If the command exits successfully, the project passed validation. Depending on the configured content and verbosity, a clean project may produce little or no output.

## Build and open the site

Build the default output target:

console

    $ docinsight build

    Building MyLibrary...

    ✓ Built   site  dist/docs/site  103 pages

    Built MyLibrary in 0.1s.
    1 target built; 0 errors, 0 warnings.

The generated site is written to `dist/docs/site` and includes both the Markdown guide and Delphi API reference.

Open the generated site in your default browser:

shell

    docinsight open

## Next steps

- Learn how project manifests are organized in Project manifest.

- Learn how Markdown topics are structured in Markdown topics.

- Learn how Delphi comments become generated reference pages in Delphi API documentation.