Skip to content

skial/tuli

Repository files navigation

Tuli

Swahili for static

Installation

With haxelib git.

haxelib git tuli https://github.com/skial/tuli master src

With haxelib local.

# Download the archive.
https://github.com/skial/tuli/archive/master.zip

# Install archive contents.
haxelib local master.zip

Reservered Keywords

  • var, variables
  • env, environment
  • cmd, commands
  • mem, memory
  • pre, prerequisites
  • define
  • if

Keyword Scopes

  • global scope

    • if
  • toplevel scope

    • var, variables
    • env, environment
    • define
  • section scope

    • pre, prerequisites
  • job scope

    • var, variables
    • cmd, commands
    • mem, memory

The following code example explains the above scopes.

{
	"toplevel":{
		"local":{
			
		}
	},
	"toplevel":{
		"local":{
			"if":{
				
			}
		},
		"if":{
			
		}
	},
	"if":{
		
	}
}

Introduction

Tuli accepts a json file, looking for by default, a file named config.json. Anything not a reservered keyword in the toplevel or global scope will be treated as a Haxe regular expression.

A basic config.json file looks like the following.

{
	"([a-zA-Z0-9~/:]+).md$":{
		"cmd":[
			"$0 | marked | $1.html"
		]
	}
}

Rectification

Regular Expression Groups

{
	"([a-zA-Z0-9~/:]+).md$":{
		"cmd":[
			"$0 | marked | $1.html"
		]
	}
}

The example above provides a regular expression grouping everything up to .md of the path.

To access a group, use dollar $ followed by an integer representing an index, where the index starts at 1. To access the original matched path use $0.

Variables and Environment

{
	"var":{
		"path":"([a-zA-Z0-9~/:]+)"
	},
	"(${path}).md$":{
		"cmd":[
			"$0 | marked | $1.html"
		]
	},
	"(${path}).js$":{
		"cmd":[
			"$0 | uglifyjs - --compress --mangle | $1.min.js
		]
	}
}

To access a variable or environment value, use ${ followed by the variables or environments name followed by a closing bracket }. Variable names are always assessed before environment names.

About

Barebones Static Site Generator [Experimental]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages