ema

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 0 Imported by: 0

README

EMA — Enhanced Markup for Authors

Go Reference Go Report Card

  • utility and library written in pure Go
  • .ema file format

File Format

EMA file is a text-based format in UTF-8 encoding with .ema extension.

Each file starts with header, which is four bytes: {EMA (values 123, 69, 77, 65)

File content can be separated to arbitrary numbers of parts, with each part being one of the following:

Text part

All bytes are interpreted as plain text. The only special character is { (U+007B), which has the following meaning:

  • If there is another { character immediately after {, text part continues and both characters are interpreted as one occurrence of { character.
  • Otherwise, text part ends and content continues as data part. Character { is included to data part.
Data part

All bytes are interpreted as JSON object (see json.org). After end } character of object content continues as text part.

There is also special data part form called command where starting { is followed by letter A-Z or a-z (first command name letter). Spaces between { and command name are allowed and have no meaning. Command name match regular expression:

^[A-Za-z][-0-9A-Za-z]*$

After command name, there can be optional spaces followed by:

  • end } character of command
  • JSON array followed by optional spaces and end } character of command
  • JSON object followed by optional spaces and end } character of command

Spaces are all characters in Unicode category Space Separator.

Following commands and JSON object are equivalent:

{}                = {}
{bold}            = {"use": ["bold"]}
{ bold }          = {"use": ["bold"]}
{bold[1]}         = {"use": ["bold", 1]}
{ bold [1] }      = {"use": ["bold", 1]}
{bold[1, 2]}         = {"use": ["bold", 1, 2]}
{ bold [1, 2] }      = {"use": ["bold", 1, 2]}
{bold{"w": 1}}    = {"use": ["bold", {"w": 1}]}
{ bold {"w": 1} } = {"use": ["bold", {"w": 1}]}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() string

Types

This section is empty.

Directories

Path Synopsis
cmd
ema

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL