Updates
continuous-integration/drone/push Build is passing Details

* update README
* move "gemtext" to within "gemini"
This commit is contained in:
tjpcc 2023-01-17 16:41:04 -07:00
parent 2ef530daa4
commit 6586db782e
15 changed files with 54 additions and 36 deletions

View File

@ -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.
## The "gus" package
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
## 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 package contains:
* a request type
* a response 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)
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/gemtext
## 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/*

View File

@ -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.
## The "gus" package
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
## 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 package contains:
The gemini package provides some gemini-specific concrete implementations.
* a request type
* a response 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)
* 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/gemtext
## 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/*

View File

@ -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() {

View File

@ -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() {

View File

@ -4,7 +4,7 @@ import (
"bytes"
"testing"
"tildegit.org/tjp/gus/gemtext"
"tildegit.org/tjp/gus/gemini/gemtext"
)
func FuzzParse(f *testing.F) {

View File

@ -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.

View File

@ -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 = `

View File

@ -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{

View File

@ -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.

View File

@ -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 = `

View File

@ -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) {

View File

@ -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) {