Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

avinab-neogy
Copy link
Collaborator

Description

  • Removed the third Docker-related image from container_setup/local_setup and replaced it with a fenced code block showing the relevant terminal command and output.
  • In tutorials/running_r, replaced the last image with the corresponding R code example using an Rconsole fenced code block.

These changes improve accessibility and maintainability by using code fencing for input/output examples instead of screenshots.

(closes #210)

@avinab-neogy avinab-neogy requested a review from hturner June 13, 2025 07:27
@avinab-neogy
Copy link
Collaborator Author

Hi @hturner,
I have tried to keep the changes as minimal as possible, let me know if I should add more changes because I had thought of a lot of changes but then the screenshots were needed as well in some places.
Thanks!

@avinab-neogy avinab-neogy self-assigned this Jun 13, 2025
Comment on lines +61 to -64
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.
Copy link
Member

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.

Copy link
Collaborator Author

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.

Comment on lines +63 to +66
```console
$ echo $BUILDDIR
/workspaces/r-dev-env/bin/R
```
Copy link
Member

Choose a reason for hiding this comment

The 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 console block rather than a bash block, and include both the bash command and the output (in future cases you may need to work through the tutorial to get the correct output!). Don't forget to prefix bash commands with the command prompt $ (ideally we could use /workspaces/r-dev-env (devel) $ as the full prompt, but the syntax highlighter then gets confused with bash commands that include dollar signs, so stick with a simple $ prompt).

The syntax highlighting we get with the Material theme doesn't look very different for console blocks, so I have committed some custom CSS to style the input differently from the output (input is black, output is grey) and to make the prompt symbol clearer (coloured blue). For inputs, I have applied the same styling to bash blocks, for consistency.

Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Heather, I understand what you mean!

Copy link
Member

@hturner hturner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for requesting a review of these initial changes - I've made some comments which should be helpful for finalising the pages you have started work on and updating further help pages.

I notice the list numbering is not correct in container_setup/local_setup/localsetup.md because the code blocks and text have not been indented correctly. It is probably best to address this in a separate PR, so we can focus on getting the code block right.

Comment on lines +22 to +24
```Rconsole
hist(rnorm(1000))
```
Copy link
Member

Choose a reason for hiding this comment

The 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.

> hist(rnorm(1000))

However, an Rconsole block is not suitable in the case. The screenshot is intended to show the R script file, the hist(rnorm(1000)) command sent to the R terminal and the histogram in the plot window. Unfortunately, the screenshot here is wrong, it shows source("/workspaces/r-dev-env/R/test.R", encoding = "UTF-8"), which is the result of running Cmd/Ctrl + Shift + s not Cmd/Ctrl + enter, which is the short-cut we wish to document. You could fix this at the same time as the code fencing or open a separate issue about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make use of console/Rconsole fenced code blocks
2 participants