0.1.0 • Published 2 years ago

manzai v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

manzai

A markup language for narratives

Basic syntax

Narrative

To create a narrative, add a name in front of a sentence, split with a colon and a space :.

Socrates: All men are mortal

You can add a slash / in front of the name, representing that the narrator is subjective.

/Plato: Socrates is a man

You can add a back slash \ in front of the name, representing that the narrator is objective.

\Socrates: Therefore, Socrates is mortal

You can also add an attribute in front of the name by wrapping it in brackets [ ],

[12:34] Plato: Socrates was born.

Without a name, the sentence represents that it is directive.

Socrates died by drinking poison hemlock.

Media

You can represent a media by wrapping link text in brackets [ ],

[https://picsum.photos/200]

You can represent a media in a narrative.

Plato: [https://picsum.photos/200]

Header

You can add a YAML front matter block, which must be the first thing in the file and must take the form of valid YAML set between triple-dashed lines.

---
title: Syllogismus
description: An example featuring Socrates and Plato
---

Narrator

In a header, you can assign avatars and other properties in narrators collection with each name as a key.

---
narrators:
  - name: Socrates
    type: 2
    avatar: [https://picsum.photos/200]
---

Type number represents whether the narrator is subjective, objective or descriptive.

  • 0: descriptive.
  • 1: subjective
  • 2: objective

If you represent a type explicitly in a line with / or \, types assigned to narrators in a header are overwritten.

Parsed result

A parsed result is consisted of header and contents.

contents is a collection of content.

header

A header contains properties which is declared in a YAML front matter block.

contents

Each content in contents has properties as below:

propertytype
namestring
typenumber
avatarstring
messagestring
mediastring
attributestring

Licence

This project is licensed under the terms of the MIT license.

0.1.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago