All Projects → woeps → refabricator

woeps / refabricator

Licence: MIT license
Static Site Generator for/in ReasonML

Programming Languages

reason
219 projects
javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to refabricator

revery-packager
Helper utility to package Revery applications into installable app bundles
Stars: ✭ 38 (+22.58%)
Mutual labels:  reasonml, esy
Cactus
🌵A composable static site generator
Stars: ✭ 63 (+103.23%)
Mutual labels:  static-site-generator, reasonml
readme-in-static-site
💎 Transform and insert your GitHub readme in your static site.
Stars: ✭ 24 (-22.58%)
Mutual labels:  static-site-generator
webping
🚦 Python script to monitor web pages.
Stars: ✭ 20 (-35.48%)
Mutual labels:  static-site-generator
plain
network .md into .html with plaintext files
Stars: ✭ 70 (+125.81%)
Mutual labels:  static-site-generator
bs-axios
Bucklescript bindings for axios
Stars: ✭ 74 (+138.71%)
Mutual labels:  reasonml
rembrandt
Simple UI framework written in Reasonml.
Stars: ✭ 81 (+161.29%)
Mutual labels:  reasonml
phenomic
DEPRECATED. Please use Next.js instead.
Stars: ✭ 3,246 (+10370.97%)
Mutual labels:  static-site-generator
pokedex-nextjs
Get to know the different render methods that the Next.js framework provides by exploring Pokemons
Stars: ✭ 39 (+25.81%)
Mutual labels:  static-site-generator
bs-decode
Type-safe JSON decoding for ReasonML and OCaml
Stars: ✭ 105 (+238.71%)
Mutual labels:  reasonml
markdown-reason-react
Generate ReasonReact Pages from Markdown
Stars: ✭ 17 (-45.16%)
Mutual labels:  reasonml
vscode-graphiql-explorer
Use GraphiQL + GraphiQL Explorer to build your GraphQL operations, right from inside of VSCode.
Stars: ✭ 35 (+12.9%)
Mutual labels:  reasonml
hugy
Hugy is an Electron desktop app acting as a GUI for the Hugo static site generator.
Stars: ✭ 44 (+41.94%)
Mutual labels:  static-site-generator
minipress
💁‍♂️ miniPress – a static site generator
Stars: ✭ 17 (-45.16%)
Mutual labels:  static-site-generator
yass
Yet Another Static Site (Generator)
Stars: ✭ 18 (-41.94%)
Mutual labels:  static-site-generator
nene
Nēnē: A no-frills static site generator
Stars: ✭ 22 (-29.03%)
Mutual labels:  static-site-generator
bs-reason-apollo
ReactApollo bindings for BS
Stars: ✭ 23 (-25.81%)
Mutual labels:  reasonml
reason-hooks-testing-library
ReasonML bindings for react-hooks-testing-library
Stars: ✭ 24 (-22.58%)
Mutual labels:  reasonml
urlzap
⚡️ Your own static URL shortener
Stars: ✭ 57 (+83.87%)
Mutual labels:  static-site-generator
mpa-frontend-template
🔥 Template based on webpack, pug, stylus, es6, postcss for multi page applications
Stars: ✭ 27 (-12.9%)
Mutual labels:  static-site-generator

Refabricator

A Static Site Generator written in and for ReasonML.
Go right to the examples.

This project is Work In Progress and published to get early feedback from the community.

This project uses Esy to compile ReasonML to native.

Goals

Library and Binary

This project aims to provide a (pre-built) cli application - called refabricate.exe - covering the most common usecases as well as a library. This Library - called Refabricator - can be used to create a tailormade generator for more specific use-cases.

Extendability & Customizability

Extendability and customizability shall be focused on during development. Bot the library and binary shall stay versatile and easily adaptable to specific needs.

Proof of Concept

Currently work is done mostly on the Proof of concept milestone. Which means:

  • a first version which demonstrates the value in having this application and library
  • shipping a prebuilt binary with sane defaults for a site generator
  • followin library featureset:
    • read text of any local file
    • read local md files and convert it to html
    • resolve links in md to correct html ones
    • read remote md files (git server / maybe also REST api?)
    • write generated files to local filesystem
    • write generated files to remote (maybe ftp?)
    • provide rudimental way for templating
  • following binary features:
    • wrap all available library features in a nice CLI application
    • provide sane defaults
    • demonstrate usage and concepts of the library

Long term goals

On completion of the Proof of concept milestone some of the more relevant tasks are:

  • Research on techniques to incorperate customizations to the binary without the need to recompile everything. (#24)
  • Refabricate shall be adapted to also parse *.rei files. (#33)
  • performance improvements

Concepts

There is some vocabulary constantly used in naming and typing in this project. This nomenclation is explained in the following chapters in more detail.

Fabricator

A fabricator provides the ability to retrieve / generate data from some source. Some of them can be configured. (e.g. when having a fabricator which loads local files, the path can be configured) One fabricator generates one or many fabrics. Multiple Fabricators can be used along with each other.

Fabric

Fabric is the generic name for 'data in flight'. Using a fabricator to load some local markdown files will yield a markdown fabric for each file. Using a refabricator, these fabrics can be 'converted' to html fabrics.

Refabricator

A refabricator manipulates fabrics. It may 'transform' fabrics from one type to another. A simple refabricator used for very simple templating is between, which takes a fabric and puts it in between of two other fabrics.

Factory

Subject to change
In the very first concepts a factory was meant to act like a 'sink'. For example a factory would write each fabric to a local file and would return the result type. Currently it's not clear if special casing fabric => result really makes sense. This could also just be a refabricator.

Examples

md > between > log

Get all markdown files of a directory, put each content into a template and write everything out as log messages.

open Refabricator.Main;

let () =
  fromMd("pages")
  |> between((
       "<html><head><title>Site generated with Refabricator</title></head><body><main>\n",
       {|\n</main><footer>This site was generated by <a href="https://github.com/woeps/Refabricator">Refabricator</a>!</footer></body></html>|},
     ))
  |> toLog;

2x md > between > files

Get all markdown files of one directory and put each content into a template + get all markdown files of another directory (without template) and write everything out as log messages.

open Refabricator.Main;

let () =
  from([
      fromMd("pages")
      |> between((
           "<html><head><title>Site generated with Refabricator</title></head><body><main>\n",
           {|\n</main><footer>This site was generated by <a href="https://github.com/woeps/Refabricator">Refabricator</a>!</footer></body></html>|},
         )),
      fromMd("pages2"),
    ])
  |> toFiles({path: "generated", extension: "html"});
  // make sure your path/dir already exists

Usage

You need Esy, you can install the beta using npm:

% npm install -g esy@latest

NOTE: Make sure esy --version returns at least 0.5.4 for this project to build.

Then run the esy command from this project root to install and build dependencies.

% esy

Now you can run your editor within the environment (which also includes merlin):

% esy $EDITOR
% esy vim

Alternatively you can try vim-reasonml which loads esy project environments automatically.

After you make some changes to source code, you can re-run project's build again with the same simple esy command.

% esy

And test compiled executable (runs scripts.tests specified in package.json):

% esy test
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].