Skip to content

Commit

Permalink
rerendered doc
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Aug 2, 2024
1 parent 1709405 commit 069f240
Show file tree
Hide file tree
Showing 187 changed files with 96,598 additions and 268 deletions.
14 changes: 14 additions & 0 deletions clay.edn1
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{:modes {:html {:toc true}
:quarto-book {:quarto {:format {:html {:toc true}}
:code-block-background true
:embed-resources false}}
:quarto-standalone {:quarto {:format {:html {:toc true}}
:code-block-background true
:embed-resources true}}
:quarto-reveal {:quarto {:format {:revealjs {:theme :serif
:navigation-mode :vertical
:transition :slide
:background-transition :fade
:incremental true
:embed-resources false}}}}}
:default-mode {}}
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.quarto/
498 changes: 249 additions & 249 deletions docs/clay_book.examples.html

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -439,23 +439,23 @@ <h2 data-number="1.7" class="anchored" data-anchor-id="example-notebook-namespac
<tbody>
<tr class="odd">
<td style="text-align: right;">0</td>
<td style="text-align: right;">0.06764471</td>
<td style="text-align: right;">0.11840268</td>
</tr>
<tr class="even">
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.91833082</td>
<td style="text-align: right;">0.55892107</td>
</tr>
<tr class="odd">
<td style="text-align: right;">2</td>
<td style="text-align: right;">0.85450365</td>
<td style="text-align: right;">0.64407336</td>
</tr>
<tr class="even">
<td style="text-align: right;">3</td>
<td style="text-align: right;">0.87747464</td>
<td style="text-align: right;">0.20162682</td>
</tr>
<tr class="odd">
<td style="text-align: right;">4</td>
<td style="text-align: right;">0.83788697</td>
<td style="text-align: right;">0.94426194</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -808,15 +808,15 @@ <h2 data-number="1.13" class="anchored" data-anchor-id="functions"><span class="
<tbody>
<tr class="odd">
<td style="text-align: right;">0</td>
<td style="text-align: right;">0.61111565</td>
<td style="text-align: right;">0.95547445</td>
</tr>
<tr class="even">
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.72603352</td>
<td style="text-align: right;">0.04014935</td>
</tr>
<tr class="odd">
<td style="text-align: right;">2</td>
<td style="text-align: right;">0.55099480</td>
<td style="text-align: right;">0.13901782</td>
</tr>
</tbody>
</table>
Expand All @@ -839,15 +839,15 @@ <h2 data-number="1.13" class="anchored" data-anchor-id="functions"><span class="
<tbody>
<tr class="odd">
<td style="text-align: right;">0</td>
<td style="text-align: right;">0.64221707</td>
<td style="text-align: right;">0.54223772</td>
</tr>
<tr class="even">
<td style="text-align: right;">1</td>
<td style="text-align: right;">0.24485349</td>
<td style="text-align: right;">0.50408273</td>
</tr>
<tr class="odd">
<td style="text-align: right;">2</td>
<td style="text-align: right;">0.35126508</td>
<td style="text-align: right;">0.82484302</td>
</tr>
</tbody>
</table>
Expand All @@ -870,7 +870,7 @@ <h2 data-number="1.14" class="anchored" data-anchor-id="delays"><span class="hea
<section id="referring-to-files" class="level2" data-number="1.15">
<h2 data-number="1.15" class="anchored" data-anchor-id="referring-to-files"><span class="header-section-number">1.15</span> Referring to files</h2>
<p>In data visualizations, one can directly refrer to files places under <code>"notebooks/"</code> or <code>"src/"</code>. By default, all files except of these directories, except for Clojure files, are copied alongside the HTML target.</p>
<p>This default can be overridden using the <code>:subdirs-to-sync</code> config option. E.g., <code>:subdirs-to-sync ["notebooks" "data"]</code> will copy files from the <code>"notebooks"</code> and <code>"data"</code> directories, but not from <code>"src"</code>.</p>
<p>This default can be overridden using the <code>:subdirs-to-sync</code> config option. E.g., <code>:subdirs-to-sync ["notebooks" "data"]</code> will copy files from the <code>"notebooks"</code> and <code>"data"</code> directories, but not from <code>"src"</code>. Clojure source files (<code>.clj</code>, etc.) are not synched.</p>
<div class="sourceClojure">
<div class="sourceCode" id="cb42"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a>(kind/hiccup</span>
<span id="cb42-2"><a href="#cb42-2" aria-hidden="true" tabindex="-1"></a> [<span class="at">:img</span> {<span class="at">:src</span> <span class="st">"notebooks/images/Clay.svg.png"</span>}])</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
Expand Down
59 changes: 59 additions & 0 deletions docs/notebooks/a_chapter_with_R_code.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# A chapter with R code

## Section 1

```{r}
1+2
```

## Section 2

```{r}
hist(rnorm(99))
```

## Section 3

Trying `rmarkdown-clojure`:

