making-tinyoffice-links
Making Tiny Little Office links
Tiny Little Office (tinylittleoffice.com) keeps a whole document in its URL fragment, after the #, which browsers never send to a server. You write the document as TLO text (Markdown plus a few additions), percent-encode it into a link and hand the link over. Whoever opens it gets an editor on their own copy, and the address bar updates after each edit to hold the new version.
Procedure
- Pick the app from the table below. Read only that app's reference file. It holds the shapes the app reads and one or two worked examples.
- Write the TLO to a file in your scratchpad. Copy an example from the reference and change it rather than starting from nothing.
- Build the link with the script, which packs the text the way the site does and runs the offline lint:
It prints the URL on stdout, and findings and length warnings on stderr.python3 scripts/tlo.py link deck talk.tlo --title "My talk" --by "Muninn" - Fix every finding and rebuild.
python3 scripts/tlo.py read <url>gives back the text any link holds, packed or plain, so you can edit a link you were sent. It also reads links a chat client mangled (percent-encoded, a quote glued to the end);tlo.py repair <url>prints the clean link. - Deliver. If the link is under 2,000 characters, give it as a Markdown link with a plain description. If it is longer, put the bare URL alone in a fenced code block. Chat renderers and some apps break or truncate long links, and the code block keeps it whole for copying. Put the link on its own line: Webex, for one, pulls a following quote or bracket into the link. Say that the link is the document: an edit produces a new link, and anyone holding the link can read it.
The script makes the packed form the site itself shares: #/v1/<app>/<flag><payload>, the TLO deflated against TLO's frozen word dictionary, base64url with - for 62 and a + every 300 characters so messaging apps don't break it. The site itself writes ~ for 62 and reads - as well. This script writes - because chat clients such as Webex percent-encode ~ (sometimes twice, %257E) and the site does not decode that, so the link opens empty. --tilde reproduces the site's own output. It runs 35–50% shorter than the readable form. --title and --by go into the document's head. --plain gives the readable /<app>/#title=…&doc=… form instead, which the site also opens and packs on arrival.