Skip to content

Commit 9c6e010

Browse files
authored
Merge pull request #275 from r-devel/docs/210-console-fencing
Fix the general formatting of docs
2 parents d5fcf0e + 052b078 commit 9c6e010

File tree

4 files changed

+80
-23
lines changed

4 files changed

+80
-23
lines changed
Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,75 @@
1-
!!! note Local setup is not recommended on macOS or Windows as the Docker
1+
!!! note
2+
Local setup is not recommended on macOS or Windows as the Docker
23
container will work via a Virtual Machine and building R will take far
34
longer (e.g. a full build may take 1 hour vs 10 minutes!).
45

56
We can also use this codespace locally. For that we need to have some
67
prerequisites installed.
78

8-
#### > Prerequisites
9+
#### Prerequisites
910

1011
1. Docker Engine or Docker Desktop. You can find the docker desktop install
1112
instructions on [Docker Desktop
1213
Docs](https://www.docker.com/products/docker-desktop/).
1314
2. VSCode Editor. You can download and install from [VSCode
1415
website](https://code.visualstudio.com/download).
1516

16-
#### > Steps to run R Development Container locally
17+
#### Steps to run R Development Container locally
1718

1819
1. Clone the [R Dev Container Github
1920
repo](https://github.com/r-devel/r-dev-env/)
21+
2022
2. In a terminal, change directory to r-dev-env
2123

22-
```bash
23-
cd r-dev-env
24-
```
24+
```bash
25+
cd r-dev-env
26+
```
2527

2628
3. Restart VSCode in the `r-dev-env` directory with the command:
2729

28-
```bash
29-
code .
30-
```
30+
```bash
31+
code .
32+
```
3133

3234
4. Checkout the main branch and pull the latest changes
3335

34-
```bash
35-
git checkout main
36-
git pull
37-
```
36+
```bash
37+
git checkout main
38+
git pull
39+
```
3840

39-
The main branch provides the stable release. If you require an in-development
40-
feature, use the devel branch instead.
41+
The main branch provides the stable release. If you require an in-development
42+
feature, use the devel branch instead.
4143

4244
5. After this step please be sure that your docker engine is started. If you
4345
have installed Docker Desktop just open the Docker Desktop app the engine
4446
starts automatically and if you are using just docker engine make sure to
4547
start it with the following command
4648

47-
```bash
48-
systemctl start docker
49-
```
49+
```bash
50+
systemctl start docker
51+
```
5052

5153
6. We can see pop-up at the bottom right of the VSCode editor which says reopen
52-
in Dev Container. Click on `Reopen in DevContainer` button. ![start
53-
localsetup](../../assets/rdev13.png)
54+
in Dev Container.
55+
Click on `Reopen in Container` button.
56+
57+
![startlocalsetup](../../assets/rdev13.png)
5458

5559
7. After clicking on that button we will see our container is getting ready. It
5660
will take some time. So till that time you can have coffee :) ![start
5761
localsetup](../../assets/rdev24.png)
62+
5863
8. We can also test whether the dev container is working or not by just printing
59-
the environment variables mentioned in the welcome message on the terminal. And
60-
there we go!!! We have setup our R Dev Container locally. ![start
61-
localsetup](../../assets/rdev25.png)
64+
the environment variables mentioned in the welcome message on the terminal.
65+
66+
```console
67+
$ echo $BUILDDIR
68+
/workspaces/r-dev-env/bin/R
69+
```
70+
71+
And there we go!!! We have setup our R Dev Container locally. ![start
72+
localsetup](../../assets/rdev25.png)
6273

6374
9. The container will be closed when you close VSCode. To reopen the container,
6475
open the `r-dev-env` directory in VSCode.

docs/css/custom.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* customise CSS for bash code chunks and bash sessions ("console") */
2+
3+
/* .gp = Generic Prompt (e.g., shell prompt like $ or >) */
4+
/* default: var(--md-code-hl-generic-color); */
5+
/* prompts treated as normal code in bash code chunks */
6+
.language-console.highlight code span.gp{
7+
color: #7aa2cd;
8+
}
9+
10+
/* .go = Generic output: output from a command */
11+
/* default: var(--md-code-hl-generic-color); */
12+
.language-console.highlight code span.go,
13+
.language-bash.highlight code span.go {
14+
color: var(--md-code-hl-generic-color);
15+
}
16+
17+
/* .nb = Built-in name like print, echo */
18+
/* default: var(--md-code-hl-constant-color); */
19+
.language-console.highlight code span.nb,
20+
.language-bash.highlight code span.nb {
21+
color: var(--md-code-hl-constant-color);
22+
}
23+
24+
/* .nv = Named variables like $BUILDDIR */
25+
/* default: var(--md-code-hl-variable-color); */
26+
/* use same as normal text: var(--md-code-fg-color); */
27+
.language-console.highlight code span.nv,
28+
.language-bash.highlight code span.nv {
29+
color: var(--md-code-fg-color);
30+
}
31+
32+
/* .c1 = Built-in name like print, echo */
33+
/* default: var(--md-code-hl-comment-color); */
34+
.language-console.highlight code span.c1,
35+
.language-bash.highlight code span.c1 {
36+
color: var(--md-code-hl-comment-color);
37+
}

docs/tutorials/running_r.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,8 @@ Click on the `R:(not attached)` link to launch an R terminal.
3131
3) You can then send code from the `.R` file to the R terminal by pressing
3232
`cmd/ctrl + enter`.
3333

34+
```R
35+
hist(rnorm(1000))
36+
```
37+
3438
![alt text](../assets/rdev5.png)

mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ theme:
5858
primary: indigo
5959
accent: blue
6060

61+
extra_css:
62+
- css/custom.css
63+
6164
plugins:
6265
- social
6366
- search
@@ -71,6 +74,8 @@ extra:
7174

7275
markdown_extensions:
7376
- pymdownx.highlight:
77+
use_pygments: true
78+
pygments_lang_class: true
7479
anchor_linenums: true
7580
- pymdownx.inlinehilite
7681
- pymdownx.snippets

0 commit comments

Comments
 (0)