Skip to content

Commit 4074e01

Browse files
committed
Fixed icon issue in #336 using fontawesome package
1 parent b068901 commit 4074e01

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

jupyter.Rmd

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
library(magick)
55
library(magrittr)
66
library(knitr)
7+
library(fontawesome)
78
89
knitr::opts_chunk$set(message = FALSE,
910
fig.align = "center")
@@ -102,7 +103,7 @@ process.
102103
To run the a code cell independently, the cell needs to first be activated. This
103104
is done by clicking on it with the cursor. Jupyter will indicate a cell has been
104105
activated by highlighting it with a blue rectangle to its left. After the cell
105-
has been activated (Figure \@ref(fig:activate-and-run-button)), the cell can be run by either pressing the **Run** ($\blacktriangleright$)
106+
has been activated (Figure \@ref(fig:activate-and-run-button)), the cell can be run by either pressing the **Run** (`r fa("play", height = "11px")`)
106107
button in the toolbar, or by using a keyboard shortcut of
107108
`Shift + Enter`.
108109

@@ -117,7 +118,7 @@ To execute all of the code cells in an entire notebook, you have three options:
117118

118119
2. Select **Kernel** >> **Restart Kernel and Run All Cells...** from the menu (Figure \@ref(fig:restart-kernel-run-all)).
119120

120-
3. Click the ($\blacktriangleright\blacktriangleright$) button in the tool bar.
121+
3. Click the (`r fa("fast-forward", height = "11px")`) button in the tool bar.
121122

122123
All of these commands result in all of the code cells in a notebook being run.
123124
However, there is a slight difference between them. In particular, only
@@ -139,8 +140,8 @@ outputs the results. Kernels for many different programming languages have
139140
been created for Jupyter, which means that Jupyter can interpret and execute
140141
the code of many different programming languages. To run R code, your notebook
141142
will need an R kernel. In the top right of your window, you can see a circle
142-
that indicates the status of your kernel. If the circle is empty ($\bigcirc$),
143-
the kernel is idle and ready to execute code. If the circle is filled in ($\bullet$),
143+
that indicates the status of your kernel. If the circle is empty (`r fa("circle", fill = "white", stroke = "black", stroke_width = "10px", height = "11px")`),
144+
the kernel is idle and ready to execute code. If the circle is filled in (`r fa("circle", fill = "black", stroke = "black", stroke_width = "10px", height = "12px")`),
144145
the kernel is busy running some code.
145146

146147
You may run into problems where your kernel \index{kernel!interrupt,restart} is stuck for an excessive amount
@@ -181,7 +182,7 @@ To edit a Markdown cell in Jupyter, you need to double click on the cell. Once
181182
you do this, the unformatted (or *unrendered*) version of the text will be
182183
shown (Figure \@ref(fig:markdown-cell-not-run)). You
183184
can then use your keyboard to edit the text. To view the formatted
184-
(or *rendered*) text (Figure \@ref(fig:markdown-cell-run)), click the **Run** ($\blacktriangleright$) button in the toolbar,
185+
(or *rendered*) text (Figure \@ref(fig:markdown-cell-run)), click the **Run** (`r fa("play", height = "11px")`) button in the toolbar,
185186
or use the `Shift + Enter` keyboard shortcut.
186187

187188
```{r markdown-cell-not-run, echo = FALSE, fig.cap = "A Markdown cell in Jupyter that has not yet been rendered and can be edited.", fig.retina = 2, out.width="100%"}
@@ -201,7 +202,7 @@ By default, all new cells in Jupyter start as code cells, so
201202
the cell format needs to be changed to be recognized and rendered as a Markdown
202203
cell. To do this, click on the cell with your cursor to
203204
ensure it is activated. Then click on the drop-down box on the toolbar that says "Code" (it
204-
is next to the $\blacktriangleright\blacktriangleright$ button), and change it from "**Code**" to "**Markdown**" (Figure \@ref(fig:convert-to-markdown-cell)).
205+
is next to the `r fa("fast-forward", height = "11px")` button), and change it from "**Code**" to "**Markdown**" (Figure \@ref(fig:convert-to-markdown-cell)).
205206

206207
```{r convert-to-markdown-cell, echo = FALSE, fig.cap = "New cells are by default code cells. To create Markdown cells, the cell format must be changed.", fig.retina = 2, out.width="100%"}
207208
image_read("img/convert-to-markdown-cell.png") |>
@@ -226,7 +227,7 @@ As you might know (or at least imagine) by now, Jupyter notebooks are great for
226227
interactively editing, writing and running R code; this is what they were
227228
designed for! Consequently, Jupyter notebooks are flexible in regards to code
228229
cell execution order. This flexibility means that code cells can be run in any
229-
arbitrary order using the **Run** ($\blacktriangleright$) button. But this flexibility has a downside:
230+
arbitrary order using the **Run** (`r fa("play", height = "11px")`) button. But this flexibility has a downside:
230231
it can lead to Jupyter notebooks whose code cannot be executed in a linear
231232
order (from top to bottom of the notebook). A nonlinear notebook is problematic
232233
because a linear order is the conventional way code documents are run, and
@@ -235,7 +236,7 @@ code is used in some automated process, it will need to run in a linear order,
235236
from top to bottom of the notebook. \index{Jupyter notebook!best practices}
236237

237238
The most common way to inadvertently create a nonlinear notebook is to rely solely
238-
on using the $\blacktriangleright$ button to execute cells. For example,
239+
on using the `r fa("play", height = "11px")` button to execute cells. For example,
239240
suppose you write some R code that creates an R object, say a variable named
240241
`y`. When you execute that cell and create `y`, it will continue
241242
to exist until it is deliberately deleted with R code, or when the Jupyter
@@ -288,7 +289,7 @@ We recommend as a best practice to run the entire notebook in a fresh R session
288289
at least 2-3 times within any period of work. Note that,
289290
critically, you *must do this in a fresh R session* by restarting your kernel.
290291
We recommend using either the **Kernel** >>
291-
**Restart Kernel and Run All Cells...** command from the menu or the $\blacktriangleright\blacktriangleright$
292+
**Restart Kernel and Run All Cells...** command from the menu or the `r fa("fast-forward", height = "11px")`
292293
button in the toolbar. Note that the **Run** >> **Run All Cells**
293294
menu item will not restart the kernel, and so it is not sufficient
294295
to guard against these errors.
@@ -327,7 +328,7 @@ their computer to run the analysis successfully.
327328

328329
2. As you write code in a Jupyter notebook, run the notebook in a linear order
329330
and in its entirety often (2-3 times every work session) via the **Kernel** >>
330-
**Restart Kernel and Run All Cells...** command from the Jupyter menu or the $\blacktriangleright\blacktriangleright$
331+
**Restart Kernel and Run All Cells...** command from the Jupyter menu or the `r fa("fast-forward", height = "11px")`
331332
button in the toolbar.
332333

333334
3. Write the code that loads external R packages near the top of the Jupyter

0 commit comments

Comments
 (0)