fix gmi->md templates and regenerate the README
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
9579f021ff
commit
30e21f8513
11
README.md
11
README.md
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
# Gus: The small web server toolkit
|
# Gus: The small web server toolkit
|
||||||
|
|
||||||
Gus is the toolkit for working with the small web in Go.
|
Gus is the toolkit for working with the small web in Go.
|
||||||
|
@ -9,6 +10,7 @@ Think of it as a net/http for small web protocols. You still have to write your
|
||||||
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 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 package contains:
|
||||||
|
|
||||||
* a request type
|
* a request type
|
||||||
* a response type
|
* a response type
|
||||||
* a "Handler" abstraction
|
* a "Handler" abstraction
|
||||||
|
@ -26,6 +28,7 @@ The gemtext package today provides a parser for gemtext documents. In the future
|
||||||
This is where useful building blocks themselves start to come in. Sub-packages of contrib include Handler and Middleware implementations which accomplish the things your servers actually need to do.
|
This is where useful building blocks themselves start to come in. Sub-packages of contrib include Handler and Middleware implementations which accomplish the things your servers actually need to do.
|
||||||
|
|
||||||
So far there are at least 3 packages:
|
So far there are at least 3 packages:
|
||||||
|
|
||||||
* log contains a simple request-logging middleware
|
* log contains a simple request-logging middleware
|
||||||
* fs has handlers that make file servers possible: serve files, build directory listings, etc
|
* fs has handlers that make file servers possible: serve files, build directory listings, etc
|
||||||
* cgi includes handlers which can execute CGI programs
|
* cgi includes handlers which can execute CGI programs
|
||||||
|
@ -36,6 +39,7 @@ So far there are at least 3 packages:
|
||||||
### Using gus in your project
|
### Using gus in your project
|
||||||
|
|
||||||
To add it to your own go project:
|
To add it to your own go project:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ go get tildegit.org/tjp/gus
|
$ go get tildegit.org/tjp/gus
|
||||||
```
|
```
|
||||||
|
@ -43,6 +47,7 @@ $ go get tildegit.org/tjp/gus
|
||||||
### Straight to the code please
|
### Straight to the code please
|
||||||
|
|
||||||
=> [The code is hosted here on tildegit.](https://tildegit.org/tjp/gus)
|
=> [The code is hosted here on tildegit.](https://tildegit.org/tjp/gus)
|
||||||
|
|
||||||
=> [The generated documentation is on the go package index.](https://pkg.go.dev/tildegit.org/tjp/gus)
|
=> [The generated documentation is on the go package index.](https://pkg.go.dev/tildegit.org/tjp/gus)
|
||||||
|
|
||||||
## Contribute
|
## Contribute
|
||||||
|
@ -50,13 +55,15 @@ $ go get tildegit.org/tjp/gus
|
||||||
There's lots still to do, and contributions are very welcome!
|
There's lots still to do, and contributions are very welcome!
|
||||||
|
|
||||||
=> [submit an issue or pull request on the tildegit repository,](https://tildegit.org/tjp/gus)
|
=> [submit an issue or pull request on the tildegit repository,](https://tildegit.org/tjp/gus)
|
||||||
=> [send me an email directly,](mailto:tjp@ctrl-c.club)
|
|
||||||
or poke me on IRC: I'm @tjp on irc.tilde.chat, and you'll find me in #gemini
|
|
||||||
|
|
||||||
|
=> [send me an email directly,](mailto:tjp@ctrl-c.club)
|
||||||
|
|
||||||
|
or poke me on IRC: I'm @tjp on irc.tilde.chat, and you'll find me in #gemini
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
> Step 2: draw the rest of the owl
|
> Step 2: draw the rest of the owl
|
||||||
|
|
||||||
```
|
```
|
||||||
;;;;;:::::::::::::::::::::::;;;;;;;,,,,,,,''''''''''',,,,,,,,,,,;;;;;;;;;;,,,,,,,,,,,,,,,,,,;;;;:::::::::::::;;
|
;;;;;:::::::::::::::::::::::;;;;;;;,,,,,,,''''''''''',,,,,,,,,,,;;;;;;;;;;,,,,,,,,,,,,,,,,,,;;;;:::::::::::::;;
|
||||||
;;;;;;:::::::::::::::;;;;;;;;;;;,,,,,,,,'''''''''''''',,,,,,,,;;;;;;;;;;;;;;;;;;;,,,,,,,,,,,,,;;;;::::::::::::;
|
;;;;;;:::::::::::::::;;;;;;;;;;;,,,,,,,,'''''''''''''',,,,,,,,;;;;;;;;;;;;;;;;;;;,,,,,,,,,,,,,;;;;::::::::::::;
|
||||||
|
|
|
@ -53,20 +53,26 @@ func Convert(wr io.Writer, doc gemtext.Document, overrides *template.Template) e
|
||||||
|
|
||||||
var baseTmpl = template.Must(template.New("mdconv").Parse(`
|
var baseTmpl = template.Must(template.New("mdconv").Parse(`
|
||||||
{{ define "header" }}{{ end }}
|
{{ define "header" }}{{ end }}
|
||||||
{{ define "textline" }}{{ . }}{{ end }}
|
{{ define "textline" }}{{ if ne .String "\n" }}
|
||||||
{{ define "linkline" -}}
|
{{ . }}{{ end }}{{ end }}
|
||||||
=> [{{ if eq .Label "" }}{{ .URL }}{{ else }}{{ .Label }}{{ end }}]({{ .URL }})
|
{{ define "linkline" }}
|
||||||
|
=> [{{ if eq .Label "" }}{{ .URL }}{{ else }}{{ .Label }}{{ end }}]({{ .URL }})
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ define "preformattedtextlines" }}` + "```\n" + `{{ range . }}{{ . }}{{ end }}` + "```\n" + `{{ end }}
|
{{ define "preformattedtextlines" }}` + "\n```\n" + `{{ range . }}{{ . }}{{ end }}` + "```\n" + `{{ end }}
|
||||||
{{ define "heading1line" }}# {{ .Body }}
|
{{ define "heading1line" }}
|
||||||
|
# {{ .Body }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ define "heading2line" }}## {{ .Body }}
|
{{ define "heading2line" }}
|
||||||
|
## {{ .Body }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ define "heading3line" }}### {{ .Body }}
|
{{ define "heading3line" }}
|
||||||
|
### {{ .Body }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ define "listitemlines" }}{{ range . }}* {{ .Body }}
|
{{ define "listitemlines" }}
|
||||||
|
{{ range . }}* {{ .Body }}
|
||||||
{{ end }}{{ end }}
|
{{ end }}{{ end }}
|
||||||
{{ define "quoteline" }}> {{ .Body }}
|
{{ define "quoteline" }}
|
||||||
|
> {{ .Body }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ define "footer" }}{{ end }}
|
{{ define "footer" }}{{ end }}
|
||||||
`))
|
`))
|
||||||
|
|
|
@ -44,12 +44,14 @@ This is some non-blank regular text.
|
||||||
* list
|
* list
|
||||||
|
|
||||||
=> [as if](gemini://google.com/)
|
=> [as if](gemini://google.com/)
|
||||||
|
|
||||||
=> [https://google.com/](https://google.com/)
|
=> [https://google.com/](https://google.com/)
|
||||||
|
|
||||||
> this is a quote
|
> this is a quote
|
||||||
|
|
||||||
> -tjp
|
> -tjp
|
||||||
|
|
||||||
`[1:] + "```\ndoc := gemtext.Parse(req.Body)\n```\n"
|
` + "```\ndoc := gemtext.Parse(req.Body)\n```\n"
|
||||||
|
|
||||||
doc, err := gemtext.Parse(bytes.NewBufferString(gmiDoc))
|
doc, err := gemtext.Parse(bytes.NewBufferString(gmiDoc))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
Reference in New Issue