Documenter warning

I want to build an html documentation locally, it will never be on any server.
I execute the command:

include("docs/make.jl")

Content of make.jl:

using Documenter: makedocs

src="README.md"
dst="docs/src/index.md"
if ! isfile(dst)
    cp(src, dst)
elseif readlines(src) != readlines(dst)
    cp(src, dst; force=true)
end

makedocs(;
    authors="Uwe Fechner <u.fechner-1@tudelft.nl>",
    sitename = "LearningControl", 
    doctest = false,
    remotes = nothing,
    pages=[
        "Readme" => "index.md",
        "Tutorial" => "tutorial.md",
        "Functions" => "functions.md"
    ])

This works fine, but I get the following warning:

[ Info: HTMLWriter: rendering HTML pages.
┌ Warning: Unable to determine the repository root URL for the navbar link.
│ This can happen when a string is passed to the `repo` keyword of `makedocs`.
│ 
│ To remove this warning, either pass a Remotes.Remote object to `repo` to completely
│ specify the remote repository, or explicitly set the remote URL by setting `repolink`
│ via `makedocs(format = HTML(repolink = "..."), ...)`.
└ @ Documenter.HTMLWriter ~/.julia/packages/Documenter/nQAq5/src/html/HTMLWriter.jl:707

Any idea how to get rid of this warning? I have no repository root URL.

In the browser I user the URL http://localhost:8000/.

1 Like

Among the makedocs keyword arguments, try the following keyword and value

format = Documenter.HTML(
        prettyurls = false,
    ),

This is based off building a local copy of the DataFrames documentation. There are other keywords in the Documenter.HTML function but the prettyurls may be the relevant one.

Your suggestion was not sufficient, but inspired me to find the following solution:

makedocs(;
    authors="Uwe Fechner <u.fechner-1@tudelft.nl>",
    sitename = "LearningControl", 
    doctest = false,
    remotes = nothing,
    pages=[
        "Readme" => "index.md",
        "Tutorial" => "tutorial.md",
        "Functions" => "functions.md"
    ],
    format = Documenter.HTML(
        prettyurls = false,
        repolink="http://localhost:8000",
    ))

Thank you!

2 Likes

To answer that, prettyurls only determines whether an page.md file gets translated to a page.html or a page/index.html page, where the second it the prettyurls, since you can access that with page/ and do not have to thin about the html ending.

I locally use no-pretty-urls but on CI I do.

1 Like