💾 Archived View for rawtext.club › ~sloum › geminilist › 000918.gmi captured on 2020-09-24 at 02:14:44. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

<-- back to the mailing list

gemini-fmt idea

Brian Evans b__m__e at mailfence.com

Wed May 20 20:06:34 BST 2020

- - - - - - - - - - - - - - - - - - - 

I liked this idea. I use the go toolchain a lot and really appreciate the options available. In particular `go fmt`. I think consistent code is readable code. The same is possiblefor `text/gemini` documents.

In that spirit I have made a tool (it is still a work in progress):https://tildegit.org/sloum/gemini

(I'm open to changing the name, but I liked the idea of running: `gemini fmt ./index.gmi`

Current features:

fmt* Normalizes a text/gemini document's style* Reports errors in markup* Ability to read a piped file from stdin (coming soon)* Writes to stdout and stderr* -o flag to write to file (coming very soon)

get* Makes a basic request and prints the result (ala curl)* Can request just the header; defaults to just the body (for easy redirection/piping)* Ability to pass cert/key pair (coming soon)* Automatically follows redirects* Writes to stdout/stderr* -o flag to write to file (coming very soon)

spec* Makes a get request for the spec* Writes to stdout/stderr* -o flag to write to file (coming very soon)* request a subsection of the spec (coming soon)

version* prints the tool version

serve (coming soon)* will spin up a really simple gemini file server on localhost* configurable port

If people would like anything else let me know. I dug through the `text/gemini` to make sureI was getting everything within spec for the formatting. The only place I break from the specis w/ regard to alt text on the opening line of a preformatted block (I allow it and format it). Ihave included it, but specifically state in the README.md that it is an experimental featurethat may be removed or changed in the future.

Anyway, hopefully it is useful to someone eventually. I have definitely liked the consistentoutput that it provides. It lets me write with a lot of extra spacing and organize my thoughtshow I want, but then cleans it all up nicely. :)