Skip to content

Commit e83491d

Browse files
committed
tweak appearent of details to be open and to have a space after
tweak appearent of details
1 parent ae343a5 commit e83491d

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

docs/src/assets/chainrules.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Only for light theme
22

33
html:not(.theme--documenter-dark) body #documenter {
4-
54
// Links
65

76
a {
@@ -107,3 +106,16 @@ html:not(.theme--documenter-dark) body #documenter {
107106
html.theme--documenter-dark .admonition.is-category-terminology {
108107
border-color: #FFEC8B;
109108
}
109+
110+
// Details
111+
details {
112+
padding-left: 1rem;
113+
padding-right: 1rem;
114+
padding-bottom: 1rem;
115+
background: aliceblue;
116+
}
117+
118+
html.theme--documenter-dark details {
119+
background: #282f2f;
120+
}
121+

docs/src/design/changing_the_primal.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ x̄ = pullback_at(f, x, y, ȳ)
3030
Let's illustrate this with examples for `sin` and for the [logistic sigmoid](https://en.wikipedia.org/wiki/Logistic_function#Derivative).
3131

3232
```@raw html
33-
<details><summary>Example for `sin`</summary>
33+
<details open><summary>Example for `sin`</summary>
3434
```
3535
```julia
3636
y = sin(x)
@@ -42,7 +42,7 @@ pullback_at(::typeof(sin), x, y, ȳ) = ȳ * cos(x)
4242
</details>
4343
```
4444
```@raw html
45-
<details><summary>Example for the logistic sigmoid</summary>
45+
<details open><summary>Example for the logistic sigmoid</summary>
4646
```
4747

4848
```julia
@@ -61,7 +61,7 @@ One key reason is to insert domain knowledge so as to compute the derivative mor
6161
What insights do we have about `sin` and `cos`?
6262
What about using `sincos`?
6363
```@raw html
64-
<details><summary>Example for `sin`</summary>
64+
<details open><summary>Example for `sin`</summary>
6565
```
6666
```julia
6767
julia> using BenchmarkTools
@@ -93,7 +93,7 @@ then we see they have the common term $e^x$.
9393
`exp(x)` is a much more expensive operation than `+` and `/`.
9494
So we can save time, if we can reuse that `exp(x)`.
9595
```@raw html
96-
<details><summary>Example for the logistic sigmoid</summary>
96+
<details open><summary>Example for the logistic sigmoid</summary>
9797
```
9898
If we have to computing separately:
9999
```julia
@@ -144,7 +144,7 @@ x̄ = pullback_at(f, x, y, ȳ, intermediates)
144144
```
145145

146146
```@raw html
147-
<details><summary>Example for `sin`</summary>
147+
<details open><summary>Example for `sin`</summary>
148148
```
149149
```julia
150150
function augmented_primal(::typeof(sin), x)
@@ -159,7 +159,7 @@ pullback_at(::typeof(sin), x, y, ȳ, intermediates) = ȳ * intermediates.cx
159159
```
160160

161161
```@raw html
162-
<details><summary>Example for the logistic sigmoid</summary>
162+
<details open><summary>Example for the logistic sigmoid</summary>
163163
```
164164
```julia
165165
function augmented_primal(::typeof(σ), x)
@@ -207,7 +207,7 @@ x̄ = pullback_at(pb, ȳ)
207207
which is much cleaner.
208208

209209
```@raw html
210-
<details><summary>Example for `sin`</summary>
210+
<details open><summary>Example for `sin`</summary>
211211
```
212212
```julia
213213
function augmented_primal(::typeof(sin), x)
@@ -222,7 +222,7 @@ pullback_at(pb::PullbackMemory{typeof(sin)}, ȳ) = ȳ * pb.cx
222222
```
223223

224224
```@raw html
225-
<details><summary>Example for the logistic sigmoid</summary>
225+
<details open><summary>Example for the logistic sigmoid</summary>
226226
```
227227
```julia
228228
function augmented_primal(::typeof(σ), x)
@@ -252,7 +252,7 @@ x̄ = pb(ȳ)
252252
```
253253

254254
```@raw html
255-
<details><summary>Example for `sin`</summary>
255+
<details open><summary>Example for `sin`</summary>
256256
```
257257
```julia
258258
function augmented_primal(::typeof(sin), x)
@@ -267,7 +267,7 @@ end
267267
```
268268

269269
```@raw html
270-
<details><summary>Example for the logistic sigmoid</summary>
270+
<details open><summary>Example for the logistic sigmoid</summary>
271271
```
272272
```julia
273273
function augmented_primal(::typeof(σ), x)
@@ -290,7 +290,7 @@ We have one final thing to do, which is to think about how we make the code easy
290290
Let's go back and think about the changes we would have make to go from our original way of writing that only used the inputs/outputs, to one that used the intermediate state.
291291

292292
```@raw html
293-
<details><summary>Example for `sin`</summary>
293+
<details open><summary>Example for `sin`</summary>
294294
```
295295
To rewrite that original formulation in the new pullback form we have:
296296
```julia
@@ -313,7 +313,7 @@ end
313313
```
314314

315315
```@raw html
316-
<details><summary>Example for the logistic sigmoid</summary>
316+
<details open><summary>Example for the logistic sigmoid</summary>
317317
```
318318
```julia
319319
function augmented_primal(::typeof(σ), x)
@@ -354,7 +354,7 @@ There are [incredible ways to abuse this](https://invenia.github.io/blog/2019/10
354354
Replacing `PullbackMemory` with a closure that works the same way lets us avoid having to manually control what is remembered _and_ lets us avoid separately writing the call overload.
355355

356356
```@raw html
357-
<details><summary>Example for `sin`</summary>
357+
<details open><summary>Example for `sin`</summary>
358358
```
359359
```julia
360360
function augmented_primal(::typeof(sin), x)
@@ -368,7 +368,7 @@ end
368368
```
369369

370370
```@raw html
371-
<details><summary>Example for the logistic sigmoid</summary>
371+
<details open><summary>Example for the logistic sigmoid</summary>
372372
```
373373
```julia
374374
function augmented_primal(::typeof(σ), x)

0 commit comments

Comments
 (0)