continue working ish

This commit is contained in:
Schrottkatze 2023-05-04 10:02:34 +02:00
parent c3642676b2
commit b22570c2e2
6 changed files with 175 additions and 0 deletions

12
data/demo-result.html Normal file
View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1 class="class">some content</h1>
<p>this is some text and contains <a href="https://example.com"></a> a link</p>
</body>
</html>

36
data/demo.ihl Normal file
View file

@ -0,0 +1,36 @@
// defined base element
document [
title: "example",
lang: "de",
] {
h1.class "some content";
p {
"this is some text and contains ";
a [ href: "https://example.com" ] "a link";
".";
}
}
// attributes are by default parsed as:
// key: value
// and are comma seperated.
//
// items can define custom parsers for attributes
// content is by default parsed as semicolon seperated further item structures
// plain text is just plain text
// definitions have a : after the name
// definitions only allow default parsing
// @slot is the attribute that defines the element body, but can be overwritten
navItem: [
dest: string,
] {
li.nav-item {
// use attributes using @
// interpolate in @{} blocks
a[ href: "https://example.com@{dest}" ] @dest;
}
}