Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r-lib/clisymbols
Unicode symbols for CLI applications, with fallbacks
https://github.com/r-lib/clisymbols
r
Last synced: 3 months ago
JSON representation
Unicode symbols for CLI applications, with fallbacks
- Host: GitHub
- URL: https://github.com/r-lib/clisymbols
- Owner: r-lib
- License: other
- Created: 2015-04-14T02:57:39.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-11-03T19:29:20.000Z (about 1 year ago)
- Last Synced: 2024-06-19T06:49:22.070Z (5 months ago)
- Topics: r
- Language: R
- Homepage:
- Size: 69.3 KB
- Stars: 78
- Watchers: 4
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - r-lib/clisymbols - Unicode symbols for CLI applications, with fallbacks (R)
README
```{r, setup, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(
comment = "#>",
tidy = FALSE,
error = FALSE)
```# clisymbols
[![R-CMD-check](https://github.com/r-lib/clisymbols/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/clisymbols/actions/workflows/R-CMD-check.yaml)
[![](https://www.r-pkg.org/badges/version/clisymbols)](https://www.r-pkg.org/pkg/clisymbols)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/clisymbols)](https://www.r-pkg.org/pkg/clisymbols)
[![Codecov test coverage](https://codecov.io/gh/r-lib/clisymbols/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/clisymbols?branch=main)> Unicode symbols with Windows fallbacks
![](/screenshot.png)
Inspired by (and mostly copied from) the
[figures](https://github.com/sindresorhus/figures) JavaScript project.## Install
Stable version:
```{r eval = FALSE}
install.packages("clisymbols")
```Development version:
```{r eval = FALSE}
pak::pak("r-lib/clisymbols")
```## Usage
```{r}
library(clisymbols)
cat(symbol$tick, "All good\n")
cat(symbol$cross, "Problem\n")
```Here is a list of all symbols, with their names:
```{r}
for (i in seq_along(symbol)) {
cat(symbol[[i]], "\t", names(symbol)[i], "\n", sep = "")
}
```### Fallback symbols
Some terminals do not support (all) Unicode characters, and on these reasonable
ASCII substitutes are used:```{r echo = FALSE}
for (i in seq_along(clisymbols:::symbol_win)) {
cat(format(clisymbols:::symbol_win[[i]], width = 4),
names(clisymbols:::symbol_win)[i], "\n", sep = "")
}
```# License
MIT © [Gabor Csardi](https://gaborcsardi.org) and [Sindre Sorhus](https://sindresorhus.com)