Skip to content

lfex/poise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poise

Build Status LFE Versions Erlang Versions Tag

Project Logo

An LFE Library for framework-agnostic generation of static HTML content

Contents

About

This project is getting an overhaul to allow for better control over rendered Markdown in static sites. Progress is being tracked here:

poise aims to be as simple and unopinionated solution as possible to the problem of generating static site content in the LFE/Erlang/BEAM world of web development.

While early versions of the poise LFE library were inspired by the Clojure statis, in more recent years the Rust-based project Zola has informed our design decisiions (in particular the areas where we found it inflexible).

Prerequisites

Before building with rebar3, one needs to have the following installed:

  • gcc, make, and related tools (also git)
  • The Rust build tool cargo preferably installed using rustup
  • The Markdown AST-parser mdsplode (installed using cargo)
  • The jq and oniguruma libraries (used for querying JSON)
  • Erlang and rebar3

To set up the environment variables required by mdsplod, you need to follow the instructions provided here. Once that's done, you will be able to run the following:

cargo install mdsplode
rebar3 compile
rebar3 lfe repl

Usage

You can start poise in the LFE REPL with the following:

(poise:start)

The following are useful to check that the Rust binary is working with LFE:

(sploder:version)
(sploder:ping)
(sploder:echo "this is a test")

You can use a test file to check out some of the content-parsing functionality:

(sploder:read 'md "priv/testing/learn.md"))
(sploder:frontmatter)
(sploder:query "'.children.nodes[] | select((.depth == 3) and .source == \"Getting Started\")'")

Name

poise, n. 1

  1. a stably balanced state; equilibrium
  2. easy self-possessed assurance of manner; gracious tact in coping or handling; the pleasantly tranquil interaction between persons of poise; a particular way of carrying oneself; bearing, carriage

License

Copyright © 2017-2024, Duncan McGreggor

Apache License, Version 2.0


1 https://www.merriam-webster.com/dictionary/poise