Documenter.jl help for first time user

Thank you so much for your help. The following works!

The last issue I faced was that the call using Documenter, Test_Module inside docs/make.jl wasn’t working. Essentially I was getting ERROR: LoadError: UndefVarError: Test_Modulenot defined inMain``. Turns out I had to name the file containing my module,src/src.jl to src/Test_Module.jl to work. I dont understand why, but I suspect this is to do with how using() works in Julia: perhaps it is related to a file name rather than its contents?

Regardless, this is the complete minimal working example for future learners:

New file structure:

│── Manifest.toml
│── Project.toml # has LinearAlgebra.jl only
│── docs/
│ │── Manifest.toml
│ │── make.jl
│ │── Project.toml # has Documenter.jl only
│ │── src/
│ │ │── index.md
│── src/
│ │── Test_Module.jl
│ │── test.jl

Contents:

# src/Test_Module.jl
module Test_Module

export test

include("test.jl")

end # end of module
# src/test.jl
"""
    test(x)

Multiplies x by 2.
"""
function test(x) 
    return 2*x 
end
# docs/make.jl
push!(LOAD_PATH,"../src/")

using Documenter, Test_Module

makedocs(sitename="My Documentation")
<!-- docs/src/index.md -->
...(same as Tetrakai)...
(I cant figure out the correct syntaxt to not mess up the formatting of this code)

This produces:



Credit:
I mark my own answer as the solution to my question since, well, it is. However, as anyone can tell, it’s far from my authorship and I would like to credit everyone above who spoon fed me this one out <3. Time to rewatch Datseris tutorial again now that everything is working!

5 Likes