Skip to content

Commit 7c00149

Browse files
authored
Merge pull request MilesCranmer#491 from MilesCranmer/docs-fixes
WIP: Fix some issues with docs
2 parents d9fc3bf + 02ecf00 commit 7c00149

File tree

6 files changed

+33
-7
lines changed

6 files changed

+33
-7
lines changed

docs/src/.vitepress/theme/index.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,23 @@ export const Theme: ThemeConfig = {
2828
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
2929
})
3030
},
31-
enhanceApp({ app, router, siteData }) {
31+
enhanceApp({ app, router }) {
3232
enhanceAppWithTabs(app);
3333
app.component('VersionPicker', VersionPicker);
3434
app.component('AuthorBadge', AuthorBadge)
3535
app.component('Authors', Authors)
36+
37+
// Auto-collapse MultitargetSRRegressor documentation
38+
if (typeof window !== 'undefined') {
39+
router.onAfterRouteChange = () => {
40+
setTimeout(() => {
41+
const details = document.querySelector('details:has(a[id*="MultitargetSRRegressor"])')
42+
if (details?.hasAttribute('open')) {
43+
details.removeAttribute('open')
44+
}
45+
}, 100)
46+
}
47+
}
3648
}
3749
}
3850
export default Theme

docs/src/.vitepress/theme/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ html.dark {
7070
background-clip: text;
7171
}
7272

73+
.vp-doc .header-anchor {
74+
-webkit-text-fill-color: var(--vp-c-brand-1) !important;
75+
}
76+
7377
/* Subtle gold glow for code blocks */
7478
.vp-code-group .tabs .tab.active {
7579
color: var(--vp-c-brand-1);

docs/src/api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ MultitargetSRRegressor
1313
equation_search
1414
```
1515

16+
## Template Expressions
17+
18+
```@docs
19+
@template_spec
20+
```
21+
1622
## Options
1723

1824
```@docs

docs/src/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ println(r.equations[r.best_idx])
6060

6161
Here, we do the same thing, but with multiple expressions at once,
6262
each requiring a different feature. This means that we need to use
63-
`MultitargetSRRegressor` instead of `SRRegressor`:
63+
[`MultitargetSRRegressor`](@ref) instead of [`SRRegressor`](@ref):
6464

6565
```julia
6666
X = 2rand(1000, 5) .+ 0.1
@@ -85,7 +85,7 @@ end
8585
## 4. Plotting an expression
8686

8787
For now, let's consider the expressions for output 1 from the previous example:
88-
We can get a SymbolicUtils version with:
88+
We can get a SymbolicUtils version with [`node_to_symbolic`](@ref):
8989

9090
```julia
9191
using SymbolicUtils

docs/src/types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ as follows.
99
Node
1010
```
1111

12-
When you create an `Options` object, the operators
12+
When you create an [`Options`](@ref) object, the operators
1313
passed are also re-defined for `Node` types.
1414
This allows you use, e.g., `t=Node(; feature=1) * 3f0` to create a tree, so long as
1515
`*` was specified as a binary operator. This works automatically for
@@ -41,7 +41,7 @@ copy_node(tree::Node)
4141

4242
## Expressions
4343

44-
Expressions are represented using the `Expression` type, which combines the raw `Node` type with an `OperatorEnum`.
44+
Expressions are represented using the [`Expression`](@ref) type, which combines the raw [`Node`](@ref) type with an `OperatorEnum`.
4545

4646
```@docs
4747
Expression

src/MLJInterface.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,12 @@ eval(
917917
replace(
918918
"""
919919
Multi-target Symbolic Regression regressor (`MultitargetSRRegressor`)
920-
conducts several searches for expressions that predict each target variable
921-
from a set of input variables. All data is assumed to be `Continuous`.
920+
searches for expressions that predict each target variable from a set
921+
of input variables. This simply runs independent [`SRRegressor`](@ref)
922+
searches for each target column in parallel - there is no joint modeling
923+
of targets. All configuration options work identically to `SRRegressor`.
924+
925+
All data is assumed to be `Continuous`.
922926
The search is performed using an evolutionary algorithm.
923927
This algorithm is described in the paper
924928
https://arxiv.org/abs/2305.01582.

0 commit comments

Comments
 (0)