{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "AbbayeConfig",
  "description": "A full configuration for the Abbaye site generator.\n\nHere's a sample configuration that works well as a starting point for rust projects:\n\n```toml\n[site]\nname = \"Abbaye\"\n\n[version_extractor]\ntype = \"cargo\" # extract version from Cargo.toml\n\n[changelog]\n# let's use the default changelog extractor\n\n[[builders]]\ntype = \"cargo\" # calls `cargo build --release` for each target\ntargets = [\"x86_64-unknown-linux-gnu\", \"x86_64-unknown-linux-musl\"]\n[[builders]]\ntype = \"cargo_doc\" # generates documentation using `cargo doc`\nno_deps = true\n\n[[builders]]\ntype = \"archive\" # creates a compressed tarball of the source code\n```\n\nYou can learn more about each builder type in the [builders module documentation](crate::builders).",
  "type": "object",
  "properties": {
    "builders": {
      "description": "Builders to run during the build process.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/BuilderEntry"
      }
    },
    "changelog": {
      "description": "Configuration for the changelog extractor.",
      "allOf": [
        {
          "$ref": "#/definitions/ChangelogConfig"
        }
      ]
    },
    "git_ui": {
      "description": "Optional git repository web UI. When present, abbaye generates browsable HTML\npages at `<output>/repository/` and a clonable bare repository at\n`<output>/repository.git/`.",
      "anyOf": [
        {
          "$ref": "#/definitions/GitUiConfig"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "site": {
      "description": "Metadata about the site.",
      "allOf": [
        {
          "$ref": "#/definitions/SiteConfig"
        }
      ]
    },
    "version_extractor": {
      "description": "which version extractor to use to extract the version(s) of the project",
      "allOf": [
        {
          "$ref": "#/definitions/AnyVersionExtractor"
        }
      ]
    }
  },
  "required": [
    "site",
    "version_extractor",
    "changelog",
    "builders"
  ],
  "definitions": {
    "AnyVersionExtractor": {
      "oneOf": [
        {
          "description": "Reads the version from the `version` field in the `[package]` section\nof a `Cargo.toml` file.\n\n```toml\n[version_extractor]\ntype = \"cargo\"\nmanifest_path = \"Cargo.toml\" # optional, defaults to ./Cargo.toml\n```",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "cargo"
            }
          },
          "allOf": [
            {
              "$ref": "#/definitions/CargoVersionConfig"
            }
          ],
          "required": [
            "type"
          ]
        },
        {
          "description": "Derives the version from the most recent Git tag using\n`git describe --tags --always`.\nSupports stripping a tag prefix (e.g. `\"v\"`) and customising the\nsuffix appended when the working tree has uncommitted changes.\n\n```toml\n[version_extractor]\ntype = \"git\"\ntag_prefix = \"v\"      # optional, strips leading \"v\"\ndirty_suffix = \"-dev\" # optional, defaults to \"-dirty\"\n```",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "git"
            }
          },
          "allOf": [
            {
              "$ref": "#/definitions/GitVersionConfig"
            }
          ],
          "required": [
            "type"
          ]
        }
      ]
    },
    "ArchiveBuilderConfig": {
      "description": "Configuration for [`ArchiveBuilder`].",
      "type": "object",
      "properties": {
        "ignore_patterns": {
          "description": "Glob patterns for files and directories to exclude from the archive.\nEach pattern is matched against every component of a path, so a pattern\nlike `\".git\"` excludes the `.git` directory and all its contents, and\n`\"*.local\"` excludes any entry whose name ends with `.local`.\nDefaults to `[\".git\", \"*.local\"]`.",
          "type": "array",
          "default": [
            ".git",
            "*.local"
          ],
          "items": {
            "type": "string"
          }
        },
        "output": {
          "description": "Output path for the generated `.tar.gz` archive.\nDefaults to `source.tar.gz` in the current working directory.",
          "type": [
            "string",
            "null"
          ]
        },
        "prefix": {
          "description": "Prefix applied to every entry path inside the archive.\nFor example, `\"myproject-1.0.0\"` produces entries like\n`myproject-1.0.0/src/main.rs`.\nDefaults to the source directory's name.",
          "type": [
            "string",
            "null"
          ]
        },
        "source_dir": {
          "description": "Root directory to archive. Defaults to the current working directory.",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "BuilderEntry": {
      "description": "A single `[[builders]]` entry: the builder itself plus optional dependency\nmetadata.\n\n# Dependency ordering\n\nBy default every builder runs concurrently with all others.  When a builder\nmust only start *after* another one has finished successfully, give the\nprerequisite an `id` and list that id in the dependent's `depends_on`:\n\n```toml\n[[builders]]\ntype = \"cargo\"\nid   = \"compile\"               # ← give this builder a name\n\n[[builders]]\ntype   = \"script\"\nscript = [\"strip target/release/my_bin\"]\noutputs = [\"target/release/my_bin\"]\ndepends_on = [\"compile\"]       # ← wait for the builder above\n```\n\nCircular dependencies are detected before any builder starts and reported\nas an error.",
      "type": "object",
      "properties": {
        "depends_on": {
          "description": "IDs of builders that must complete successfully before this one starts.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "id": {
          "description": "Optional identifier for this builder.  Other builders reference this\nstring in their `depends_on` list.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "oneOf": [
        {
          "description": "Creates a `.tar.gz` archive of the source tree, automatically excluding\nfiles and directories matched by any `.gitignore` found in the hierarchy.\n\n```toml\n[[builders]]\ntype = \"archive\"\nsource_dir = \".\"                      # optional, defaults to CWD\noutput = \"myproject-1.0.0.tar.gz\"     # optional, defaults to source.tar.gz\nprefix = \"myproject-1.0.0\"            # optional, defaults to source_dir name\n```",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "archive"
            }
          },
          "allOf": [
            {
              "$ref": "#/definitions/ArchiveBuilderConfig"
            }
          ],
          "required": [
            "type"
          ]
        },
        {
          "description": "Compiles the crate in release mode with `cargo build --release`.\nOne or more target triples can be specified for cross-compilation;\nomitting `targets` builds for the host platform.\n\n```toml\n[[builders]]\ntype = \"cargo\"\ntargets = [\"x86_64-unknown-linux-musl\", \"aarch64-unknown-linux-musl\"]\nmanifest_path = \"Cargo.toml\"          # optional\n```",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "cargo"
            }
          },
          "allOf": [
            {
              "$ref": "#/definitions/CargoBuilderConfig"
            }
          ],
          "required": [
            "type"
          ]
        },
        {
          "description": "Generates API documentation with `cargo doc`.\nReturns the per-crate doc directory (e.g. `target/doc/my_crate`) as an\nartifact so it can be published or archived by a later pipeline step.\n\n```toml\n[[builders]]\ntype = \"cargo_doc\"\nno_deps = true                        # optional, skip dependency docs\nmanifest_path = \"Cargo.toml\"          # optional\n```",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "cargo_doc"
            }
          },
          "allOf": [
            {
              "$ref": "#/definitions/CargoDocBuilderConfig"
            }
          ],
          "required": [
            "type"
          ]
        },
        {
          "description": "Runs an arbitrary sequence of shell commands and collects declared\noutput paths as release artifacts.\n\nEach script line is passed to `sh -c`; the build fails immediately if\nany command exits with a non-zero status.\n\n```toml\n[[builders]]\ntype = \"script\"\nscript = [\n  \"make release\",\n  \"strip target/mybin\",\n]\noutputs = [\"target/mybin\"]\n```",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "script"
            }
          },
          "allOf": [
            {
              "$ref": "#/definitions/ScriptBuilderConfig"
            }
          ],
          "required": [
            "type"
          ]
        },
        {
          "description": "Renders a directory of Markdown files to standalone HTML5 documents.\n\nEvery `.md` file is rendered to a mirrored `.html` file in the output\ndirectory.  Non-Markdown files referenced by local links or image\nembeds are copied to the output directory so that relative URLs remain\nvalid.  Files excluded by `.gitignore` rules are automatically skipped.\n\n```toml\n[[builders]]\ntype      = \"markdown\"\ninput     = \"docs/\"\noutput    = \"docs-html/\" # optional\nrecursive = true         # optional, default true\n```",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "markdown"
            }
          },
          "allOf": [
            {
              "$ref": "#/definitions/MarkdownBuilderConfig"
            }
          ],
          "required": [
            "type"
          ]
        }
      ]
    },
    "CargoBuilderConfig": {
      "description": "Configuration for [`CargoBuilder`].",
      "type": "object",
      "properties": {
        "bins": {
          "description": "Restrict collected artifacts to these binary (or cdylib) target names.\n\nWhen empty every artifact produced by a **workspace member or local\npath-dependency** is kept. Use this to avoid picking up extra binaries\nfrom dev-tools or examples that live in the same workspace.\n\n```toml\n[[builders]]\ntype = \"cargo\"\nbins = [\"my_binary\", \"my_cdylib\"]\n```",
          "type": "array",
          "default": [],
          "items": {
            "type": "string"
          }
        },
        "manifest_path": {
          "description": "Optional path to the Cargo.toml manifest.\n\nPassed verbatim as `--manifest-path`. Defaults to the manifest in the\ncurrent working directory when absent.",
          "type": [
            "string",
            "null"
          ]
        },
        "parallel": {
          "description": "Run cross-compilation targets in parallel using isolated temporary\ntarget directories.\n\nWhen `true` (the default), each target triple is given its own\n`--target-dir` backed by a [`tempfile::TempDir`], so multiple\n`cargo build` processes can compile simultaneously without contending\non cargo's file lock (`target/.cargo-lock`).  Compiled artifacts are\ncopied to the canonical `target/<triple>/release/` paths and the\ntemporary directories are then removed automatically.\n\nSet this to `false` when:\n\n- **Disk space is tight.** Each temporary build tree can occupy several\n  gigabytes for dependency-heavy crates. Four targets running in\n  parallel means roughly four times the peak disk usage of a single\n  build.\n- **Incremental compilation matters.** Temporary target directories\n  always start cold, discarding Rust's incremental cache. Disabling\n  parallelism lets all targets share the persistent `target/` directory\n  and reuse previously compiled artefacts on subsequent runs.\n- **The build host is resource-constrained.** Parallel `cargo build`\n  processes each consume significant CPU and RAM. On CI machines with\n  limited memory, running them sequentially avoids thrashing or\n  out-of-memory failures.\n- **Your cross-compilation toolchain is not concurrency-safe.** Some\n  custom linkers or build-script tools assume exclusive access and may\n  produce corrupt output when invoked concurrently.",
          "type": "boolean",
          "default": true
        },
        "targets": {
          "description": "Cargo target triples to build for (e.g. `\"x86_64-unknown-linux-musl\"`).\n\nEach entry is passed as `--target <triple>` in a separate `cargo build`\ninvocation. When the list is empty, cargo builds for the host target.",
          "type": "array",
          "default": [],
          "items": {
            "type": "string"
          }
        }
      }
    },
    "CargoDocBuilderConfig": {
      "description": "Configuration for [`CargoDocBuilder`].",
      "type": "object",
      "properties": {
        "manifest_path": {
          "description": "Optional path to the Cargo.toml manifest.\n\nPassed verbatim as `--manifest-path`. Defaults to the manifest in the\ncurrent working directory when absent.",
          "type": [
            "string",
            "null"
          ]
        },
        "no_deps": {
          "description": "Skip building documentation for dependencies (`--no-deps`).",
          "type": "boolean",
          "default": false
        }
      }
    },
    "CargoVersionConfig": {
      "description": "Configuration for [`CargoVersion`].",
      "type": "object",
      "properties": {
        "manifest_path": {
          "description": "Path to the `Cargo.toml` to read the version from.\nDefaults to `Cargo.toml` in the current working directory.",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "ChangelogConfig": {
      "description": "Configuration for [`ChangelogExtractor`].",
      "type": "object",
      "properties": {
        "directory": {
          "description": "Directory that contains the `CHANGELOG.md`.\nDefaults to the current working directory.",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "GitUiConfig": {
      "description": "Configuration for the git repository web UI.",
      "type": "object",
      "properties": {
        "clone_url": {
          "description": "Explicit clone URL displayed in the UI (e.g. `\"https://example.com/repository.git\"`).\nWhen absent, derived from `site.base_url` by appending `/repository.git`.",
          "type": [
            "string",
            "null"
          ]
        },
        "default_branch": {
          "type": "string",
          "default": "main"
        },
        "max_commits": {
          "description": "Maximum number of commits to show in the log page. Defaults to 200.",
          "type": "integer",
          "format": "uint",
          "default": 200,
          "minimum": 0
        },
        "repo_path": {
          "description": "Path to the git repository to read. Defaults to `.` (the current directory).",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "GitVersionConfig": {
      "description": "Configuration for [`GitVersion`].",
      "type": "object",
      "properties": {
        "dirty_suffix": {
          "description": "Suffix appended to the version when the working tree has uncommitted\nchanges. Forwarded verbatim as `--dirty=<suffix>` to `git describe`.\nDefaults to `\"-dirty\"`.",
          "type": "string",
          "default": "-dirty"
        },
        "tag_prefix": {
          "description": "Strip this prefix from the tag name before returning the version.\nFor example, `\"v\"` turns `\"v1.2.3\"` into `\"1.2.3\"`.",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "MarkdownBuilderConfig": {
      "description": "Configuration for [`MarkdownBuilder`].",
      "type": "object",
      "properties": {
        "input": {
          "description": "Directory containing `.md` files to render.\n\nEvery `.md` file in the directory is rendered to a corresponding\n`.html` file in the output directory, preserving the subdirectory\nstructure.  Non-Markdown files referenced (linked or embedded) inside\nany Markdown source — images, PDFs, downloadable assets, etc. — are\ncopied into the output directory next to the rendered HTML so that all\nrelative URLs remain valid.\n\nDefaults to `\".\"` (the current working directory).",
          "type": [
            "string",
            "null"
          ]
        },
        "output": {
          "description": "Directory to write rendered files into.\n\nDefaults to `<input-name>-html` placed next to the input directory.\n\n```toml\n[[builders]]\ntype   = \"markdown\"\ninput  = \"docs/\"\noutput = \"public/docs/\"\n```",
          "type": [
            "string",
            "null"
          ]
        },
        "recursive": {
          "description": "Also descend into subdirectories of `input`.\n\nDefaults to `true`. Files matched by a `.gitignore` in the directory\nhierarchy are always excluded, mirroring the behaviour of the `archive`\nbuilder.",
          "type": "boolean",
          "default": true
        }
      }
    },
    "OpenGraphConfig": {
      "description": "OpenGraph configuration for the website.",
      "type": "object",
      "properties": {
        "author": {
          "description": "Author of the website. Used on release notes pages to indicate the author.",
          "type": [
            "string",
            "null"
          ]
        },
        "image": {
          "description": "URL of the website's image.",
          "type": "string"
        },
        "image_alt_text": {
          "description": "Alt text for the website's image.",
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "description": "OpenGraph type of the website. It will be used as the `og:type` meta tag.\nNote: by default, the value \"website\" will be enforced for the version listing page and \"article\" for the release notes page.",
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "description": "URL of the website. If not set, the `base_url` will be used instead. If `base_url` is not set either, the world explodes. Think of the kittens.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "image"
      ]
    },
    "ScriptBuilderConfig": {
      "description": "Configuration for [`ScriptBuilder`].",
      "type": "object",
      "properties": {
        "outputs": {
          "description": "Paths of the files or directories produced by the script that should be\ntreated as release artifacts (copied to `dist/` and listed on the\nrelease page). Each path is resolved relative to the working directory\nin which `abbaye` is run.\n\nIf a listed path is missing, the build fails.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/ScriptBuilderOutput"
          }
        },
        "script": {
          "description": "Shell commands to execute in order. Each line is passed to `sh -c`,\nso any POSIX shell syntax is supported.\n\nThe environment variable `ABBAYE_BUILDING_VERSION` is set to the version\nbeing built. (e.g. the git tag `v0.1.0` or whatever. Not Abbaye's own version)\n\nThe build fails immediately if any command exits with a non-zero status.\n\n```toml\n[[builders]]\ntype = \"script\"\nscript = [\n  \"make release\",\n  \"strip target/mybin\",\n]\noutputs = [\"target/mybin\"]\n```",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "script",
        "outputs"
      ]
    },
    "ScriptBuilderOutput": {
      "description": "Lets the user specify a path for a script output, optionally with a custom name.\nI need to check but it should enable the user to specify a directory as output.\nIf that's a good idea is an other question.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "path": {
              "type": "string"
            }
          },
          "required": [
            "path",
            "name"
          ]
        },
        {
          "type": "string"
        }
      ]
    },
    "SiteConfig": {
      "description": "General website metadata.",
      "type": "object",
      "properties": {
        "base_url": {
          "description": "Canonical base URL of the published site (e.g. `\"https://example.com\"`).\nWhen set, the generated `releases.atom` feed will include absolute links\nand proper entry IDs.  Trailing slashes are stripped automatically.",
          "type": [
            "string",
            "null"
          ]
        },
        "fediverse_creator": {
          "description": "If you have a Fediverse account, you can set this to your username to enable Fediverse integration. (don't forget the starting '@' !)",
          "type": [
            "string",
            "null"
          ]
        },
        "lang": {
          "description": "An optional language code for the website (e.g. `\"en\"` or `\"fr\"`).\nWhen set, the generated HTML will include a `lang` attribute on the `<html>` tag. Defaults to `\"en\"`.",
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "description": "Display name of the project, used in page titles and headings.",
          "type": "string"
        },
        "opengraph": {
          "description": "OpenGraph configuration for the website.",
          "anyOf": [
            {
              "$ref": "#/definitions/OpenGraphConfig"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_dir": {
          "description": "Where to output generated files. Defaults to `public`.",
          "type": "string",
          "default": "public"
        },
        "readme": {
          "description": "Path to the README file rendered on each version page.\nDefaults to `README.md` in the current working directory.",
          "type": [
            "string",
            "null"
          ]
        },
        "repo_url": {
          "description": "URL of the project's repository (e.g. `\"https://git.sr.ht/~ololduck/abbaye\"`).\nWhen set, we will show the repository link in the generated website.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name"
      ]
    }
  }
}
