Skip to content

Commit 90f281a

Browse files
committed
finished example
1 parent 7fd9744 commit 90f281a

File tree

2 files changed

+104
-87
lines changed

2 files changed

+104
-87
lines changed

example.ipynb

Lines changed: 0 additions & 67 deletions
This file was deleted.

example.qmd

Lines changed: 104 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,149 @@
11
---
22
title: "codewindow Example"
33
format:
4-
revealjs: default
4+
revealjs:
5+
footer: <https://github.com/emilhvitfeldt/quarto-revealjs-codewindow>
56
revealjs-plugins:
67
- codewindow
78
echo: true
89
code-line-numbers: false
10+
knitr: true
911
---
1012

11-
## In the morning
13+
## Basic usage
14+
15+
Everything starts with wrapping a codeblock with `.codewindow` fenced div. So
16+
17+
````` markdown
18+
::: {.codewindow}
19+
```{{scss}}
20+
.pink {
21+
color: pink;
22+
}
23+
```
24+
:::
25+
`````
26+
27+
becomes
1228

1329
::: {.codewindow}
30+
1431
```{scss}
1532
.pink {
1633
color: pink;
1734
}
1835
```
1936
:::
2037

21-
my friend
38+
## file name on file tab
2239

23-
::: {.codewindow .sass}
40+
THe file name can be specified by writing the name as plain text inside the `codewindow` div. So
41+
42+
````` markdown
43+
::: {.codewindow}
44+
styles.scss
45+
```{{scss}}
46+
.pink {
47+
color: pink;
48+
}
49+
```
50+
:::
51+
`````
52+
53+
becomes
54+
55+
::: {.codewindow}
56+
styles.scss
2457
```{scss}
2558
.pink {
2659
color: pink;
2760
}
2861
```
2962
:::
3063

31-
::: {.codewindow width="50%"}
64+
## File icon
65+
66+
Adding a css class to the `.codewindow` div will add icon if supported. so
67+
68+
````` markdown
69+
::: {.codewindow .sass}
70+
styles.scss
71+
```{{scss}}
72+
.pink {
73+
color: pink;
74+
}
75+
```
76+
:::
77+
`````
78+
79+
becomes
80+
81+
::: {.codewindow .sass}
82+
styles.scss
3283
```{scss}
3384
.pink {
3485
color: pink;
3586
}
3687
```
3788
:::
3889

90+
## Setting width
3991

40-
## Getting up
92+
The `width` argument is natively supported, so the width can be set like so:
4193

42-
- Turn off alarm
43-
- Get out of bed
94+
````` markdown
95+
::: {.codewindow .sass width="350px"}
96+
styles.scss
97+
```{{scss}}
98+
.pink {
99+
color: pink;
100+
}
101+
```
102+
:::
103+
`````
44104

45-
## Breakfast
105+
becomes
46106

47-
- Eat eggs
48-
- Drink coffee
107+
::: {.codewindow .sass width="350px"}
108+
styles.scss
109+
```{scss}
110+
.pink {
111+
color: pink;
112+
}
113+
```
114+
:::
49115

50-
# In the evening
116+
## Additional notes
51117

52-
## Dinner
118+
These divs should work like any other divs. So you can pass in other styles with `styles=""` and use [absolute position](https://quarto.org/docs/presentations/revealjs/advanced.html#absolute-position)
53119

54-
- Eat spaghetti
55-
- Drink wine
120+
See next slide for examples
56121

57-
## Going to sleep
122+
## Additional notes
58123

59-
- Get in bed
60-
- Count sheep
124+
::: {.codewindow .sass .absolute top="70%" left="35%" width="350px"}
125+
styles.scss
126+
```{scss}
127+
.pink {
128+
color: pink;
129+
}
130+
```
131+
:::
61132

62-
```{r}
63-
1 + 1
133+
::: {.codewindow .sass .absolute top="35%" left="10%" width="350px" style="transform: rotate(-15deg);"}
134+
styles.scss
135+
```{scss}
136+
.yellow {
137+
color: yellow;
138+
}
64139
```
140+
:::
65141

142+
::: {.codewindow .sass .absolute top="35%" left="60%" width="350px" style="transform: rotate(15deg);"}
143+
styles.scss
144+
```{scss}
145+
.blue {
146+
color: blue;
147+
}
148+
```
149+
:::

0 commit comments

Comments
 (0)