Two technical questions

@419 A stub is just a slang term for the URL fragment attached to a section in coda (maybe there’s an internal name for it?)

The anatomy of a Coda URL looks like this. note: reverse engineering, not guaranteed to be accurate, but it’ll at least be close

https://coda.io/d/<document>/<section>#<bookmark>
  • document: This is the coda document, followed by a unique ID. For example, My-Foo-Doc_d7hhhhhhbWl has a document title of “My Foo Doc” and has a unique ID of d7hhhhhhbWl (edited). The Unique ID remains constant, even as the first half of the document name changes.
  • section: The section follows an identical structure like “My-Section-Title_suvcp”. In this one, “My Section Title” was the section title name, and suvcp is the unique section ID (what I was calling the “stub”).
  • bookmark: Every single line break, formatting change, table, or otherwise identifiable position in a coda doc has a bookmark that appears after the # symbol. It looks something like _luI55 and you’ll see it change as you click around within a section.

While we can’t get the unique ID for the document yet, we can get it for the section. This means we can create links to sections with our own custom text, overriding Coda’s default behavior.

The final column is a custom hyperlink that uses the stub and builds a new URL, setting the text to another column.

Right now, this is just a cool way to get at the section URLs and mutate them, but it’s one step closer to accessing the value at a specific bookmark location. Some uses of this pattern I can think of

  • large coda docs that need a Table of Contents that may not map to the section hierarchy on the left bar
  • the need for a link to a section to remain the same when the section title changes (right now, links will update which could confuse users in larger docs)
  • With document support, it’s possible to cross-link coda docs efficiently since the uniqueID of a section and document remain the same regardless of changes. (note: this requires thisDocument.documentId() which doesn’t exist yet)

Great questions!

3 Likes