Skip to content

extendr/extendr.github.io

Repository files navigation

extendr.rs

The extendr.rs website provides documentation and news for extendr, a developer-first utility for building R packages that call Rust code. The website is built using the Rust-powered static site generator, Zola.

Stack

  • Zola — Rust-powered static site generator, a simplified version of Hugo with a powerful templating engine
  • Tailwind CSS v4 — utility-first CSS framework
  • basecoat-css — a lightweight shadcn/ui components library built with Tailwind CSS
  • just — a Rust-powered command runner, similar to make
  • Quarto — currently used to execute code chunks and render to commonmark, though this is likely to change
  • Node.jsnpm and npx are also used to manage JS dependencies
  • iconify — a Tailwind extension for icons (currently limited to fa7-brands, lucide, and mdi icons)

Pipeline

Running just build will do the following:

  1. Tailwind compiles css/*.css to static/style.css.
  2. Quarto executes code in content/**/*.qmd and compiles to CommonMark in content/**/*.md.
  3. Zola compiles commonmark to HTML and builds site in public/.

For development, the same is achieved with just dev, which will serve the site and open it in the default browser with live reload.

Structure

.
├── zola.toml          # Site configuration
├── justfile           # All build/dev/scaffolding tasks
├── content/           # Site content
│   ├── blog/          # Blog posts
│   ├── contributing/  # Contributor docs
│   ├── development/   # Development docs
│   ├── publishing/    # Publishing docs
│   └── rust-intro/    # Rust intro for R users
├── templates/         # Zola HTML templates + shortcodes and macros
├── css/               # Tailwind input
├── static/            # Compiled CSS, JS, assets
├── package.json       # Node.js project manifest
├── packages/          # Example R packages built with extendr
└── scripts/           # R scripts

Development

Prerequisites

In addition to the stack software listed above, you will need R installed and the most recent release version of the rextendr package. The just command line runner will also be very beneficial to you.

Installation

# install Node.js dependencies
just install

Development

# start a local development server (Zola serve and Tailwind watcher)
just dev

Building

# render Tailwind style.css and call zola build
just build

Available commands

Run just with no arguments to list all recipes.

Recipe Description
basecoat Move basecoat component js files from node_modules to static/js
build Compile Tailwind css, then build the site with Zola
check Try to build site without rendering (checks links)
default List all available recipes
dev Run Tailwind watch and Zola live serve in parallel
install Install Node.js dependencies
new-page path Create a new documentation page at content/{{path}}
new-post title Create a new blog post at content/blog/{{date}}-{{title}}/index.qmd
new-section path Create a new documentation section at content/{{path}}/
render path Render a single qmd file at content/{{path}}
render-all Render all qmd files in content/ (except those in "blog/")
render-dir path Render all qmd files in content/{{path}}/ non-recursively (fails if path="blog/")
render-post title Render a blog post at content/blog/{{date}}-{{title}}/index.qmd
reset Clear public directory generated by Zola
tailwind-build Generate Tailwind static/style.css from css/style.css

Releases

No releases published

Packages

 
 
 

Contributors