<commit_before># gullap

gullap is a [Mono](http://www.mono-project.com "Mono") based static website generator.

## Features

* Based on [Mono](http://www.mono-project.org "Mono") it works on Windows and Linux
* Supports Markdown markup
* Supports Mustache templating engine
* Main menu is fully built based on the source files
  * Source file with Markdown markup are rendered as local HTML files
	* Source files can define external Links (no markup)
* Support for sidebar menus
* Include HTML to your markup files
* Site structure generation

### Extensibility

There are two interfaces `IParser` (per default one for Markdown is implemented) and `ITemplater` (per default one for Nustache is implemented). They can be used to replace the defaults by other markup and templating engines.

## How To

First you have to compile the solution. For that, can either use [MonoDevelop](http://monodevelop.com/ "MonoDevelop") or Microsoft Visual Studio.

There are the following options to call gullap:

	GullapConsole -i my/Path/To/My/Site
	GullapConsole -g my/Path/To/My/Site

The argument `-i` generates the necessary structure within `my/Path/To/My/Site`. Therefore the target path has to exist. It is not created by gullap. The file structure looks like the following

	Site
	|- assets
	|- output
	|- pages
	|- templates

Copy all your necessary assets (CSS, JavaScript, Images) into `assets`. They will be copied to the `output` directory as they are. So, if you have sub directories they will be available also within the output directory. The `pages` directory contains your markup. Per default they should contain all your Markdown files (the extension of your files is unimportant, as all files are taken for the transformation). Put all your Nustache templates to the `templates` directory. 

After you filled up the structure with all necessary files, call `GullapConsole` with argument `-g` and the path to your site directory. Everything will be generated to the `output` directory.

## Default Markdown Meta Tags

Each Markdown file has to contain one or more meta tags. They are important for the transformation. Here's a list of supported meta tags:

	Title 			Title of the page
	Description		Description of the page
	Author			Author of the page
	Menu 			Definition of a new Menu this page belongs to
	MenuTitle 		Definition of a new menu
	MenuCategory	Category within your menu
	Sidebar 		Define a sidebar this page belongs to
	SidebarTitle 	If set this one is taken for sidebar generation, otherwise `MenuTitle`
	Template 		A specific template to use
	Link 			A link to a resource
	Date			Creation/update date of the page
	Directory		Output directory (relativ) for the page 
	Keywords 		Keywords for your page

Not all meta tags have to be used. `Title`, `Description` and `Author` are only important if the page results in a real HTML transformation (this is not the case if `Link` is in use). The `Sidebar*` tags are only useful if you have a sidebar defined in your templates and access the exported variables.

There is one template that MUST exist: `page.template`. This is the default template. Use `Template` to override that.

> All of them have to be in a separate line, directly followed by `:` and the value.

## Variables available for templating

	content			The parsed content from your pages
	menu 			The complete menu tree
	title 			Title of the page
	description 	Description of the page
	author 			Author of the page
	sidebarheader	Header of the sidebar (defined by `Sidebar` meta tag)
	sidebaritems 	Items for your sidebar
	date			Date of the page
	keywords 		Keywords of the page

Most of them are single values, except `menu` and `sidebaritems`.

Here's an example for `menu`:

	<ul class="nav">
	  {{#menu.Items}}
	    {{#HasSubMenu}}
	      <li class="dropdown">
	        <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{Name}} <b class="caret"></b></a>
	        <ul class="dropdown-menu">
	          {{#HasCategories}}
	            {{#Categories}}
	              <li class="nav-header">{{Name}}</li>
	              {{#SubItems}}
	                <li><a href="{{Link}}">{{Name}}</a></li>
	              {{/SubItems}}
	              <li class="divider"></li>
	            {{/Categories}}
	          {{/HasCategories}}
	          {{#SubItems}}
	            <li><a href="{{Link}}">{{Name}}</a></li>
	          {{/SubItems}}
	        </ul>
	      </li>
	    {{/HasSubMenu}}
	    {{^HasSubMenu}}
	      <li><a href="{{Link}}" title="{{Name}}">{{Name}}</a></li>
	    {{/HasSubMenu}}
	  {{/menu.Items}}
	</ul>

Here's an example for `sidebaritems`:

	<ul class="nav nav-list">
		<li class="nav-header">{{sidebarheader}}</li>
		{{#sidebaritems}}
			<li><a href="{{Link}}">{{SidebarTitle}}</a></li>
		{{/sidebaritems}}
	</ul>

## Examples

**Generate a menu entry for the root menu without a link**

	MenuTitle: Projects
	-----

**Generate a menu entry providing a link for the root menu**

	MenuTitle: News
	Link: http://news.devtyr.com
	-----

**Generating a sub menu for an existing root menu**

	Title: FastSearch - DevTyr
	Description: Ajax Search for BlogEngine.NET 
	Author: DevTyr / <NAME>
	Menu: Projects
	MenuTitle: FastSearch
	MenuCategory: BlogEngine.NET
	Sidebar: FastSearch
	SidebarTitle: Features
	Template: page_sidebar
	-----

This creates a sub menu called `FastSearch` right under root menu `Projects`. 

You can have a look at [DevTyr](http://devtyr.com). This is one of my sites and fully generated by gullap.

## Future

There are a lot of ideas to improve gallup. One of the next step is to provide a complete public sample integrating [Bootstrap from Twitter](http://getbootstrap.com "Bootstrap from Twitter") as a real world example.<commit_msg>Updated to meet current implementation<commit_after># gullap

gullap is a Microsoft .NET/[Mono](http://www.mono-project.com "Mono") based static website generator.

## Features

* Based on [Mono](http://www.mono-project.org "Mono") it works on Windows and Linux
* Supports Markdown markup
* Supports Mustache templating engine
* Supports [YAML](http://yaml.org/ "YAML") Front Matter
* Include HTML to your markup files
* Site structure generation

### Extensibility

There are two interfaces `IParser` (per default one for Markdown is implemented) and `ITemplater` (per default one for Nustache is implemented). They can be used to replace the defaults by other markup and templating engines.

## How To

[Download](http://devtyr.com/projects/gullap/gullap-download.html "Gullap Download") the binaries or compile the solution. For that, can either use [MonoDevelop](http://monodevelop.com/ "MonoDevelop") or Microsoft Visual Studio.

There are the following options to call gullap:

	GullapConsole -i my/Path/To/My/Site
	GullapConsole -g my/Path/To/My/Site
	GullapConsole -g

The argument `-i` generates the necessary structure within `my/Path/To/My/Site`. Therefore the target path has to exist. It is not created by gullap. The file structure looks like the following

	Site
	|- assets
	|- output
	|- pages
	|- templates

Copy all your necessary assets (CSS, JavaScript, Images) into `assets`. They will be copied to the `output` directory as they are. So, if you have sub directories they will be available also within the output directory. The `pages` directory contains your markup. Per default they should contain all your Markdown files (the extension of your files is unimportant, as all files are taken for the transformation). Put all your Nustache templates to the `templates` directory. 

After you filled up the structure with all necessary files, call `GullapConsole` with argument `-g` and the path to your site directory. Everything will be generated to the `output` directory. In case you use `-g` without giving a site path, the current directory will be used as the site path.

## YAML Front Matter

Since version 1.1 Gullap uses a *YAML Front Matter* (as for example [Jekyll](http://jekyllrb.com/ "Jekyll") does. Each file that has a valid front matter will be processed. The following front matter attributes are currently available:

	title 			Title of the page
	description		Description of the page
	author			Author of the page
	category 		The category of the page
	template 		A specific template to use
	date			Creation/update date of the page
	tags 			Keywords for your page
	draft			Defines whether this page is in draft mode or not

There is one template that MUST exist: `page.template`. This is the default template. Use `template` to override that.

Here is an example of a valid front matter:

	---
	title: DEVTYR
	description: The Home of DevTyr
	author: DevTyr / <NAME>
	tags: 
	    - DevTyr
	    - Tools
	    - Projects
	    - <NAME>
	template: page
	---

Everything after the front matter is processed as page content.

## Variables available for templating

Within your templates there are information on site level as well for the current page available. 

### site

The site section contains the following possibilities:

* config
* time
* pages
* categories

`config` contains the site's configuration that can be defined in the file `config.yaml`. This is an optional configuration. Currently only the site title can be set (attribute name `title`). `time` represents the date/time of the generation. `pages` contains all pages (the available attributes are the same as defined by the YAML front matter). `categories` is a dictionary containing the pages mapped to their category.

### current

This is the page that is currently rendered. It contains all attributes that are specified in the YAML front matter. In addition you have access to `url` and `categorypages`. `categorypages` is a list of all pages placed within the same category as the current one.

> Please note: It is currently not possible to define custom attributes. It won't break anything if you do it, but you can't access them within your template at the moment.

As an example see the template that is used to build the detail page including a sidebar of [devtyr.com](http://devtyr.com "DevTyr"):

	<div class="container">

	  <div class="row-fluid">
	      <div class="span2">
	      	  <ul class="nav nav-list">
	      	  	<li><span class="label label-primary">{{current.category}}</span></li>
	      	  </ul>
			  <ul class="nav nav-list">
			  	{{#current.categorypages}}
			  		<li><a href="{{url}}">{{title}}</a></li>
			  	{{/current.categorypages}}
			  </ul>
		  </div>

		  <div class="span8">
		  	{{{current.content}}}
		  </div>

	  </div>

	  <hr>

	</div>

> The complete templates and input files for [devtyr.com](http://www.devtyr.com "DevTyr") can be viewed [here](https://github.com/devtyr/devtyrcom "GitHub DevTyr Website Repository"). This should help you to get an overview of how Gullap works.

## Future

There are to great features I will work on:

* Support of custom attributes. Define your own custom attributes within the YAML front matter and be able to use it within your templates.
* Support of posts to be able to build a blog system

{'fraction_non_alphanumeric': 0.088998088998089, 'fraction_numerical': 0.000364000364000364, 'mean_word_length': 3.6686491079014445, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 64, 'https://': 1, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2158535', 'n_tokens_mistral': 3197, 'n_tokens_neox': 2998, 'n_words': 1447}