History

Neapolitan was originally written for Ruby. The orginal format was not a true YAML stream. It also supported a variety of templating engines on a section by section basis. This new version of Neapolitan fixes both of these *over designs*. Neapolitan documents are now fully compliant YAML streams, using LibYAML to ensure conformity. In addition, only a single template engine can be used on a per-stream basis. Presently that is engine is Mustache and only Mustache, because it is the most widely supported engine, the only one currently availalbe for Crystal and it a good fit with Neapolitan's design.

The original version of Neapolitan also had support for a huge variety of markup formats thanks to the Tilt and [Malt](http://rubyworks.github.io/malt/) libraries. Crystal, obviuously, does not yet have such a set of markup libraries at its diposal. So presently only `html` and `markdown` are supported. More will be added as libraries become available, but the plan is to keep the library tighter and smaller with a more descerning selection.

Overview

Neapolitan is a meta-markup format. It allows a designer to string together a variety of different markup formats in a single document (technically called a *stream*).

A simple example of a .np file:

  --- !metadata
  author: Abe Lincoln
  date: 2010-10-10

  --- !markdown

  Examples Of Liberty
  ===================

  * Sparticus
  * Emancipation Proclimation
  * Neapolitan

  --- !textile

  h1. Table of Freedom

  | political  | billd of rights |
  | templating | neapolitan |

The first section of this Neapolitan example is metadata, what is often called YAML front-matter which define a set of document properties. All sections start with three dashes ('---') flush to the left margin followed and by the section's type tag. In this example, we have a Markdown formatted section followed by a Textile section, presumably because Markdown lacks support for tables.

Please Note! Textile isn't currently supported by Neapolitan. This is just an example.

To learn more about rendering Neapolitan templates, have a look at the QED demo and API documentation.

Copyright & License

Neapolitan is Copyright © 2016 Thomas Sawyer

It is distributed under the terms of the BSD-2-Clause license.

THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.