💾 Archived View for gemini.ctrl-c.club › ~de_alchmst › b-logs › ruby › ptts › 010:what-why-how.gmi captured on 2024-07-08 at 23:51:02. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-05-10)

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

Plain Text Typesetting System

what?

ptts (styliesed in all lowercase) is, or more more correctly will be, simple typesetting program for formatting text to be mainly shown in terminal output. In case you don't know, typesetting language is syntax used for telling computer how text output should look like, but unlike markup languages, it is more computer than writer oriented. While in markup language, you say stuff like 'this is L1 heading' or 'this is ordered list' and how it looks can vary, in typesetting language you directly say 'this text will be in this font of this size and with this indent'. This one is not concerned with stuff like font though.

why?

Fair question.

I guess that I just like my terminal, monospace fonts and simple things. From time to time I like writing some more artistic texts, or I just have to write a bunch notes. In those cases I want to use more than just a wall of text and since I really don't like WYSIWYG editors, markdown it is. While markdown is nice for stuff like github README files or these b-logs

(more on that here)

, it kinda lacks when I want to be a bit more creative.

First its very limited in what can you write in it, so if you want some extra indentation or tree structure different from bunch on nested lists, you are out of luck. Also in general, if you don't like how your headings look, you either have to get markup interpreter that supports css, or again, you'r out of luck. Plus you either need that interpreter to view it, or you have to convert to pdf, which I also don't like that much.

So why not just write it as plaintext?

First I also want to optionally support stuff like basic text formatting (bold, italic, underline) and colors, as these are supported by terminal output. Second it is easier to change stuff later this way, plus I also like the idea of text changing to fit my terminal size. And in the end, you still sometimes need that pdf. For example if you want to print your text, good luck making your plaintext file look nice.

Also yes, I have tried groff, but I did not find any nice way to output in terminal and it seems so complex and undocumented, that I would rather make my own typesetter than try to learn groff.

how?

But with ruby of course. Well for now anyways...

I have few steps in this project

1, ruby version to just parse source and output to terminal, just some parts of standard for now, after this I will make repo available

2, crystal version that will also allow to show output in 'less' like interface. This one will be the command that will also handle next steps

3, add tables in some way, I still don't know how would I like to do that, but I will figure that out later

4, output to pdf, maby some other stuff as well

Also I would like to make vim highlighting at some point. It will not be hard given simplicity of language, but I don't know when I get to it.

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

next: to-the-crystal

b-logs

home

ctrl-c.club