Checkin of basic work and docs and some test documents.
This commit is contained in:
@ -0,0 +1,5 @@
|
||||
# HECKformat
|
||||
|
||||
HECKformat is a simple human-writable file format for configuration files inspired by [https://sdlang.org](SDLang) and [https://www.whitespacesv.com/](WhitespaceSV).
|
||||
|
||||
It was desigend specifically for HeckWeasel as a way to store metadata and page content in a single file, but is useful for a variety of configuration and similar human-writable data tasks.
|
||||
|
41
docs/heckformat.md
Normal file
41
docs/heckformat.md
Normal file
@ -0,0 +1,41 @@
|
||||
# HECK metadata format
|
||||
|
||||
```
|
||||
%%% heck
|
||||
element value value
|
||||
element value value
|
||||
element tag=value
|
||||
> subelement value
|
||||
> subelement value
|
||||
>> sub-subelement value
|
||||
%%% something else
|
||||
arbitrary data
|
||||
|
||||
```
|
||||
|
||||
reBNF:
|
||||
```
|
||||
COMMENT ::= # .*$
|
||||
ATOM ::= [A-Za-z_][A-Za-z0-9_-]?
|
||||
BASE10NUMBER ::= (-)?[0-9]+(\.)?[0-9]+([FLUIDCfluidc])?
|
||||
BASE16NUMBER ::= 0x[0-9A-Fa-f]+
|
||||
NUMBER ::= (<BASE10NUMBER|BASE16NUMBER>)
|
||||
STRING ::= "([^\"]*|(\\)|(\"))"
|
||||
VALUE ::= (<ATOM>|<STRING>|<NUMBER>)
|
||||
VALUES ::= <VALUE>(\s+<VALUES>)?
|
||||
TAGNAME ::= <ATOM>
|
||||
TAG ::= <TAGNAME>=<VALUE>
|
||||
TAGS ::= <TAG>(\s+<TAGS>)?
|
||||
SECTIONLABEL ::= <ATOM>
|
||||
SECTION ::= %%%\s+<SECTIONLABEL>\s+<TAGS>
|
||||
ELEMENTLABEL ::= [A-Za-z_][A-Za-z0-9!@#$%^&*()_+/\\-]?
|
||||
ELEMENT ::= <ELEMENTLABEL>\s+(<VALUES>|<TAGS>)
|
||||
LINE ::= ^(((>)*<ELEMENT>) | <SECTION> | <COMMENT>) (<COMMENT>|$)
|
||||
```
|
||||
|
||||
|
||||
|
||||
Heck is composed of a series of elements each with a label and one or more values. Elements may also have several key-value pairs associated with them as tags. Elements may also have sub-elements which then take the place of the value indicated with a > before the value at the current level. The heck document also can have several sections. Sections all start with %%% and a label. If the label is heck, the section is interpreted as more elements for the heck document. Any other label is stored as an element of arbitrary string value under that label name.
|
||||
|
||||
The data structure represented is an ordered array. Elements may have the same name as previous elmenents in the same containment.
|
||||
|
13
docs/test.heck
Normal file
13
docs/test.heck
Normal file
@ -0,0 +1,13 @@
|
||||
%% heck
|
||||
title "My Page"
|
||||
subtitle "A great thing"
|
||||
tags test page
|
||||
thumbnail "images/thumb.jpg" scale=true
|
||||
|
||||
%% content
|
||||
# My Page
|
||||
|
||||
## {meta.subtitle}
|
||||
|
||||
This is some very good page content! Huzzah! I can refer to the metadata in the heck section too!
|
||||
|
10
docs/test2.heck
Normal file
10
docs/test2.heck
Normal file
@ -0,0 +1,10 @@
|
||||
%% heck
|
||||
|
||||
adventure title="Test Adventure"
|
||||
room id=room1 name="Room 1"
|
||||
> backdrop "room1.jpg"
|
||||
> object guitar type=gettable
|
||||
> object chair type=interactable
|
||||
room id=room2 name="Room 2"
|
||||
> backdrop "room2.jpg"
|
||||
> backdrop "room2_furnature.jpg"
|
0
haxe/HeckFormat.hx
Normal file
0
haxe/HeckFormat.hx
Normal file
12
haxelib.json
Normal file
12
haxelib.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "heckformat",
|
||||
"url": "https://heckin.technology/AlderconeStudio/heckformat",
|
||||
"license": "No Nazis + CCSA",
|
||||
"tags": ["utility", "data", "configuration"],
|
||||
"description": "A convenient human-writable configuration format.",
|
||||
"version": "0.0.1",
|
||||
"classPath": "haxe/",
|
||||
"releasenote": "Development Version",
|
||||
"contributors": ["Aldercone Studio Collective"],
|
||||
"dependencies": {},
|
||||
}
|
0
python/__init__.py
Normal file
0
python/__init__.py
Normal file
Reference in New Issue
Block a user