Skip to content

Abbakarm/yocaml-codex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOCaml Codex

YOCaml is a framework for building static site generators. By reading the tutorial, one quickly realizes that it is very flexible, allowing users a great deal of freedom to do whatever they want. YOCaml Codex is a standard library that provides prebuilt (recurring) models to simplify site creation.

By repeatedly building sites using YOCaml, we (the maintainers) realized that certain parts of the data model were being copied from project to project (such as Url, Repository, etc.). Rather than providing these directly in YOCaml (as an extended version of Archetype), we decided to keep the core dependencies as small as possible and to create a dedicated library that would provide all these reusable tools.

Philosophy

The main philosophy of the library is to be flexible, rich in data but lax about how data is validated from sources (to allow for compact representations).

Library organisation

The library is called yocaml-codex, and all of its internal libraries are prefixed with Codex_. It exposes several sub-libraries :

  • yocaml-codex.atoms, Codex_atoms, which describes the set of primitive types one might want to use (such as url)

  • yocaml-codex.ontology, Codex_ontology, which describes complete data models (such as repository)

Local development environment

To work, we assume that a version greater than or equal to 2.2.0~beta1 of OPAM is installed on your machine (Install OPAM, upgrade to version 2.2.0~xxxx).

Tip

We're relying on version 2.2.x to support the dev-setup flag, which allows development dependencies to be packaged, making it very practical to install locally all the elements needed to create a pleasant development environment.

When you have a suitable version of OPAM, you can run the following command to build a local switch to create a sandboxed environment (with a good version of OCaml, and all the dependencies installed locally).

opam update
opam switch create . --deps-only --with-dev-setup --with-test --with-doc -y
eval $(opam env)

About

A set of data models that can be used with YOCaml to build rich pages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • OCaml 99.6%
  • Dune 0.4%