using Documenter, PSBoardDataBase
using DocumenterInterLinks

include("./make_notebook_index.jl")

DocMeta.setdocmeta!(
    PSBoardDataBase,
    :DocTestSetup,
    :(using PSBoardDataBase);
    recursive = true,
)

links = InterLinks(
    "DataFrames" => "https://dataframes.juliadata.org/dev/objects.inv",
    "Dates" => "https://docs.julialang.org/en/v1/objects.inv",
)

makedocs(
    modules = [PSBoardDataBase],
    authors = "Wataru Otsubo <wotsubo@icepp.s.u-tokyo.ac.jp>",
    sitename = "PSBoard DataBase",
    format = Documenter.HTML(;
        canonical = "http://psboard-database.docs.cern.ch/",
        edit_link = "main",
        assets = String[],
    ),
    repo = Remotes.GitLab("gitlab.cern.ch", "wotsubo", "PSBoardDataBase"),
    pages = [
        "Home" => "index.md",
        "Tutorial" => "tutorial.md",
        "Apps" => [
            "Simple result viewer" => "howtouse-simpleviewer.md",
            "Dispatch checker" => "howtouse-dispatchchecker.md",
        ],
        "Examples" => "examples.md",
        "About this software" => "about_software.md",
    ],
    plugins = [links],
)

deploydocs(repo = "gitlab.cern.ch/wotsubo/PSBoardDataBase", devbranch = "main")
