Skip to content
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

Overhaul package #45

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
992ac86
ignore system-specific temp, backup, thumbnail etc. files
salim-b Oct 11, 2020
48ccc6b
add @salim-b as contributor
salim-b Oct 11, 2020
aca7027
avoid `$` due to partial matching
salim-b Oct 11, 2020
3fdd156
add lintr config
salim-b Oct 12, 2020
5a166ca
improve pkg title and description
salim-b Oct 12, 2020
e83e1c2
tidy DESCRIPTION
salim-b Oct 12, 2020
756017d
enable roxygen2 markdown support pkg-wide
salim-b Oct 13, 2020
752e311
set explicit line end conversion in project config
salim-b Oct 13, 2020
1234a1c
lintr config: add object length linter
salim-b Oct 13, 2020
9b4467f
add additional dependencies
salim-b Oct 13, 2020
9c639c2
use comments as rscodeio identifiers in custom QSS files
salim-b Oct 13, 2020
8a68484
overhaul package:
salim-b Oct 13, 2020
2608140
remove unnecessary noise
salim-b Oct 13, 2020
869b16a
minor doc change
salim-b Oct 13, 2020
166340c
remove redundancy
salim-b Oct 14, 2020
138a28a
avoid pipe operator
salim-b Oct 14, 2020
e21a6e1
fix styling of hyperlinked <code> in help pane
salim-b Oct 14, 2020
38d3308
document()
salim-b Oct 14, 2020
b5dd995
set per-project Rmd formatting harmonization
salim-b Oct 15, 2020
2ee99f9
update README
salim-b Oct 15, 2020
5e15c2d
be more precise about QSS terminology
salim-b Oct 15, 2020
cb9ebdf
fix formatting of doc
salim-b Oct 16, 2020
964295b
be more precise
salim-b Oct 17, 2020
35892ff
mention necessary menu bar styling reinstallation after RStudio update
salim-b Oct 17, 2020
59303cf
update pkg version (dev)
salim-b Oct 17, 2020
8a9e739
`install_menu_theme()`: add param `reload_editor_theme`
salim-b Oct 23, 2020
24859df
write README in R Markdown format and let knitr/Pandoc create `README…
salim-b Jan 27, 2021
c3db00e
gitignore README source file
salim-b Apr 30, 2022
c00d74d
update RoxygenNote
salim-b Apr 30, 2022
6fc324c
tweak help pane CSS
salim-b Apr 30, 2022
cba1200
Rproj conf: clean package sources prior to installation
salim-b May 12, 2022
1c53a82
fix package installation hint background color
salim-b May 12, 2022
5715ec4
fix history search results background color
salim-b May 12, 2022
29515ea
fix history search results background color (2)
salim-b May 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
write README in R Markdown format and let knitr/Pandoc create `README…
….md`
salim-b committed Jan 27, 2021
commit 24859dfdaa97dbf170c361c46e93c5a196c92a7b
117 changes: 117 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
output: rmarkdown::github_document
---

<p align="center">

<img src="./inst/media/rscodeio.png" width="480" height="270"/>

</p>

<p align="center">

<a href="https://cran.r-project.org/package=rscodeio"> <img src="https://img.shields.io/cran/v/rscodeio?style=flat-square" alt="cran"/> </a>
<a href="https://github.com/anthonynorth/rscodeio/releases/latest">
<img src="https://img.shields.io/github/v/release/anthonynorth/rscodeio?sort=semver&amp;style=flat-square" alt="release"/> </a>
<a href="https://www.tidyverse.org/lifecycle/#experimental">
<img src="https://img.shields.io/badge/lifecycle-experimental-orange?style=flat-square" alt="lifecycle"/> </a>

</p>

# rscodeio

An RStudio theme inspired by Visual Studio Code

## Prerequisites

- RStudio 1.2.0 or later

- Administrator privileges (more on that [below](#details))

## Installation

Run the following to install the package:

``` {.r}
if (!("remotes" %in% rownames(installed.packages()))) {
install.packages(pkgs = "remotes",
repos = "https://cloud.r-project.org/")
}

