diff --git a/README.md b/README.md index e69de29..f2a93b6 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docs/heckformat.md b/docs/heckformat.md new file mode 100644 index 0000000..ecb6b3d --- /dev/null +++ b/docs/heckformat.md @@ -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 ::= () +STRING ::= "([^\"]*|(\\)|(\"))" +VALUE ::= (||) +VALUES ::= (\s+)? +TAGNAME ::= +TAG ::= = +TAGS ::= (\s+)? +SECTIONLABEL ::= +SECTION ::= %%%\s+\s+ +ELEMENTLABEL ::= [A-Za-z_][A-Za-z0-9!@#$%^&*()_+/\\-]? +ELEMENT ::= \s+(|) +LINE ::= ^(((>)*) |
| ) (|$) +``` + + + +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. + diff --git a/docs/test.heck b/docs/test.heck new file mode 100644 index 0000000..ec04978 --- /dev/null +++ b/docs/test.heck @@ -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! + diff --git a/docs/test2.heck b/docs/test2.heck new file mode 100644 index 0000000..e8c2b3c --- /dev/null +++ b/docs/test2.heck @@ -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" diff --git a/haxe/HeckFormat.hx b/haxe/HeckFormat.hx new file mode 100644 index 0000000..e69de29 diff --git a/haxelib.json b/haxelib.json new file mode 100644 index 0000000..122be47 --- /dev/null +++ b/haxelib.json @@ -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": {}, +} diff --git a/python/__init__.py b/python/__init__.py new file mode 100644 index 0000000..e69de29