“Structured text, for an unstructured world.”

This package is a wrapper for archieml-js, a parser for the New York Times’ ArchieML markup format. ArchieML is designed for non-coders writing documents that need to include some structured data, especially writers producing structured text that will be rendered on website or interactive graphics. Learn more about ArchieML’s syntax and use cases at http://archieml.org/, and see examples of its use here.

Installation

Install rchie from CRAN with:

install.packages("rchie")

Install the development version of rchie from GitHub using remotes, devtools, or my zero-dependency preference:

source("https://install-github.me/noamross/rchie")

Note that, because rchie uses the V8 package, it has a system requirement of libv8. See the V8 README for instructions.

Usage

from_aml can read ArchieML from a string, file, URL, or connection. It returns an R list:

If you want the raw JSON produced by the archieml-js parser, use aml_to_json().

Using Google Docs

Since a common use-case for ArchieML is reading semi-structured text written in Google Docs, rchie includes optional methods to read items from Google Drive. To use them, you must have the googledrive package installed and pass a drive_id object to from_aml(). Here we pull data from this Google Doc:

If you are using Google Docs to input ArchieML regularly, the ArchieML Google Docs plugin is quite helpful for previewing parsed data as you type.

Contributing

I’d love you to contribute to rchie! I’d especially like some examples of use-cases - R Markdown documents, Shiny Apps, etc. - that I can feature in the documentation. Please take a look the the contributing guidelines.

Note that rchie is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.