```{r setup, include=FALSE}
find_nrepl_port_up <- function() {
wd <- getwd()
while(wd != dirname(wd)) {
f <- paste0(wd,"/.nrepl-port")
if(file.exists(f)) return(paste0("@",f))
wd <- dirname(wd)
f <- NULL
}
}
port_file <- find_nrepl_port_up()
if(is.null(port_file)) stop("nREPL port not found")
library(knitr)
knitr_one_string <- knitr:::one_string
nrepl_cmd <- "rep"
opts_chunk$set(comment=NA, highlight=TRUE)
knit_engines$set(clojure = function(options) {
rep_params <- if((options$results == "asis") || isTRUE(options$stdout_only)) {
"--print 'out,1,%{out}' --print 'value,1,' -p"
} else {
"-p"
}
code <- paste(rep_params, port_file, shQuote(knitr_one_string(options$code)))
out <- if (options$eval) {
if (options$message) message('running: ', nrepl_cmd, ' ', code)
tryCatch(
system2(nrepl_cmd, code, stdout = TRUE, stderr = TRUE, env = options$engine.env),
error = function(e) {
if (!options$error) stop(e)
paste('Error in running command', nrepl_cmd)
}
)
} else ''
if (!options$error && !is.null(attr(out, 'status'))) stop(knitr_one_string(out))
engine_output(options, options$code, out)})
```


```{clojure}
(+ 1 2)
```
11 changes: 11 additions & 0 deletions docs/notebooks/custom1.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import url(https://cdn.jsdelivr.net/npm/[email protected]/distr/fira_code.css);

/*-- scss:rules --*/
.table {width:auto}

code {font-family: 'Fira Code Medium', monospace;}

.clay-image img {max-width: 50px}


body {background-color: lightgray}
101 changes: 101 additions & 0 deletions docs/notebooks/datasets/temp.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
x,y
0,0.3836032408847967
1,0.36099346062945714
2,0.6240868963153352
3,0.7246690729960028
4,0.5975090540638364
5,0.20452572769776822
6,0.5511639152916283
7,0.27974509484024457
8,0.6596151426796825
9,0.5152187538509085
10,0.26186856306323003
11,0.6324781560712595
12,0.5047721363185802
13,0.7703025232984473
14,0.822270041838778
15,0.3901692171454785
16,0.7630880752260801
17,0.34503815301731067
18,0.4479862660558652
19,0.8383710495075298
20,0.34598244326928596
21,0.03443837445931264
22,0.0766543855475148
23,0.26215444914218144
24,0.8081202564318113
25,0.2948146779050138
26,0.2785521517634043
27,0.4397310391724576
28,0.03969967937001806
29,0.8780331941928368
30,0.7361137933803834
31,0.23961551606404985
32,0.8914189905860413
33,0.05577558011330963
34,0.08656012228954679
35,0.9175494053476839
36,0.6635495844628126
37,0.686764901986259
38,0.2665897059105773
39,0.4056969843274695
40,8.937977700980149E-4
41,0.9668311030370961
42,0.6240538222794699
43,0.6141638189461234
44,0.6270076229282414
45,0.8198539930933
46,0.9687652425920751
47,0.5236768166299018
48,0.5239199825984001
49,0.5370364960428063
50,0.4230666667297742
51,0.6383038579962004
52,0.6176816089093122
53,0.4526243598162958
54,0.402512104296995
55,0.18838047583908013
56,0.7654289326274079
57,0.15610308936343276
58,0.3079899513752148
59,0.32634982064393825
60,0.8562486433878495
61,0.9840664041252284
62,0.5428441487708802
63,0.4420111373883603
64,0.1359812914841806
65,0.3093651340234388
66,0.282025627494093
67,0.6387113573757942
68,0.4452034264489978
69,0.4508090211272199
70,0.015033246684376667
71,0.3583030637349893
72,0.9199791703925813
73,0.863608399573907
74,0.26037965614722003
75,0.12023176343700503
76,0.8465738197018933
77,0.6389064107765796
78,0.006544266481435468
79,0.3489036186402509
80,0.7841740125352934
81,0.24016680926561917
82,0.3728523374278119
83,0.3035246106105287
84,0.7737597312649241
85,0.8348461110744574
86,0.703444892560047
87,0.19589080346489507
88,0.43662587904891614
89,0.5416934109142241
90,0.8084819693214834
91,0.6841485071772843
92,0.03265199549574971
93,0.4071844858196745
94,0.3489470281280933
95,0.06433212851494186
96,0.09627079344204548
97,0.9490119258322847
98,0.42489789647757326
99,0.6465267769814818
54 changes: 54 additions & 0 deletions docs/notebooks/test.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "42932a5f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1+2"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d64bd191",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
58 changes: 58 additions & 0 deletions docs/notebooks/tmp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
A simple example based on Allison Horst's [Palmer Penguins](https://allisonhorst.github.io/palmerpenguins/) dataset. Here we look at how penguin body mass varies across both sex and species (use the provided inputs to filter the dataset by bill length and island):

```{ojs}
//| panel: input
viewof bill_length_min = Inputs.range(
[32, 50],
{value: 35, step: 1, label: "Bill length (min):"}
)
viewof islands = Inputs.checkbox(
["Torgersen", "Biscoe", "Dream"],
{ value: ["Torgersen", "Biscoe"],
label: "Islands:"
}
)
```

::: {.panel-tabset}

## Plot

```{ojs}
Plot.rectY(filtered,
Plot.binX(
{y: "count"},
{x: "body_mass_g", fill: "species", thresholds: 20}
))
.plot({
facet: {
data: filtered,
x: "sex",
y: "species",
marginRight: 80
},
marks: [
Plot.frame(),
]
}
)
```

## Data

```{ojs}
Inputs.table(filtered)
```

:::

```{ojs}
data = FileAttachment("palmer-penguins.csv").csv({ typed: true })
```

```{ojs}
filtered = data.filter(function(penguin) {
return bill_length_min < penguin.bill_length_mm &&
islands.includes(penguin.island);
})
```
Loading

0 comments on commit 069f240

Please sign in to comment.