Pretty print gemtext
2023-02-07T11:51:31Z
Since I discovered gemtext, I use it daily in my notes and emails.
It is just too easy to extend, simple to remember and very easy to read even unformatted.
However, I was worried that long lines become a problem to some readers of my ATOM feed or when people read my mails since it depends on how the client handle them.
I tried to use "fmt" command, but lists were broken into a big paragraph.
At that game, "fold" wasn't better.
So I decided to write gmipp, a gemtext pretty printer.
- Paragraphes do not exceed a maximum width which is maximum 60 char by default.
- Lists with long lines are splitted on multiple lines indented paragraphs.
- bonus : after a sentence, two spaces are added to ease reading experience.
As example, see a portion this page without gmipp
# Pretty print gemtext 2023-02-07T11:51:31Z => gemini://gemini.circumlunar.space/docs/gemtext.gmi Since I discovered gemtext, I use it daily in my notes and emails. It is just too easy to extend, simple to remember and very easy to read even unformatted. However, I was worried that long lines become a problem to some readers of my ATOM feed or when people read my mails since it depends on how the client handle them. => https://man.openbsd.org/fmt I tried to use "fmt" command, but lists were broken into a big paragraph. At that game, "fold" wasn't better. => /code/gmipp.tgz So I decided to write gmipp, a gemtext pretty printer. * Paragraphes do not exceed a maximum width which is maximum 60 char by default. * Lists with long lines are splitted on multiple lines indented paragraphs. * bonus : after a sentence, two spaces are added to ease reading experience.
with gmipp :
# Pretty print gemtext 2023-02-07T11:51:31Z => gemini://gemini.circumlunar.space/docs/gemtext.gmi Since I discovered gemtext, I use it daily in my notes and emails. It is just too easy to extend, simple to remember and very easy to read even unformatted. However, I was worried that long lines become a problem to some readers of my ATOM feed or when people read my mails since it depends on how the client handle them. => https://man.openbsd.org/fmt I tried to use "fmt" command, but lists were broken into a big paragraph. At that game, "fold" wasn't better. => /code/gmipp.tgz So I decided to write gmipp, a gemtext pretty printer. * Paragraphes do not exceed a maximum width which is maximum 60 char by default. * Lists with long lines are splitted on multiple lines indented paragraphs. * bonus : after a sentence, two spaces are added to ease reading experience.
Now, I have in my "~/.exrc" file a shortcut to format my emails in vi using "gp" keybind :
map gp :%!gmipp ^M
EDIT : Modified how links are printed, url on a single line