💾 Archived View for rawtext.club › ~sloum › geminilist › 000345.gmi captured on 2020-09-24 at 02:38:12. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
solderpunk solderpunk at SDF.ORG
Fri Jan 17 14:27:15 GMT 2020
- - - - - - - - - - - - - - - - - - - ``` On Fri, Jan 17, 2020 at 08:58:04AM -0500, lel wrote: > > Yes, this is exactly what I was trying to say. Ah, right, sorry for not getting that. I think this whole conversation,despite Sean's best efforts to give us formally defined terms, issuffering a lot from the fact that things like "reflowing" meandifferent things to different people or in different contexts, so we'reoften talking past each other. We'd still need ``` in this system, right, to avoid e.g. long lines ofsource getting mangled on very narrow phone screens? So minimalrendering pseudocode looks like this: preformatted = Falsefor line in all_the_lines: if line == "```": preformatted = not preformatted elif preformatted: print(line) elif line.startwith("= >"): handle_link(line) else: wrap_line_to_viewport(line) Where wrap_line_to_viewport may need to be written by the user if thereisn't a library function (and should print empty lines if given them). Non-minimal rendering just involves replacing that final "else" clausewith more "elifs" to catch e.g. list items or headers (dispatching todifferent functions, like wrap_bold_line_to_viewport to display headingsin bold). You can add as many or as few of those extra clauses as youlike to pretty things up, as long as whatever prettiness you wantdoesn't depend upon anything. If this rendering code *is* fed text/gemini that has been hard wrappedto a width less than or equal to the viewport, that text comes backunmangled (but narrower than it otherwise could be). Are there really no catches beyond this? I'm sure there must be, but ifnot I guess the next thing to do is to start thinking about howdifficult a "good enough" (not necessarily perfect) implementation ofwrap_line_to_viewport is in most languages, and decide whether or not wethink that burden is too high. Cheers,Solderpunk