The Hyper Document Format
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Felix "xq" Queißner 2d7db68369 Update to zig-0.11.0 3 months ago
.github Implements basic parser. 8 months ago
examples Updates the examples, fixes HyperDoc renderer. 6 months ago
src Update to zig-0.11.0 3 months ago
.gitattributes Implements basic parser. 8 months ago
.gitignore Implements basic parser. 8 months ago
README.md Update to zig-0.11.0 3 months ago
build.zig Update to 0.11.0-dev.3132+465272921 6 months ago
build.zig.zon Update to zig-0.11.0 3 months ago

README.md

Ashet HyperDocument Format

This format is used for both the Hyper Wiki as well as the Gateway application to store and display hyperlinked documents.

The format is a rich-text format that can encode/store/display the following document blocks:

  • paragraphs (consisting of a sequence of spans)
    • regular text
    • links
    • bold/emphasised text
    • monospaced text
    • line break
  • 3 levels of headings
  • ordered and unordered lists
    • each list item is a paragraph or another list
  • quotes (paragraph with special styling)
  • preformatted text (code blocks, also uses the paragraph formatting)
  • images

Regular text is assumed to use a proportional font, while preformatted text is required to be rendered as monospace.

Storage

HyperDocument is stored as a trivial-to-parse plain text format, not necessarily meant to be edited by humans, but still human readable.

Example:

hdoc "1.0"
p {
  span "Hello, World!\n"
  link "http://google.com" "Visit Google!"
  span "\n"
  emph "This is fat!"
  span "\n"
  mono "int main()"
  span "\n"
}
enumerate {
  item { p { span "first" } }
  item { p { span "second" } }
  item { p { span "third" } }
}
itemize {
  item { p { span "first" } }
  item { p { span "second" } }
  item { p { span "third" } }
}
quote {
  span "Life is what happens when you're busy making other plans.\n - John Lennon"
}
pre {
  span "const std = @import(\"std\");\n"
  span "\n"
  span "pub fn main() !void {\n"
  span "    std.debug.print(\"Hello, World!\\n\", .{});\n"
  span "}\n"
}
image "dog.png"