Skip to content

Commit

Permalink
docs: tweak InterLinks setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tecosaur committed Sep 29, 2024
1 parent 264eadf commit d18c5bf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Common/docs/src/contributing.org
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The same as the loader steps, except:

If you feel like DataToolkit lacks something, not support for a certain
support/storage provider, but some more fundamental behaviour ---
it's entirely likely this behaviour can be added in via a [[@extref DataToolkitCore Plugins-and-Advice][/Plugin/]].
it's entirely likely this behaviour can be added in via a [[@extref DTkCore Plugins-and-Advice][/Plugin/]].

Depending on the behaviour you have in mind, implementing a plugin can take five
minutes and be just a dozen or two lines total, or something much larger (like
Expand All @@ -70,7 +70,7 @@ whether or how something can be done 🙂.

The plugins in =src/plugins/= should provide an indication of what implementing a
plugin /can/ look like. The broad strokes look something like this though:
1. Compare the behaviour in your mind to the [[@extref DataToolkitCore Index-of-advised-calls-(join-points)][join points]] currently available,
1. Compare the behaviour in your mind to the [[@extref DTkCore Index-of-advised-calls-(join-points)][join points]] currently available,
and contemplate which of them would need to be changed to accomidate your
target behaviour
2. Create =src/plugins/{name}.jl=, and implement advice functions that modify the
Expand Down
22 changes: 12 additions & 10 deletions Core/docs/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,28 @@ md2rm() = foreach(rm, MdFiles)
# ---

const SUBPKGS = Dict(
:Core => (sufffix="Core", subdir="Core", url="core"),
:REPL => (sufffix="REPL", subdir="REPL", url="repl"),
:Store => (sufffix="Store", subdir="Store", url="store"),
:Common => (sufffix="Common", subdir="Common", url="common"),
:Base => (sufffix="Base", subdir="Base", url="base"),
:Main => (sufffix="", subdir="Main", url="main")
:Core => (suffix="Core", subdir="Core", url="core"),
:REPL => (suffix="REPL", subdir="REPL", url="repl"),
:Store => (suffix="Store", subdir="Store", url="store"),
:Common => (suffix="Common", subdir="Common", url="common"),
:Base => (suffix="Base", subdir="Base", url="base"),
:Main => (suffix="", subdir="Main", url="main")
)

const DOCS_INTERLINK_PREFIX = "DTk"
const DOCS_BASE_URL = "https://tecosaur.github.io/DataToolkit.jl"

macro get_interlinks(pkgs::Symbol...)
forms = Expr[]
for pkg in pkgs
spec = SUBPKGS[pkg]
name = "DataToolkit$(spec.sufffix)"
invfile = joinpath(dirname(dirname(@__DIR__)), spec.subdir, "docs", "build", "objects.inv")
puburl = "$DOCS_BASE_URL/$(spec.url)/"
invurl = puburl * "objects.inv"
push!(forms, :($name => ($puburl,
if isfile($invfile) Inventory($invfile, root_url=$puburl) end,
Inventory($invurl, root_url=$puburl))))
push!(forms, :($"$DOCS_INTERLINK_PREFIX$(spec.suffix)" =>
($puburl,
if isfile($invfile) Inventory($invfile, root_url=$puburl) end,
Inventory($invurl, root_url=$puburl))))
end
quote
using Documenter, DocumenterInterLinks, DocInventories
Expand All @@ -120,6 +121,7 @@ macro get_interlinks(pkgs::Symbol...)
end
end
if uptodate && "--only-if-inv-changed" in ARGS
@info "All inventories are up-to-date, skipping generation"
exit()
end
InterLinks(
Expand Down
2 changes: 1 addition & 1 deletion Core/docs/src/linting.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#+title: Linting

In DataToolkit, the [[@extref][Data.toml]] can be linted to identify and resolve potential
In DataToolkit, the [[@extref DTkMain][Data.toml]] can be linted to identify and resolve potential
issues. This is done by generating ~LintReport~​s and ~LintItem~​s.

#+begin_src @docs
Expand Down
16 changes: 8 additions & 8 deletions Main/docs/src/tutorial.org
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Get more information on a particular command with =help <cmd>=, you can even get
more information on what =help= does with =help help= 😉.
#+end_tip

We will initialise a new data collection with the [[@extref DataToolkitREPL repl-init][=init=]] command.
We will initialise a new data collection with the [[@extref repl-init][=init=]] command.

#+begin_note
We can use the full command (=init=), or any substring that uniquely identifies
Expand Down Expand Up @@ -90,7 +90,7 @@ plugins = ["store", "defaults", "memorise"]
#+end_src

#+begin_note
The plugins [[@extref DataToolkitCommon plugin-addpkgs][=store=]], [[@extref DataToolkitCommon plugin-defaults][=defaults=]], and [[@extref DataToolkitCommon plugin-memorise][=memorise=]] are the default set of plugins, which
The plugins [[@extref plugin-addpkgs][=store=]], [[@extref plugin-defaults][=defaults=]], and [[@extref plugin-memorise][=memorise=]] are the default set of plugins, which
is why we see them here. A minimal =Data.toml= would have ~plugins = []~.
#+end_note

Expand All @@ -112,7 +112,7 @@ set is part of the =scikit-learn= repository, which makes it fairly easy to find
link to it:
https://raw.githubusercontent.com/scikit-learn/scikit-learn/1.0/sklearn/datasets/data/iris.csv

We can easily add this as a [[@extref DataToolkitCore.DataSet][=DataSet=]] using the [[@extref DataToolkitREPL repl-add][=add=]] Data REPL command,
We can easily add this as a [[@extref DataToolkitCore.DataSet][=DataSet=]] using the [[@extref repl-add][=add=]] Data REPL command,

#+begin_example
(tutorial) data> add iris https://raw.githubusercontent.com/scikit-learn/scikit-learn/1.0/sklearn/datasets/data/iris.csv
Expand Down Expand Up @@ -152,10 +152,10 @@ DataSet tutorial:iris
#+end_src

We can see from the =Storage: web(IO, Vector{UInt8}, String, FilePath)= line that
the [[@extref DataToolkitCommon storage-web][=web=]] storage driver is being used, and it can make the content available as
the [[@extref storage-web][=web=]] storage driver is being used, and it can make the content available as
an ~IO~, ~Vector{UInt8}~, ~String~, or ~FilePath~ (a string wrapper type provided by
=DataToolkitBase= for dispatch purposes). Similarly, the =Loaders: csv(DataFrame,
Matrix, File)= tells us that the [[@extref DataToolkitCommon saveload-csv][=csv=]] loader is being used, and it can provide a
Matrix, File)= tells us that the [[@extref saveload-csv][=csv=]] loader is being used, and it can provide a
~DataFrame~, ~Matrix~, or ~CSV.File~.

If we look at the =Data.toml= again, we can see how the =iris= data set is
Expand Down Expand Up @@ -406,10 +406,10 @@ create a new data set.

This example is a bit more complicated because we have a gzipped CSV. There is a
gzip-decompressing loader, and a CSV loader, but no single loader that does
both. Thankfully, there is a special loader called [[@extref DataToolkitCommon saveload-chain][=chain=]] that allows for
both. Thankfully, there is a special loader called [[@extref saveload-chain][=chain=]] that allows for
multiple loaders to be /chained/ together. We can see it's automatically been used
here, and if we inspect the =Data.toml= we an see the following generated
representation of the boston housing data, in which the [[@extref DataToolkitCommon saveload-compressed][=gzip=]] and [[@extref DataToolkitCommon saveload-csv][=csv=]] loaders are
representation of the boston housing data, in which the [[@extref saveload-compressed][=gzip=]] and [[@extref saveload-csv][=csv=]] loaders are
both used.

#+begin_src toml
Expand Down Expand Up @@ -596,7 +596,7 @@ value of ~0.8~, and set the ~column~ to ~"MedV"~. It could be nice if we made th
more easily tunable. We can do this by turning them into keyword arguments of
the function.

To make this change, we will use the [[@extref DataToolkitREPL repl-edit][=edit=]] Data REPL command.
To make this change, we will use the [[@extref repl-edit][=edit=]] Data REPL command.

#+begin_src julia-repl
(tutorial) data> edit boston (clean)
Expand Down

0 comments on commit d18c5bf

Please sign in to comment.