-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve p2 #27
Improve p2 #27
Conversation
Use tab panels for R and Python codes
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.
This looks way better, many thanks @yyuanxuan I just made a couple of minor comments, let's see how it looks on the website.
@@ -32,27 +33,28 @@ Install the packages by typing in the following commands into RStudio (you do no | |||
|
|||
If you need to install any of these packages use: | |||
|
|||
::: {.panel-tabset group="language"} | |||
::: {.panel-tabset} |
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.
Why not 'language'?
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.
When this option is set, clicking on the Python tab will switch all code blocks to Python. However, due to the different lengths of the R and Python code blocks, this causes the content within the current browser window to suddenly jump, creating significant interference with reading. You have to scroll up or down to find the section you were just reading. Students using Python still need to compare the results of the R code execution, so such page jumps and interruptions can happen frequently. Removing the language grouping can avoid this problem, as each code block switch would only apply to the current tab, resulting in less disruption to the reading experience - in my opinion, this has a better user experience.
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.
OK, great explanation, thanks!
#| eval: false | ||
if (!require("pak")) install.packages("pak") | ||
pak::pkg_install(c("sf", "tidyverse", "remotes")) | ||
# GitHub pkgs | ||
pak::pkg_install("Nowosad/spDataLarge") | ||
``` | ||
|
||
```{r} | ||
``` {r} |
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.
Why the gap here?
library(sf) # vector data package | ||
library(tidyverse) # tidyverse packages | ||
library(spData) # spatial data package | ||
``` | ||
|
||
## Python | ||
|
||
```{python, eval=FALSE} | ||
``` {python} |
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.
👍
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.
But without the space I think is better:
``` {python} | |
```{python} |
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.
Thanks for pointing these out. I will fix them in the future— the added space was by mistake and not intentional.
* change one line in README.qmd * improve p2 Use tab panels for R and Python codes
No description provided.