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 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.
|
||||
|
||||
The package contains:
|
||||
|
||||
* a request type
|
||||
* a response type
|
||||
* 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.
|
||||
|
||||
So far there are at least 3 packages:
|
||||
|
||||
* log contains a simple request-logging middleware
|
||||
* fs has handlers that make file servers possible: serve files, build directory listings, etc
|
||||
* 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
|
||||
|
||||
To add it to your own go project:
|
||||
|
||||
```
|
||||
$ go get tildegit.org/tjp/gus
|
||||
```
|
||||
|
@ -43,6 +47,7 @@ $ go get tildegit.org/tjp/gus
|
|||
### Straight to the code please
|
||||
|
||||
=> [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)
|
||||
|
||||
## Contribute
|
||||
|
@ -50,13 +55,15 @@ $ go get tildegit.org/tjp/gus
|
|||
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)
|
||||
=> [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
|
||||
|
||||
```
|
||||
;;;;;:::::::::::::::::::::::;;;;;;;,,,,,,,''''''''''',,,,,,,,,,,;;;;;;;;;;,,,,,,,,,,,,,,,,,,;;;;:::::::::::::;;
|
||||
;;;;;;:::::::::::::::;;;;;;;;;;;,,,,,,,,'''''''''''''',,,,,,,,;;;;;;;;;;;;;;;;;;;,,,,,,,,,,,,,;;;;::::::::::::;
|
||||
|
|
|
@ -53,20 +53,26 @@ func Convert(wr io.Writer, doc gemtext.Document, overrides *template.Template) e
|
|||
|
||||
var baseTmpl = template.Must(template.New("mdconv").Parse(`
|
||||
{{ define "header" }}{{ end }}
|
||||
{{ define "textline" }}{{ . }}{{ end }}
|
||||
{{ define "linkline" -}}
|
||||
=> [{{ if eq .Label "" }}{{ .URL }}{{ else }}{{ .Label }}{{ end }}]({{ .URL }})
|
||||
{{ define "textline" }}{{ if ne .String "\n" }}
|
||||
{{ . }}{{ end }}{{ end }}
|
||||
{{ define "linkline" }}
|
||||
=> [{{ if eq .Label "" }}{{ .URL }}{{ else }}{{ .Label }}{{ end }}]({{ .URL }})
|
||||
{{ end }}
|
||||
{{ define "preformattedtextlines" }}` + "```\n" + `{{ range . }}{{ . }}{{ end }}` + "```\n" + `{{ end }}
|
||||
{{ define "heading1line" }}# {{ .Body }}
|
||||
{{ define "preformattedtextlines" }}` + "\n```\n" + `{{ range . }}{{ . }}{{ end }}` + "```\n" + `{{ end }}
|
||||
{{ define "heading1line" }}
|
||||
# {{ .Body }}
|
||||
{{ end }}
|
||||
{{ define "heading2line" }}## {{ .Body }}
|
||||
{{ define "heading2line" }}
|
||||
## {{ .Body }}
|
||||
{{ end }}
|
||||
{{ define "heading3line" }}### {{ .Body }}
|
||||
{{ define "heading3line" }}
|
||||
### {{ .Body }}
|
||||
{{ end }}
|
||||
{{ define "listitemlines" }}{{ range . }}* {{ .Body }}
|
||||
{{ define "listitemlines" }}
|
||||
{{ range . }}* {{ .Body }}
|
||||
{{ end }}{{ end }}
|
||||
{{ define "quoteline" }}> {{ .Body }}
|
||||
{{ define "quoteline" }}
|
||||
> {{ .Body }}
|
||||
{{ end }}
|
||||
{{ define "footer" }}{{ end }}
|
||||
`))
|
||||
|
|
|
@ -44,12 +44,14 @@ This is some non-blank regular text.
|
|||
* list
|
||||
|
||||
=> [as if](gemini://google.com/)
|
||||
|
||||
=> [https://google.com/](https://google.com/)
|
||||
|
||||
> this is a quote
|
||||
|
||||
> -tjp
|
||||
|
||||
`[1:] + "```\ndoc := gemtext.Parse(req.Body)\n```\n"
|
||||
` + "```\ndoc := gemtext.Parse(req.Body)\n```\n"
|
||||
|
||||
doc, err := gemtext.Parse(bytes.NewBufferString(gmiDoc))
|
||||
require.Nil(t, err)
|
||||
|
|
Reference in New Issue