home ~ projects ~ socials

Neopolitan - Section And Attribute Tokens

One of the goals with the format is to make it extensible. The way I'm handling that is by making the section types arbitrary and putting the responsibility on the rendering engine to apply the proper template based off the names and attributes.

Section Name Rules --

The rules for defining a section type are:

  • Must be preceeded by the start of a file or and empty line
  • Must start with two dashes followed by zero or more extra dashes
  • The dashes must be followed by a single space
  • The space must be followed by a single word made up of any UTF-8 non-whitespace characters

    These are all valid section headers

-- alfa

---- bravo

-- c.h.a.r.l.i.e

-- ๐’นโ‚‘โ‚—โ‚œโ‚

-- /echo

Section Attribute Types

Section attributes come in two types:

  • boolean
  • key/value

Boolean Section Attributes

The rules for boolean attributes are the same as the section rules with the exception that instead of starting after the start of the file or an empty line, each one must start on a line immediatly following a line that starts a section or a line with another attribute.

Key/Value Section Attributes

Key value attributes work like boolean with the additional properties:

  • The key must end with a : character
  • The : must be followed by exactly one space character
  • The value is any text up until the end of the line

An example of a code section with a rust boolean attribute and id key/value pair.

-- code
-- rust
-- id: sample_code

Previous: Neopolitan Home Page ~ Next: Basic Content Types

-- end of line --