From aa23984bc21f99e00b8552e928d23ef02bb745f3 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Fri, 13 Jan 2023 10:50:30 -0700 Subject: Initial gemtext package. Contains: - gemtext AST (Document and line types) - Parse from an io.Reader - ParseLine a []byte - doc comments on everything - ParseLine tests for every line type Still needs tests for Parse & Document. --- gemtext/types.go | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 gemtext/types.go (limited to 'gemtext/types.go') diff --git a/gemtext/types.go b/gemtext/types.go new file mode 100644 index 0000000..fb9352a --- /dev/null +++ b/gemtext/types.go @@ -0,0 +1,171 @@ +package gemtext + +// LineType represents the different types of lines in a gemtext document. +type LineType int + +const ( + // LineTypeText is the default case when nothing else matches. + // + // It indicates that the line object is a TextLine. + LineTypeText LineType = iota + 1 + + // LineTypeLink is a link line. + // + // =>[][