Giter Club home page Giter Club logo

firn's Introduction

Firn

A Static Site Generator for Org Mode

GitHub release (latest by date including pre-releases)  Discord 

Overview

Firn generates a static site from org-mode files. It is a bit different from other static site generators, in that it intends to be a drop in solution for creating sites from already existing folders of org-files. Further, because org-mode has great capacity for collecting and displaying different kinds of data (links, logbooks, drawers, task keywords, tags) we can make this data available when org-content is parsed into a data structure.

Currently, running the firn binary on a directory of org files performs the following:

  • Reads all .org files in the directory recursively.
  • Parses org-files into data structures with Orgize.
  • Collects all file links and logbooks across all files.
  • Passes files through a template system with Hiccup, and renders to HTML.

Quickstart

  1. Download the latest release (only Mac and Linux currently supported), or use the below code snippet to install:
    curl -s https://raw.githubusercontent.com/theiceshelf/firn/master/install -o install-firn
    chmod +x install-firn && ./install-firn
    # you may need to run the install script with sudo and/or run it with the absolute PWD path:
    # sudo ~/<path-to-script>/install-firn
        
  2. Navigate to your directory of org files
  3. Run firn new
  4. Run firn serve
  5. Run firn build when ready to put your site online!

Usage

The Firn documentation is available here and is mirrored and built from the docs/ folder in this repo.

Firn - A static-site generator for org-mode.

Usage: firn [options] action

Options:
  -p, --port PORT  4000                            Port number
  -h, --help
  -v, --version
  -d, --dir PATH   /Users/tees/Projects/firn/firn  Absolute path of directory to build/serve

Actions:
  build    Build a static site in a directory with org files.
  new      Scaffold files and folders needed to start a new site.
  serve    Runs a development server for processed org files.

Developing

Prerequisites:

  • Download GraalVM and set GRAALVM_HOME.
  • Use gu to install the native-image executable.
  • Install lein
  • Install cargo (we use 1.41.1)

Building

This creates a single binary called firn.

git clone [email protected]:theiceshelf/firn.git && cd firn
# compile Rust, Clojure and the GraalVM Native Image.
bin/compile

Developing

  • From the directory you run your repl, set an environment variable of: DEV=TRUE
  • If you use Emacs, you can set the environment variable to M-x setenv
  • There is a directory for testing Firn on a set of dummy org files, located at clojure/test/firn/demo_org
  • You can run test / build commands inside the core-test namespace.
  • to package up a new version of the rust binary for development (a binary we can shell out to) run the script bin/build-dev-parser
  • NOTE: Some of the functions from the me.raynes.fs have been duplicated in the util.clj namespace; largely, the functions that have issues with reflection.

Thank-you’s

  • Thank you to @borkdude for building some awesome libraries (sci is used in firn to evaluate layouts) and for answering questions about compiling with GraalVM and for figuring out how to compile rust and clojure together.
  • PoiScript’s org-mode parser.
  • mvp.css for base layer styles.

firn's People

Contributors

teesloane avatar edmundmiller avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.