All Projects → kiernann → Gluedown

kiernann / Gluedown

Licence: gpl-3.0
Wrap R vectors in markdown syntax

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Gluedown

Trackmd
Tools for tracking changes in Markdown format within RStudio
Stars: ✭ 89 (+1.14%)
Mutual labels:  markdown, rstats
Markdowntemplates
✅🔻 A collection of alternate R markdown templates
Stars: ✭ 287 (+226.14%)
Mutual labels:  markdown, rstats
Summarytools
R Package to Quickly and Neatly Summarize Data
Stars: ✭ 390 (+343.18%)
Mutual labels:  markdown, rstats
Neuron.vim
📝 Manage your Zettelkasten in {n}vim.
Stars: ✭ 84 (-4.55%)
Mutual labels:  markdown
Laravel Blog
基于Laravel5.8构建的轻量博客应用,支持Markdown,支持图片拖拽上传,界面简洁,SEO友好,支持百度链接自动和手动提交
Stars: ✭ 84 (-4.55%)
Mutual labels:  markdown
Easy web view
Flutter Web Views on Mobile and Web made easy!
Stars: ✭ 85 (-3.41%)
Mutual labels:  markdown
Olsrr
Tools for developing linear regression models
Stars: ✭ 88 (+0%)
Mutual labels:  rstats
Kefirbb
A flexible Java text processor. BB, BBCode, BB-code, HTML, Textile, Markdown, parser, translator, converter.
Stars: ✭ 83 (-5.68%)
Mutual labels:  markdown
React Showdown
Render React components within markdown and markdown as React components!
Stars: ✭ 86 (-2.27%)
Mutual labels:  markdown
R Text Data
List of textual data sources to be used for text mining in R
Stars: ✭ 85 (-3.41%)
Mutual labels:  rstats
Awesome r githubers
This is a list of R developers and advocates on Github. This is to help new comers create a following list.
Stars: ✭ 85 (-3.41%)
Mutual labels:  rstats
Git2rdata
An R package for storing and retrieving data.frames in git repositories.
Stars: ✭ 84 (-4.55%)
Mutual labels:  rstats
Bookeditor
Stars: ✭ 86 (-2.27%)
Mutual labels:  markdown
Grapher
✍️ Large interactive graphs
Stars: ✭ 84 (-4.55%)
Mutual labels:  rstats
Rust Book Chinese
rust 程序设计语言 中文版
Stars: ✭ 1,280 (+1354.55%)
Mutual labels:  markdown
Markdown Plus Plus
Markdown syntax highlighting for Notepad++, by customized UDL file (user defined language)
Stars: ✭ 1,252 (+1322.73%)
Mutual labels:  markdown
Transformr
Smooth Polygon Transformations
Stars: ✭ 87 (-1.14%)
Mutual labels:  rstats
Hypermd
A WYSIWYG Markdown Editor for browsers. Break the Wall between writing and previewing.
Stars: ✭ 1,258 (+1329.55%)
Mutual labels:  markdown
Community Modules
Stars: ✭ 1,258 (+1329.55%)
Mutual labels:  markdown
Blog Vue Typescript
vue + typescript + element-ui 支持 markdown 渲染的博客前台展示
Stars: ✭ 1,262 (+1334.09%)
Mutual labels:  markdown

gluedown

Lifecycle: experimental CRAN status Downloads Codecov test coverage R build status

The goal of gluedown is to ease the transition from R’s powerful vectors to formatted markdown text. The package uses glue() to wrap character vectors in markdown syntax. With the knitr package, users can print the formatted vectors directly to the body of a markdown document.

Installation

Install the release version from CRAN:

install.packages("gluedown")

The development version can be installed from [GitHub] GitHub:

# install.packages("remotes")
remotes::install_github("kiernann/gluedown")

Usage

library(gluedown)
library(stringr)
library(rvest)

Use the results='asis' chunk option to print the formatted output to the body of a document.

```{r results='asis'}
md_order(x = c("Legislative", "Executive", "Judicial"))
```
  1. Legislative
  2. Executive
  3. Judicial

Lists

Printing vectors as markdown lists was the initial inspiration for the package. Here, we use five different functions to create five elements of a new vector.

inlines <- c(
  md_bold("Alabama"),
  md_code("Alaska"),
  md_link("Arizona" = "https://az.gov"),
  md_italic("Arkansas"),
  md_strike("California")
)
print(inlines)
#> [1] "**Alabama**"               "`Alaska`"                 
#> [3] "[Arizona](https://az.gov)" "_Arkansas_"               
#> [5] "~~California~~"

Then we can print that new vector as a list, including the inline formatting.

md_bullet(inlines)
  • Alabama
  • Alaska
  • Arizona
  • Arkansas
  • California

Inline

You can also use gluedown to format R inline code results.

name <- sample(state.name, size = 1)
abb <- state.abb[match(name, state.name)]
# `r md_bold(name)`
# `r md_italic(abb)`

In this case, our randomly selected state is Kentucky, which has the abbreviation KY.

Pipes

All functions are designed to fit within the tidyverse ecosystem and work with pipes.

read_html("https://w.wiki/A58") %>% 
  html_node("blockquote") %>% 
  html_text(trim = TRUE) %>% 
  str_remove("\\[.*\\]") %>% 
  md_quote()

We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.

Extensions

The package primarily uses GitHub Flavored Markdown, with support for useful extensions like task lists.

legislation <- c("Houses passes", "Senate concurs", "President signs")
md_task(legislation, check = 1:2)
  • [x] Houses passes
  • [x] Senate concurs
  • [ ] President signs

Contribute

Please note that the gluedown project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].