JuliaDocs / DocumenterInterLinks.jl

A plugin for Documenter.jl that enables linking between projects
http://juliadocs.org/DocumenterInterLinks.jl/
MIT License
23 stars 1 forks source link

Ambiguous docs on local inventories #9

Closed tecosaur closed 3 months ago

tecosaur commented 3 months ago

Hello!

Looking at the InterLinks docstring (the link in the second paragraph of the readme is broken BTW), it's not clear if

links = InterLinks(
    "project1" => "local/path/to/inv",
)

would work or not. If you could clarify this, that would be great :slightly_smiling_face:

This is something I'm interested in since I'm currently restructuring a sextet of related packages of mine into a mono-repo, with each package (and their docs subfolder + inventory) in a subfolder of the main repo.

goerz commented 3 months ago

No, that cannot work: this would not provide any information about the project root URL (what the URLs in the inventory are relative to).

You have to use

links = InterLinks(
    "project1" => (
       "https://www.docs.org/project1/",
       "local/path/to/inv"
    )
)

I'll make sure to clarify this.

Thanks for pointing out the broken link!

goerz commented 3 months ago

@tecosaur Have a look at http://juliadocs.org/DocumenterInterLinks.jl/dev/api/internals/#DocumenterInterLinks.InterLinks

Does that updated documentation seem sufficient to make it non-ambiguous?

tecosaur commented 3 months ago

Thanks! That does indeed help, particularly the explanation about how the Julia example works.

I've yet to actually try an @extref, but I'm getting successful builds at least using

InterLinks(
    "DataToolkitCore" => (
        "https://tecosaur.github.io/DataToolkit.jl/core/",
        joinpath(dirname(dirname(@__DIR__)), "Core", "docs", "build", "objects.inv")
    ),
    "DataToolkitREPL" => (
        "https://tecosaur.github.io/DataToolkit.jl/repl/",
        joinpath(dirname(dirname(@__DIR__)), "REPL", "docs", "build", "objects.inv")
    ),
    "DataToolkitStore" => (
        "https://tecosaur.github.io/DataToolkit.jl/store/",
        joinpath(dirname(dirname(@__DIR__)), "Store", "docs", "build", "objects.inv")
    ),
    "DataToolkitCommon" => (
        "https://tecosaur.github.io/DataToolkit.jl/common/",
        joinpath(dirname(dirname(@__DIR__)), "Common", "docs", "build", "objects.inv")
    ),
    "DataToolkitBase" => (
        "https://tecosaur.github.io/DataToolkit.jl/base/",
        joinpath(dirname(dirname(@__DIR__)), "Base", "docs", "build", "objects.inv")
    ),
    "DataToolkit" => (
        "https://tecosaur.github.io/DataToolkit.jl/main/",
        joinpath(dirname(dirname(@__DIR__)), "Main", "docs", "build", "objects.inv")
    ),
)

:slightly_smiling_face:

goerz commented 3 months ago

Great! That looks like it should work!