diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-01-17 16:41:04 -0700 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-01-17 16:41:04 -0700 |
commit | 6586db782ea6dcb5f2eb191a690ec7e7df51161f (patch) | |
tree | 36158a53a6d8aad9f5a873c6c43d598ce5647b97 | |
parent | 2ef530daa47b301a40c1ee93cd43b8f36fc68c0b (diff) |
Updates
* update README
* move "gemtext" to within "gemini"
-rw-r--r-- | README.gmi | 23 | ||||
-rw-r--r-- | README.md | 25 | ||||
-rw-r--r-- | examples/gmi2html/main.go | 4 | ||||
-rw-r--r-- | examples/gmi2md/main.go | 4 | ||||
-rw-r--r-- | gemini/gemtext/fuzz_test.go (renamed from gemtext/fuzz_test.go) | 2 | ||||
-rw-r--r-- | gemini/gemtext/htmlconv/convert.go (renamed from gemtext/htmlconv/convert.go) | 4 | ||||
-rw-r--r-- | gemini/gemtext/htmlconv/convert_test.go (renamed from gemtext/htmlconv/convert_test.go) | 4 | ||||
-rw-r--r-- | gemini/gemtext/internal/templates.go (renamed from gemtext/internal/templates.go) | 2 | ||||
-rw-r--r-- | gemini/gemtext/mdconv/convert.go (renamed from gemtext/mdconv/convert.go) | 4 | ||||
-rw-r--r-- | gemini/gemtext/mdconv/convert_test.go (renamed from gemtext/mdconv/convert_test.go) | 4 | ||||
-rw-r--r-- | gemini/gemtext/parse.go (renamed from gemtext/parse.go) | 0 | ||||
-rw-r--r-- | gemini/gemtext/parse_line.go (renamed from gemtext/parse_line.go) | 0 | ||||
-rw-r--r-- | gemini/gemtext/parse_line_test.go (renamed from gemtext/parse_line_test.go) | 2 | ||||
-rw-r--r-- | gemini/gemtext/parse_test.go (renamed from gemtext/parse_test.go) | 2 | ||||
-rw-r--r-- | gemini/gemtext/types.go (renamed from gemtext/types.go) | 0 |
15 files changed, 49 insertions, 31 deletions
@@ -4,22 +4,31 @@ Gus is the toolkit for working with the small web in Go. Think of it as a net/http for small web protocols. You still have to write your server, but you can focus on the logic you want to implement knowing the protocol is already dealt with. It's been said of gemini that you can write your server in a day. Now you can write it in under an hour. -## gus/gemini +## The "gus" package -Gus is determined to be structured as composable building blocks, and the gemini package mainly just defines the structure that holds the blocks together. +Gus is carefully structured as composable building blocks. The top-level package defines the framework in which servers and clients can be built. -The package contains: * a request type * a response type +* a "Server" interface type * a "Handler" abstraction * a "Middleware" abstraction * some useful Handler wrappers: filtering, falling through a list of handlers -* helpers for building a gemini-suitable TLS config -* a Server that can run your handler(s) -## gus/gemtext +## gus/gemini + +Gus is determined to be structured as composable building blocks, and the gemini package mainly just defines the structure that holds the blocks together. + +The gemini package provides some gemini-specific concrete implementations. +* I/O (parsing, formatting) request and responses for the gemini protocol +* constructors for the various kinds of gemini protocol responses +* a helper for building a gemini-suitable TLS config +* a Client implementation +* a Server which can run your Handlers. + +## gus/gemini/gemtext -The gemtext package today provides a parser for gemtext documents. In the future, there will be conversions for the in-memory parsed representation into markdown, html, and whatever else people come up with. +The gemtext package provides a parser and converters for gemtext documents. It exposes an AST representation for parsed gemtext, and functions to write that AST out as other formats (currently markdown and HTML are supported, but more are planned). ## gus/contrib/* @@ -5,23 +5,32 @@ Gus is the toolkit for working with the small web in Go. Think of it as a net/http for small web protocols. You still have to write your server, but you can focus on the logic you want to implement knowing the protocol is already dealt with. It's been said of gemini that you can write your server in a day. Now you can write it in under an hour. -## gus/gemini - -Gus is determined to be structured as composable building blocks, and the gemini package mainly just defines the structure that holds the blocks together. +## The "gus" package -The package contains: +Gus is carefully structured as composable building blocks. The top-level package defines the framework in which servers and clients can be built. * a request type * a response type +* a "Server" interface type * a "Handler" abstraction * a "Middleware" abstraction * some useful Handler wrappers: filtering, falling through a list of handlers -* helpers for building a gemini-suitable TLS config -* a Server that can run your handler(s) -## gus/gemtext +## gus/gemini + +Gus is determined to be structured as composable building blocks, and the gemini package mainly just defines the structure that holds the blocks together. + +The gemini package provides some gemini-specific concrete implementations. + +* I/O (parsing, formatting) request and responses for the gemini protocol +* constructors for the various kinds of gemini protocol responses +* a helper for building a gemini-suitable TLS config +* a Client implementation +* a Server which can run your Handlers. + +## gus/gemini/gemtext -The gemtext package today provides a parser for gemtext documents. In the future, there will be conversions for the in-memory parsed representation into markdown, html, and whatever else people come up with. +The gemtext package provides a parser and converters for gemtext documents. It exposes an AST representation for parsed gemtext, and functions to write that AST out as other formats (currently markdown and HTML are supported, but more are planned). ## gus/contrib/* diff --git a/examples/gmi2html/main.go b/examples/gmi2html/main.go index f6131f3..40c0b8c 100644 --- a/examples/gmi2html/main.go +++ b/examples/gmi2html/main.go @@ -4,8 +4,8 @@ import ( "log" "os" - "tildegit.org/tjp/gus/gemtext" - "tildegit.org/tjp/gus/gemtext/htmlconv" + "tildegit.org/tjp/gus/gemini/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext/htmlconv" ) func main() { diff --git a/examples/gmi2md/main.go b/examples/gmi2md/main.go index 386983a..df604ba 100644 --- a/examples/gmi2md/main.go +++ b/examples/gmi2md/main.go @@ -4,8 +4,8 @@ import ( "log" "os" - "tildegit.org/tjp/gus/gemtext" - "tildegit.org/tjp/gus/gemtext/mdconv" + "tildegit.org/tjp/gus/gemini/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext/mdconv" ) func main() { diff --git a/gemtext/fuzz_test.go b/gemini/gemtext/fuzz_test.go index dce0587..f5435c1 100644 --- a/gemtext/fuzz_test.go +++ b/gemini/gemtext/fuzz_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "tildegit.org/tjp/gus/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext" ) func FuzzParse(f *testing.F) { diff --git a/gemtext/htmlconv/convert.go b/gemini/gemtext/htmlconv/convert.go index c703211..5028766 100644 --- a/gemtext/htmlconv/convert.go +++ b/gemini/gemtext/htmlconv/convert.go @@ -4,8 +4,8 @@ import ( "html/template" "io" - "tildegit.org/tjp/gus/gemtext" - "tildegit.org/tjp/gus/gemtext/internal" + "tildegit.org/tjp/gus/gemini/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext/internal" ) // Convert writes markdown to a writer from the provided gemtext document. diff --git a/gemtext/htmlconv/convert_test.go b/gemini/gemtext/htmlconv/convert_test.go index 967cece..641ffb8 100644 --- a/gemtext/htmlconv/convert_test.go +++ b/gemini/gemtext/htmlconv/convert_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "tildegit.org/tjp/gus/gemtext" - "tildegit.org/tjp/gus/gemtext/htmlconv" + "tildegit.org/tjp/gus/gemini/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext/htmlconv" ) var gmiDoc = ` diff --git a/gemtext/internal/templates.go b/gemini/gemtext/internal/templates.go index dea528a..08bc66c 100644 --- a/gemtext/internal/templates.go +++ b/gemini/gemtext/internal/templates.go @@ -5,7 +5,7 @@ import ( "net/url" "text/template" - "tildegit.org/tjp/gus/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext" ) var Renderers = map[gemtext.LineType]string{ diff --git a/gemtext/mdconv/convert.go b/gemini/gemtext/mdconv/convert.go index 57e106f..c2f434d 100644 --- a/gemtext/mdconv/convert.go +++ b/gemini/gemtext/mdconv/convert.go @@ -4,8 +4,8 @@ import ( "io" "text/template" - "tildegit.org/tjp/gus/gemtext" - "tildegit.org/tjp/gus/gemtext/internal" + "tildegit.org/tjp/gus/gemini/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext/internal" ) // Convert writes markdown to a writer from the provided gemtext document. diff --git a/gemtext/mdconv/convert_test.go b/gemini/gemtext/mdconv/convert_test.go index ad4cda4..c8fd53c 100644 --- a/gemtext/mdconv/convert_test.go +++ b/gemini/gemtext/mdconv/convert_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "tildegit.org/tjp/gus/gemtext" - "tildegit.org/tjp/gus/gemtext/mdconv" + "tildegit.org/tjp/gus/gemini/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext/mdconv" ) var gmiDoc = ` diff --git a/gemtext/parse.go b/gemini/gemtext/parse.go index 7041fde..7041fde 100644 --- a/gemtext/parse.go +++ b/gemini/gemtext/parse.go diff --git a/gemtext/parse_line.go b/gemini/gemtext/parse_line.go index 39187a8..39187a8 100644 --- a/gemtext/parse_line.go +++ b/gemini/gemtext/parse_line.go diff --git a/gemtext/parse_line_test.go b/gemini/gemtext/parse_line_test.go index 0953103..a07fa3b 100644 --- a/gemtext/parse_line_test.go +++ b/gemini/gemtext/parse_line_test.go @@ -3,7 +3,7 @@ package gemtext_test import ( "testing" - "tildegit.org/tjp/gus/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext" ) func TestParseLinkLine(t *testing.T) { diff --git a/gemtext/parse_test.go b/gemini/gemtext/parse_test.go index bda5310..d2860ff 100644 --- a/gemtext/parse_test.go +++ b/gemini/gemtext/parse_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "tildegit.org/tjp/gus/gemtext" + "tildegit.org/tjp/gus/gemini/gemtext" ) func TestParse(t *testing.T) { diff --git a/gemtext/types.go b/gemini/gemtext/types.go index 440fed4..440fed4 100644 --- a/gemtext/types.go +++ b/gemini/gemtext/types.go |