remotes::install_github("anthonynorth/rscodeio")
```

Then run the following to install the rscodeio editor themes and menu bar styling:

``` {.r}
rscodeio::install_themes()
```

The above command right away activates the editor theme variant specified in the `apply_theme` argument (which defaults to `"rscodeio"`). To activate the second
editor theme variant instead, run:

``` {.r}
rscodeio::install_themes(apply_theme = "Tomorrow Night Bright (rscodeio)")
```

The chosen editor theme can be changed anytime later in RStudio's global options.

To completely uninstall the rscodeio editor themes and menu bar styling again, run:

``` {.r}
rscodeio::uninstall_themes()
```

## Details {#details}

This package provides two greyish dark RStudio editor themes which only differ in the syntax highlighting style: while `rscodeio` offers the colors found in
Visual Studio Code, `Tomorrow Night Bright (rscodeio)` combines the same dark interface theming with the syntax highlighting colors from the similarly named
editor theme provided by RStudio.

Furthermore, RStudio's menu bar will be changed to a matching dark style, something which is not exposed by [RStudio's current theming
API](https://rstudio.github.io/rstudio-extensions/rstudio-theme-creation.html) and therefore requires administrator privileges to replace the relevant [Qt Style
Sheet (QSS)](https://doc.qt.io/Qt-5/stylesheet-syntax.html) files in RStudio's installation directory.

- On Linux, it will be asked interactively for administrator credentials by calling [Polkit](https://en.wikipedia.org/wiki/Polkit)'s
[`pkexec`](https://www.freedesktop.org/software/polkit/docs/latest/pkexec.1.html).

- On Windows, RStudio must be run as administrator for rscodeio being able to successfully install the menu bar styling.

- On macOS and RStudio Server, menu bar styling is not necessary and thus administrator privileges are not required. (On macOS, the light/dark menu bar
styling is inherited from the OS, so you might want to use your dark OS theme.)

### Recommended RStudio settings

For best results, make sure the following settings are enabled:

- <kbd>Tools</kbd> → <kbd>Global Options...</kbd> → <kbd>Code</kbd> → <kbd>Display</kbd> → **☑ Highlight selected line**
- <kbd>Tools</kbd> → <kbd>Global Options...</kbd> → <kbd>Code</kbd> → <kbd>Display</kbd> → **☑ Show indent guides**
- <kbd>Tools</kbd> → <kbd>Global Options...</kbd> → <kbd>Code</kbd> → <kbd>Display</kbd> → **☑ Show syntax highlighting in console input**
- <kbd>Tools</kbd> → <kbd>Global Options...</kbd> → <kbd>Code</kbd> → <kbd>Display</kbd> → **☑ Highlight R function calls**

### Switching to another theme

As mentioned above, rscodeio provides custom editor theme variants but also styles RStudio's menu bar by replacing some QSS files. This means the RStudio menu
bar will remain dark even if you switch to another editor theme. To revert the menu bar to its default state, **administrator privileges are required**.

To only remove the menu bar styling, run

``` {.r}
rscodeio::uninstall_menu_theme()
```

To reinstall the menu bar styling again, run

``` {.r}
rscodeio::install_menu_theme()
```

On Windows, for both of the above to work, Rstudio must be run as administrator.

**Note** that the menu bar styling has to be reinstalled after *every* update or reinstallation of RStudio. This is because the custom QSS files provided by
rscodeio get overwritten during RStudio's installation process.

### Supported Platforms

`rscodeio` has only been tested on Windows and Linux (Ubuntu and Pop!\_OS Linux) so far. [Feedback](https://github.com/anthonynorth/rscodeio/issues) from other
platforms is welcome.
104 changes: 66 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@

<p align="center">

<img src="./inst/media/rscodeio.png" width="480" height="270"/>

</p>

<p align="center">

<a href="https://cran.r-project.org/package=rscodeio"> <img src="https://img.shields.io/cran/v/rscodeio?style=flat-square" alt="cran"/> </a>
<a href="https://github.com/anthonynorth/rscodeio/releases/latest">
<img src="https://img.shields.io/github/v/release/anthonynorth/rscodeio?sort=semver&amp;style=flat-square" alt="release"/> </a>
<a href="https://www.tidyverse.org/lifecycle/#experimental">
<img src="https://img.shields.io/badge/lifecycle-experimental-orange?style=flat-square" alt="lifecycle"/> </a>
<a href="https://cran.r-project.org/package=rscodeio">
<img src="https://img.shields.io/cran/v/rscodeio?style=flat-square" alt="cran"/>
</a> <a href="https://github.com/anthonynorth/rscodeio/releases/latest">
<img src="https://img.shields.io/github/v/release/anthonynorth/rscodeio?sort=semver&amp;style=flat-square" alt="release"/>
</a> <a href="https://www.tidyverse.org/lifecycle/#experimental">
<img src="https://img.shields.io/badge/lifecycle-experimental-orange?style=flat-square" alt="lifecycle"/>
</a>

</p>

@@ -28,7 +30,7 @@ An RStudio theme inspired by Visual Studio Code

Run the following to install the package:

``` {.r}
``` r
if (!("remotes" %in% rownames(installed.packages()))) {
install.packages(pkgs = "remotes",
repos = "https://cloud.r-project.org/")
@@ -37,77 +39,103 @@ if (!("remotes" %in% rownames(installed.packages()))) {
remotes::install_github("anthonynorth/rscodeio")
```

