◊(Local Yarn Code "Tech-note a0c8ebab")

The next thing I need to tackle, really, is ticket [3514e65] — Series pages.

However, I’ve been away from the source code for a bit and find myself needing a refresher before I do that one.

So I’ve decided to focus on another task: building the Scribble documentation for the code I’ve written so far. This is a great fit for where I’m at now, because it can be done in small spurts, it’s rewarding because it looks cool, and it serves as a much-needed bank of cognitive effort that will pay off as I build on the foundation I started and things get a bit more complicated.

[https://docs.racket-lang.org/scribble/index.html|Scribble] is the best code documentation system I have yet seen. It cross-references <em>everything</em> to <em>everything</em>, its structural demands expose gaps in your design and thinking while you’re writing it, and it just plain looks good. (When I reskinned this repo my goal was to get it visually in line with the styles used by the Scribble documents I knew would be coming later.)

You can see this evolving in real time in the [https://thelocalyarn.com/cgi-bin/yarncode/uv/scribbled/scribble.html|Code Docs] section of this repo. As I edit the Scribble docs in the <code>code-docs</code> folder, I update the HTML output live on this site pretty much continuously so I can check my work. To reduce timeline churn, I only check in the changes to the original <code>.scrbl</code> files themselves in very large hunks.

I’ve never seen Fossil and Scribble integrated anywhere else, but they go together very well. If you specifically want to understand that integration, here's what to look at:

  *  I’m storing and serving the HTML/CSS/JS output of Scribble as [https://www.fossil-scm.org/index.html/doc/trunk/www/unvers.wiki|“unversioned” files] in the <code>scribbled/</code> subfolder. That subfolder is also part of the repo’s [https://www.fossil-scm.org/index.html/help?cmd=ignore-glob|<code>ignore-glob</code>] setting.
  *  Check out the <code>scribble</code> target of the [/file/makefile|<code>makefile</code>]. This shows you the sequence of commands for rebuilding the HTML docs, adding them to the repo as unversioned files, and syncing these unversioned files to the remote repository on the server (the one you’re looking at now).
  *  Look at the [/file/code-docs/scribble-iframe.html|<code>code-docs/scribble-iframe.html</code>] file; this file is version-controlled, but also gets copied to scribbled/ and added to the unversioned files group. It contains an <code><iframe></code> tag that loads up the Scribble documentation
  *  I had to edit the skin for the repository’s web UI to add a navigation button for the Code Docs section, add CSS to correctly position the iframe to fill up the page propperly, and finally to edit the [https://content-security-policy.com/|content security policy] (via a <code><meta></code> tag in the HTML’s <code><head></code> section) to allow links into the main Racket documentation at <code>docs.racket-lang.org</code>.
  *  Finally, in [/file/code-docs/scribble-helpers.rkt|<code>code-docs/scribble-helpers.rkt</code>], I made a few custom convenience Scribble functions to allow easy linking to tickets and wiki pages in this repository, or to pages on external sites. This was partly necessary because, for links from inside the <code><iframe></code> to work, you need to add the <code>target="_parent"</code> attribute to the link (or <code>target="_blank"</code> if doing an external link, due to the content security policy), and the Scribble code for doing this is annoying if you have to type it more than once. 

If, despite your interest in this topic, these pointers still seem a little inscrutable, just go out and try setting up a Fossil repo and with integrated Scribble docs like this one. You’ll run into obstacles. Then the stuff above will make a lot more sense.