{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/madness-madness-yml/latest.json",
  "title": "settings",
  "description": "Settings for madness server\n<https://madness.dannyb.co/#configuration-file>",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/DannyBen/madness/master/schemas/madness.json",
    "sourceSha256": "f22eee2ccd2d68a365f8e541e0f3b4b1c8c9d01e47d059e35e3dacb3b9eb4e9f",
    "fileMatch": [
      "madness.yml",
      "madness.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "path": {
      "title": "path",
      "description": "Path to the documentation root\n<https://madness.dannyb.co/#configuration-file>",
      "type": "string",
      "minLength": 1,
      "default": "."
    },
    "port": {
      "title": "port",
      "description": "Server port\n<https://madness.dannyb.co/#configuration-file>",
      "type": "integer",
      "minimum": 0,
      "default": "3000"
    },
    "bind": {
      "title": "bind",
      "description": "Server listening address\n<https://madness.dannyb.co/#configuration-file>",
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+\\.\\d+$",
      "default": "0.0.0.0"
    },
    "renderer": {
      "title": "renderer",
      "description": "The underlying markdown renderer to use\n<https://madness.dannyb.co/#configuration-file>",
      "type": "string",
      "enum": [
        "redcarpet",
        "pandoc"
      ],
      "default": "redcarpet"
    },
    "base_uri": {
      "title": "base uri",
      "description": "Server root URI\n<https://madness.dannyb.co/#configuration-file>",
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "examples": [
            "/docs"
          ],
          "not": {
            "pattern": "//"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "sort_order": {
      "title": "sort order",
      "description": "Navigation sort order\n<https://madness.dannyb.co/#configuration-file>",
      "type": "string",
      "enum": [
        "dirs_first",
        "mixed"
      ],
      "default": "dirs_first"
    },
    "sidebar": {
      "title": "sidebar",
      "description": "Whether to enable sidebar\n<https://madness.dannyb.co/#configuration-file>",
      "type": "boolean",
      "default": "true"
    },
    "auto_h1": {
      "title": "auto h1",
      "description": "Whether to add H1 title to files that do not have one\n<https://madness.dannyb.co/#configuration-file>",
      "type": "boolean",
      "default": "true"
    },
    "auto_nav": {
      "title": "auto nav",
      "description": "Whether to append navigation to directory READMEs\n<https://madness.dannyb.co/#configuration-file>",
      "type": "boolean",
      "default": "true"
    },
    "auto_toc": {
      "title": "auto toc",
      "description": "Whether to enable table of contents\n<https://madness.dannyb.co/#configuration-file>",
      "type": "boolean",
      "default": "true"
    },
    "highlighter": {
      "title": "highlighter",
      "description": "Whether to enable syntax highlighter for code snippets\n<https://madness.dannyb.co/#configuration-file>",
      "type": "boolean",
      "default": "true"
    },
    "mermaid": {
      "title": "mermaid",
      "description": "Whether to enable support for mermaid diagrams\n<https://madness.dannyb.co/#configuration-file>",
      "type": "boolean",
      "default": "true"
    },
    "copy_code": {
      "title": "copy code",
      "description": "Whether to enable the copy to clipboard icon for code snippets\n<https://madness.dannyb.co/#configuration-file>",
      "type": "boolean",
      "default": "true"
    },
    "shortlinks": {
      "title": "shortlinks",
      "description": "Whether to convert [[Links]] to [Links](Links)\n<https://madness.dannyb.co/#configuration-file>",
      "type": "boolean",
      "default": "false"
    },
    "toc": {
      "title": "toc",
      "description": "Whether to generate a table of contents file with this name\n<https://madness.dannyb.co/#configuration-file>",
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "examples": [
            "Table of Contents"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "title": "theme",
      "description": "Theme directory\n<https://madness.dannyb.co/#configuration-file>",
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "examples": [
            "_theme"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "source_link": {
      "title": "source link",
      "description": "Template for source code links\n<https://madness.dannyb.co/#configuration-file>",
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "examples": [
            "http://example.com/%{path}"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "source_link_label": {
      "title": "source link label",
      "description": "Label for the page source code link\n<https://madness.dannyb.co/#configuration-file>",
      "type": "string",
      "minLength": 1,
      "default": "Page Source"
    },
    "source_link_pos": {
      "title": "source link pos",
      "description": "The position of the page source code link\n<https://madness.dannyb.co/#configuration-file>",
      "type": "string",
      "enum": [
        "top",
        "bottom"
      ],
      "default": "bottom"
    },
    "open": {
      "title": "open",
      "description": "Whether to open the server URL in the browser\n<https://madness.dannyb.co/#configuration-file>",
      "type": "boolean",
      "default": "false"
    },
    "auth": {
      "title": "auth",
      "description": "Whether to provide user:password for basic authentication\n<https://madness.dannyb.co/#configuration-file>",
      "oneOf": [
        {
          "type": "boolean",
          "const": false
        },
        {
          "type": "string",
          "pattern": "^[^:]+:[^:]+$",
          "examples": [
            "admin:s3cr3t"
          ]
        }
      ]
    },
    "auth_zone": {
      "title": "auth zone",
      "description": "An auth realm name\n<https://madness.dannyb.co/#configuration-file>",
      "type": "string",
      "default": "Restricted Documentation"
    },
    "expose_extensions": {
      "title": "expose extensions",
      "description": "Show files with these extensions in the navigation\n<https://madness.dannyb.co/#configuration-file>",
      "oneOf": [
        {
          "type": "string",
          "examples": [
            "pdf,docx,xlsx,txt"
          ],
          "not": {
            "pattern": ",,|^,|,$"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "exclude": {
      "title": "exclude",
      "description": "Excluded directories\n<https://madness.dannyb.co/#configuration-file>",
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "description": "An excluded directory\n<https://madness.dannyb.co/#configuration-file>",
        "type": "string",
        "default": "^[a-z_\\-0-9]+$"
      }
    }
  },
  "additionalProperties": false
}
