Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jack-davison/lipsum
Generate placeholder text through R
https://github.com/jack-davison/lipsum
lorem-ipsum r rpackage
Last synced: about 1 month ago
JSON representation
Generate placeholder text through R
- Host: GitHub
- URL: https://github.com/jack-davison/lipsum
- Owner: jack-davison
- License: cc0-1.0
- Created: 2023-08-29T12:35:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-08T08:15:05.000Z (about 1 year ago)
- Last Synced: 2024-06-11T17:06:47.689Z (8 months ago)
- Topics: lorem-ipsum, r, rpackage
- Language: R
- Homepage: https://jack-davison.github.io/lipsum/
- Size: 5.22 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# lipsum: access a variety of placeholder text APIs
[![R-CMD-check](https://github.com/jack-davison/lipsum/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jack-davison/lipsum/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/lipsum)](https://CRAN.R-project.org/package=lipsum)The goal of lipsum is to get easy access to several "Lorem Ipsum" web APIs to simply generate customisable placeholder text. In the R world, this will most likely commonly be used within RMarkdown/Quarto documents and Shiny apps.
The `{lorem}` package also serves a similar purpose, but `{lipsum}`'s interfacing with a variety of APIs may allow for more flexible placeholder outputs. For example, the `lipsum_loripsum()` function gives a lot of control of the kinds of features the placeholder text should have (for example, lists, links, headers, and so on).
`{lipsum}` owes a lot to the [awesome-ipsum](https://github.com/templeman/awesome-ipsum) list, and uses its same categorisations:
* **Practical**, which are placeholder generators that are most useful for "professional" settings. These either generate text in Latin, or business-sounding text like newspaper articles.
* **Whimsical**, which are more playful generators which impersonate celebrities, list the names of dinosaurs, use profanity, and so on. These are perhaps more appropriate for personal projects!
## 💻 Installation
You can install the development version of `{lipsum}` like so:
``` r
#install.packages("pak")
pak::pak("jack-davison/lipsum")
```## 🖱️ Example
Some examples of `{lipsum}` functions are shown below.
### 💼 Practical
The below code generates example lorem ipsum generated using the [loripsum API](https://loripsum.net). This is the most useful, customisable function in the package, and is probably most appropriate for professional use.
```{r example}
ipsum <- lipsum::lipsum_loripsum(n = 3, decorate = TRUE, ol = TRUE, bq = TRUE)
```In R, the output looks like this:
```{r r, results='markup'}
ipsum
```Using GitHub markdown, this ends up looking like:
`r ipsum`
### 🦕 Whimsical
As well as the practical lorem ipsum generators, there are a few "whimsical" generators that are a bit more fun. For example, `lipsum_dino()` generates a load of dinosaur names.
```{r dinosaurs}
dinosaurs <- lipsum::lipsum_dino(n_paras = 3L, n_words = 10L)
````r dinosaurs`
On the other hand, `lipsum_actor()` generates some text as if it were being spoken by a famous person or character from pop culture. The API behind this function gives no control over which voice you are receiving, so the one below is chosen completely at random!
```{r actor}
actor <- lipsum::lipsum_actor(n = 3L)
````r actor`