-
Notifications
You must be signed in to change notification settings - Fork 15
Use console and Rconsole fenced code blocks for input/output examples #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ on: | |
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-deploy: | ||
if: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,13 +52,15 @@ systemctl start docker | |
in Dev Container. Click on `Reopen in DevContainer` button.  | ||
|
||
7. After clicking on that button we will see our container is getting ready. It | ||
7. After clicking on that button we will see our container is getting | ||
ready. It | ||
will take some time. So till that time you can have coffee :)  | ||
8. We can also test whether the dev container is working or not by just printing | ||
the environment variables mentioned in the welcome message on the terminal. And | ||
there we go!!! We have setup our R Dev Container locally.  | ||
the environment variables mentioned in the welcome message on the | ||
terminal. And there we go!!! We have setup our R Dev Container locally. | ||
|
||
9. The container will be closed when you close VSCode. To reopen the container, | ||
open the `r-dev-env` directory in VSCode. | ||
```console | ||
$ echo $BUILDDIR | ||
/workspaces/r-dev-env/bin/R | ||
``` | ||
Comment on lines
+63
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The old screenshot showed both input and output in the bash terminal, so you should use a The syntax highlighting we get with the Material theme doesn't look very different for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case it is unclear - I corrected lines 63 - 66 when adding the custom CSS, so the code block is now correct, it just needs moving. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you Heather, I understand what you mean! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* customise CSS for bash code chunks and bash sessions ("console") */ | ||
|
||
/* .gp = Generic Prompt (e.g., shell prompt like $ or >) */ | ||
/* default: var(--md-code-hl-generic-color); */ | ||
/* prompts treated as normal code in bash code chunks */ | ||
.language-console.highlight code span.gp{ | ||
color: #7aa2cd; | ||
} | ||
|
||
/* .go = Generic output: output from a command */ | ||
/* default: var(--md-code-hl-generic-color); */ | ||
.language-console.highlight code span.go, | ||
.language-bash.highlight code span.go { | ||
color: var(--md-code-hl-generic-color); | ||
} | ||
|
||
/* .nb = Built-in name like print, echo */ | ||
/* default: var(--md-code-hl-constant-color); */ | ||
.language-console.highlight code span.nb, | ||
.language-bash.highlight code span.nb { | ||
color: var(--md-code-hl-constant-color); | ||
} | ||
|
||
/* .nv = Named variables like $BUILDDIR */ | ||
/* default: var(--md-code-hl-variable-color); */ | ||
/* use same as normal text: var(--md-code-fg-color); */ | ||
.language-console.highlight code span.nv, | ||
.language-bash.highlight code span.nv { | ||
color: var(--md-code-fg-color); | ||
} | ||
|
||
/* .c1 = Built-in name like print, echo */ | ||
/* default: var(--md-code-hl-comment-color); */ | ||
.language-console.highlight code span.c1, | ||
.language-bash.highlight code span.c1 { | ||
color: var(--md-code-hl-comment-color); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,7 @@ VSCode window. | |
send code from the `.R` file to the R terminal by pressing `cmd/ctrl + enter`. | ||
|
||
  | ||
|
||
```Rconsole | ||
hist(rnorm(1000)) | ||
``` | ||
Comment on lines
+22
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rconsole blocks are for displaying input and output in an R session, similar to console blocks for sessions in a bash terminal. You need to include the prompt for input lines so that syntax highlighting is applied, i.e.
However, an Rconsole block is not suitable in the case. The screenshot is intended to show the R script file, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put the new code block after the first sentence in step 8 and before "And there we go!!!".
Step 9 (deleted lines 63 and 64) should not have been deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this might have gotten deleted after running the linter is what Im thinking
will correct this.