Refactoring Gemini Clients


As I interact with Gemini I am beginning to get a sense of what it can be. In particular, modularity is becoming a common concept in my thoughts.


Modular Client Architecture


Leaving the server alone for a bit, let's look at the client. Clearly there are modules to be separated here:



In a previous post I considered using persistent 4-character shortcuts for URLs. So:



Modular Rendering?


The idea of gemtext being only one of many supported formats comes up every so often. Wouldn't it be nice to be able to outsource layout/rendering to a separate module from the UI? UI module would still present a common front to the user, with customizable keys, mouse navigation if desired, ability to click on links or otherwise navigate.. But the actual layout takes place outside, as a handler for a particular page type.


Gemtext, minimal as it is, is completely idiotic in its inconsistency. Each type of line has its own kind of foolishness, and each is handled in a different way. Oh, and there is also a global mode for preformatted quoting. If you tried to be random, you would likely be more consistent than Gemtext. But whatever, we know how to render it.


Why not support CSV, _as a separate module_? Markdown, some zipped ASCII art, whatever. If we are modular, the only downside is that the user hast to get the module (and someone has to write it). If the UI is modular and clearly defined in its scope, perhaps modules can be compatible with different UIs (yeah, right).


Is there a simpler underlying format (a consistent one) for describing text? That would be the UI module's format, while layout modules would convert ascii, rich text, markdown, gemtext or whatever to that format for display and navigation in the UI. It has to describe text layout and flag links for navigation - that is all!


Gemtext is not too far off. But it would be better to have a semantic format for transmission. Delimited blocks of text preceded by a single-byte type. Or perhaps something like msgpack that allows arbitrary structured data...


Something to think about...



/gemlog/