Then run the following to install the rscodeio editor themes and menu bar styling:
Then run the following to install the rscodeio editor themes and menu
bar styling:

``` {.r}
``` r
rscodeio::install_themes()
```

The above command right away activates the editor theme variant specified in the `apply_theme` argument (which defaults to `"rscodeio"`). To activate the second
editor theme variant instead, run:
The above command right away activates the editor theme variant
specified in the `apply_theme` argument (which defaults to
`"rscodeio"`). To activate the second editor theme variant instead, run:

``` {.r}
``` r
rscodeio::install_themes(apply_theme = "Tomorrow Night Bright (rscodeio)")
```

The chosen editor theme can be changed anytime later in RStudio's global options.
The chosen editor theme can be changed anytime later in RStudio’s global
options.

To completely uninstall the rscodeio editor themes and menu bar styling again, run:
To completely uninstall the rscodeio editor themes and menu bar styling
again, run:

``` {.r}
``` r
rscodeio::uninstall_themes()
```

## Details {#details}
## Details

This package provides two greyish dark RStudio editor themes which only differ in the syntax highlighting style: while `rscodeio` offers the colors found in
Visual Studio Code, `Tomorrow Night Bright (rscodeio)` combines the same dark interface theming with the syntax highlighting colors from the similarly named
editor theme provided by RStudio.
This package provides two greyish dark RStudio editor themes which only
differ in the syntax highlighting style: while `rscodeio` offers the
colors found in Visual Studio Code, `Tomorrow Night Bright (rscodeio)`
combines the same dark interface theming with the syntax highlighting
colors from the similarly named editor theme provided by RStudio.

Furthermore, RStudio's menu bar will be changed to a matching dark style, something which is not exposed by [RStudio's current theming
API](https://rstudio.github.io/rstudio-extensions/rstudio-theme-creation.html) and therefore requires administrator privileges to replace the relevant [Qt Style
Sheet (QSS)](https://doc.qt.io/Qt-5/stylesheet-syntax.html) files in RStudio's installation directory.
Furthermore, RStudio’s menu bar will be changed to a matching dark
style, something which is not exposed by [RStudio’s current theming
API](https://rstudio.github.io/rstudio-extensions/rstudio-theme-creation.html)
and therefore requires administrator privileges to replace the relevant
[Qt Style Sheet (QSS)](https://doc.qt.io/Qt-5/stylesheet-syntax.html)
files in RStudio’s installation directory.

- On Linux, it will be asked interactively for administrator credentials by calling [Polkit](https://en.wikipedia.org/wiki/Polkit)'s
- On Linux, it will be asked interactively for administrator
credentials by calling
[Polkit](https://en.wikipedia.org/wiki/Polkit)’s
[`pkexec`](https://www.freedesktop.org/software/polkit/docs/latest/pkexec.1.html).

- On Windows, RStudio must be run as administrator for rscodeio being able to successfully install the menu bar styling.
- On Windows, RStudio must be run as administrator for rscodeio being
able to successfully install the menu bar styling.

- On macOS and RStudio Server, menu bar styling is not necessary and thus administrator privileges are not required. (On macOS, the light/dark menu bar
styling is inherited from the OS, so you might want to use your dark OS theme.)
- On macOS and RStudio Server, menu bar styling is not necessary and
thus administrator privileges are not required. (On macOS, the
light/dark menu bar styling is inherited from the OS, so you might
want to use your dark OS theme.)

### Recommended RStudio settings

For best results, make sure the following settings are enabled:

- <kbd>Tools</kbd> → <kbd>Global Options...</kbd> → <kbd>Code</kbd> → <kbd>Display</kbd> → **☑ Highlight selected line**
- <kbd>Tools</kbd> → <kbd>Global Options...</kbd> → <kbd>Code</kbd> → <kbd>Display</kbd> → **☑ Show indent guides**
- <kbd>Tools</kbd> → <kbd>Global Options...</kbd> → <kbd>Code</kbd> → <kbd>Display</kbd> → **☑ Show syntax highlighting in console input**
- <kbd>Tools</kbd> → <kbd>Global Options...</kbd> → <kbd>Code</kbd> → <kbd>Display</kbd> → **☑ Highlight R function calls**
- <kbd>Tools</kbd> → <kbd>Global Options…</kbd> → <kbd>Code</kbd> →
<kbd>Display</kbd> → **☑ Highlight selected line**
- <kbd>Tools</kbd> → <kbd>Global Options…</kbd> → <kbd>Code</kbd> →
<kbd>Display</kbd> → **☑ Show indent guides**
- <kbd>Tools</kbd> → <kbd>Global Options…</kbd> → <kbd>Code</kbd> →
<kbd>Display</kbd> → **☑ Show syntax highlighting in console input**
- <kbd>Tools</kbd> → <kbd>Global Options…</kbd> → <kbd>Code</kbd> →
<kbd>Display</kbd> → **☑ Highlight R function calls**

### Switching to another theme

As mentioned above, rscodeio provides custom editor theme variants but also styles RStudio's menu bar by replacing some QSS files. This means the RStudio menu
bar will remain dark even if you switch to another editor theme. To revert the menu bar to its default state, **administrator privileges are required**.
As mentioned above, rscodeio provides custom editor theme variants but
also styles RStudio’s menu bar by replacing some QSS files. This means
the RStudio menu bar will remain dark even if you switch to another
editor theme. To revert the menu bar to its default state,
**administrator privileges are required**.

To only remove the menu bar styling, run

``` {.r}
``` r
rscodeio::uninstall_menu_theme()
```

To reinstall the menu bar styling again, run

``` {.r}
``` r
rscodeio::install_menu_theme()
```

On Windows, for both of the above to work, Rstudio must be run as administrator.
On Windows, for both of the above to work, Rstudio must be run as
administrator.

**Note** that the menu bar styling has to be reinstalled after *every* update or reinstallation of RStudio. This is because the custom QSS files provided by
rscodeio get overwritten during RStudio's installation process.
**Note** that the menu bar styling has to be reinstalled after *every*
update or reinstallation of RStudio. This is because the custom QSS
files provided by rscodeio get overwritten during RStudio’s installation
process.

### Supported Platforms

`rscodeio` has only been tested on Windows and Linux (Ubuntu and Pop!\_OS Linux) so far. [Feedback](https://github.com/anthonynorth/rscodeio/issues) from other
`rscodeio` has only been tested on Windows and Linux (Ubuntu and
Pop!\_OS Linux) so far.
[Feedback](https://github.com/anthonynorth/rscodeio/issues) from other
platforms is welcome.