oats/readme.md

78 lines
1.7 KiB
Markdown
Raw Normal View History

2024-11-20 20:33:22 +00:00
# OATS
**O**utput **A**gnostic **T**agging **S**ystem aka. OATS implemented in Lua.
## Format
### Overview
- Tree structure like XML
- No attributes, only children
- No namespaces
- Nesting by Indentation
Nodes are enclosed with square brackets
```
[document]
```
Nested elements are indented
```
[document]
[nested-tag]
nested text
```
2024-12-20 22:21:46 +00:00
Tags with only one text node can be shortened to one-line tags:
2024-11-20 20:33:22 +00:00
2024-12-20 22:21:46 +00:00
```
[tag-name] single text node
evaluates to the same as
[tag-name]
single text node
```
Text nodes mixed with one-line tags can further be shortened with inline tags:
```
Plain text with some
[bold] tagged
text
[emphasis] in between
evaluates to the same as
Plain text with some [bold tagged] text [emphasis in between]
```
2024-11-20 20:33:22 +00:00
**Note**: Consumers may have a better understanding of whether and how to join text
elements together, while the interpreter would have to decide on a joining
strategy (most likely concatenation with a space character in between).
2024-12-20 22:21:46 +00:00
### Data Type
OATS makes no attempts to interpret text.
Everything is considered a string and it is left up to the consuming application
to decide how to interpret the textual representation.
2024-11-20 20:33:22 +00:00
### Conventions
OATS is a very simple format without many restrictions.
Nevertheless, the following suggestions are provided to ensure some reasonable
degree of uniformity between applications:
OATS tag names preserve case, but applications consuming OATS structures should
generally ignore case.
Tag names should use lowercase kebab-case.
2024-12-20 22:21:46 +00:00
Applications that interpret parts of a tag name as a namespace should use a
single colon `:` as the namespace separator, with namespaces preceding the tag
name.
2024-11-20 20:33:22 +00:00
## Interface