Fork me on GitHub

Creo

creator in Latin

Creo is a website generation framework written in Perl.

What is Creo?

Creo is a tool (or Perl script) that is designed to take JSON files (or HTML files) containing data for website pages, and output a fully working static web site. It takes Markdown for styling too.

To create pages, it uses HTML "shells" with the layout of the website already done, with JS and CSS files packaged with it in a folder (they are all stored in the themes/ directory). When the script is run, they are all copied to a new folder called build/, and then every file is generated from replacing identifiers for content in the shell and saving the output.

Usage

You need to get Markdown from http://daringfireball.net/projects/markdown/ - the reason being I am a tad reluctant distributing it here as it is not my own work. Use version 1.0.1.

Creo is a command line application. The most common way to deploy it would be this command:

perl creo.pl -build default example/

Dissecting the command

Creating Pages

Before generation, all pages are JSON files with information. Here is an example page:

{
    "title":"Creo",
    "webtitle":"index",
    "type":"markdown",
    "contentfile":"index.md"
}

A Creo page requires four JSON objects: a on-screen title (title), a file name (webtitle), the type of document Creo is parsing the content as (type, do not change this as there is no other type currently), and the content itself (content). Modules can have other JSON tags too though, so make sure you read the documentation given for any modules you use.

Modules?

Creo is designed to be extended. The core program without comments is well under 100 lines, and we do want to keep it fairly slim. So, modules help by allowing us and others to extend the program with ease. Creo modules use the *.plx extension currently, as they are just Perl files. Creo evals them at runtime.

To install a module, simply following these instructions:

  1. Put the module files into a folder called modules/ in your installation of Creo.
  2. In the command line, type perl creo.pl -build default example/ -i , being the name of the module.

Keep in mind you can run pretty much as many modules you want at once. To, say, run two modules, one called creobib and the other called test, you would run this command:

perl creo.pl -build default example/ -i creobib,test

A note to people creating modules: file names must be one word.

Designing Shells

Shells are pretty easy to make. Just design how you want all your pages to look, and then simply add these HTML tags for where you want titles and content to go.

Please put closing tags.

Modules and Themes I've Made

When a packaged release comes along, this is what will come with it.

These are some modules and themes I've created for creo. If you have made a module or theme and you want it put it here, feel free to drop me a line:

Modules

Themes