tecosaur / DataToolkit.jl

Reproducible, flexible, and convenient data management
https://tecosaur.github.io/DataToolkit.jl
78 stars 4 forks source link

Fix source, repo links in docs #14

Closed mortenpi closed 4 months ago

mortenpi commented 4 months ago

Just something I noticed when browsing the docs:

  1. Fixes the source links for the org file by adding the correct EditURL at-meta blocks to the .md files generated from the .org files.
  2. Removes the repo keyword so that Documenter would pick it up automatically, and therefore generate the GitHub link to the repo.

image

vs the current

image

Unrelatedly, I also added the generated docs files into .gitignore, though happy to revert that if that's not what you want.

tecosaur commented 4 months ago

Thanks Morten! I'll copy this change over to the other DTBase and DTCommon docs :grinning:.

tecosaur commented 4 months ago

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 ?

mortenpi commented 4 months ago

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?

https://github.com/tecosaur/DataToolkitCommon.jl/blob/2579ed72077b3665adabca38197a68cf42d532c9/src/transformers/storage/null.jl#L8-L12

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?

tecosaur commented 4 months ago

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:

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
mortenpi commented 4 months ago

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.