Closed mortenpi closed 4 months ago
Thanks Morten! I'll copy this change over to the other DTBase and DTCommon docs :grinning:.
I'm having a bit of trouble getting this working with DataToolkitCommon, trying to link docstrings that come from code in src/*.jl
not docs/src/*.org
. Might you have any thoughts on https://github.com/tecosaur/DataToolkitCommon.jl/blob/2579ed72077b3665adabca38197a68cf42d532c9/docs/make.jl#L13-L25 ?
I am not entirely sure what you're trying to do.. are you trying to get rid of these files https://github.com/tecosaur/DataToolkitCommon.jl/blob/main/docs/src/storage/null.org#L ? Because if you have the .org
files, the file-level edit link should point to the .org
file, even if that file is trivial?
IIUC, you're trying to include this string into the manual, right?
Edit: hmm.. looking at it a bit more.. a correct relative link to the .jl
should work. So if it isn't working, that smells like a Documenter bug. What issue are you actually getting?
As you guessed (sorry for not being explicit), I'm trying to link to the const *_DOC = md"..."
line that produces the content seen in the docs rather than the "stub" page in docs/src
.
I've tried a few variants of relative path generation now, namely:
relpath(orgfile, joinpath(@__DIR__, "src"))
(current)relpath(orgfile, joinpath(@__DIR__))
relpath(orgfile, dirname(__DIR__))
However, all produce errors like this in the Documenter build:
ERROR: LoadError: Unable to generate remote link (local path does not exists)
path: /home/runner/work/DataToolkitCommon.jl/DataToolkitCommon.jl/docs/src/transformers/saveload/sqlite.jl#L46
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] edit_url(doc::Documenter.Document, path::String; rev::String)
@ Documenter ~/.julia/packages/Documenter/9kOxY/src/documents.jl:848
Ah. I think it's the line number #
that's throwing Documenter off. It's literally trying to find a file called sqlite.jl#L46
, which obviously doesn't exist.
EditURL
isn't designed to support fragments, although maybe it should. But I don't think we can just split
on #
, because while weird, #
is a totally valid character to have in a filename.
Just something I noticed when browsing the docs:
EditURL
at-meta blocks to the.md
files generated from the.org
files.repo
keyword so that Documenter would pick it up automatically, and therefore generate theGitHub
link to the repo.vs the current
Unrelatedly, I also added the generated docs files into
.gitignore
, though happy to revert that if that's not what you want.