# Diff of /2024/06/02/readying-a-blog-for-revision-histories-and-sprouts-under-unstatic/index.html

## Revision f9b8a24e6219588d1f7f570dd9d448d02a5c6529 => current

Line | f9b8a24e6219588d1f7f570dd9d448d02a5c6529 | current
--- | --- | ---
1 | <!DOCTYPE html> | <!DOCTYPE html>
2 | <html> | <html>
3 | <head> | <head>
4 | <meta charset="utf-8"> | <meta charset="utf-8">
5 | <meta name="description" content="tech notebook @ interfluidity"> | <meta name="description" content="tech notebook @ interfluidity">
6 | <meta name="keywords" content="Scala, tech, interfluidity"> | <meta name="keywords" content="Scala, tech, interfluidity">
7 | <meta name="author" content="Steve Randy Waldman"> | <meta name="author" content="Steve Randy Waldman">
8 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | <meta name="viewport" content="width=device-width, initial-scale=1.0">
9 |  |
10 |  | <!-- icons / favicons -->
11 |  |
12 |  | <!-- we just want the squared-corner image with no overlays for traditional favicon uses at tiny sizes -->
13 |  | <!-- swaldman added, ick, firefox scales down the biggest size for its tab icon, so we use the graphic we want for small sizes as the largest... -->
14 |  | <link rel="icon" type="image/png" sizes="500x500" href="../../../../icon/interfluidity-wave-blank-square-500x500.png">
15 |  | <link rel="icon" type="image/png" sizes="32x32" href="../../../../icon/interfluidity-wave-blank-square-32x32.png"> <!-- swaldman added, for standard favicon size -->
16 |  | <link rel="icon" type="image/png" sizes="16x16" href="../../../../icon/interfluidity-wave-blank-square-16x16.png"> <!-- swaldman added, for standard favicon size -->
17 |  | <link rel="icon" type="image/png" href="../../../../icon/interfluidity-wave-blank-square-57x57.png"> <!-- swaldman added, for small icons by default -->
18 |  |
19 |  | <!-- at bigger sizes, we overlay a bit of text -->
20 |  | <!-- icons as recommened by https://mathiasbynens.be/notes/touch-icons -->
21 |  | <!-- For Chrome for Android: -->
22 |  | <link rel="icon" sizes="192x192" href="../../../../icon/interfluidity-wave-tech-192x192.png">
23 |  | <!-- For iPhone 6 Plus with @3× display: -->
24 |  | <link rel="apple-touch-icon-precomposed" sizes="180x180" href="../../../../icon/interfluidity-wave-tech-180x180.png">
25 |  | <!-- For iPad with @2× display running iOS ≥ 7: -->
26 |  | <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../../icon/interfluidity-wave-tech-152x152.png">
27 |  | <!-- For iPad with @2× display running iOS ≤ 6: -->
28 |  | <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../../../icon/interfluidity-wave-tech-144x144.png">
29 |  | <!-- For iPhone with @2× display running iOS ≥ 7: -->
30 |  | <link rel="apple-touch-icon-precomposed" sizes="120x120" href="../../../../icon/interfluidity-wave-tech-120x120.png">
31 |  | <!-- For iPhone with @2× display running iOS ≤ 6: -->
32 |  | <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../../../icon/interfluidity-wave-tech-114x114.png">
33 |  | <!-- For the iPad mini and the first- and second-generation iPad (@1× display) on iOS ≥ 7: -->
34 |  | <link rel="apple-touch-icon-precomposed" sizes="76x76" href="../../../../icon/interfluidity-wave-tech-76x76.png">
35 |  | <!-- For the iPad mini and the first- and second-generation iPad (@1× display) on iOS ≤ 6: -->
36 |  | <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../../../icon/interfluidity-wave-tech-72x72.png">
37 |  | <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
38 |  | <link rel="apple-touch-icon-precomposed" href="../../../../icon/interfluidity-wave-blank-square-57x57.png">
39 |  |
40 |  | <!-- end icons / favicons -->
41 |  |
42 | <link rel="alternate" type="application/rss+xml" title="tech.interfluidity.com updates" href="../../../../feed/index.rss"> | <link rel="alternate" type="application/rss+xml" title="tech.interfluidity.com updates" href="../../../../feed/index.rss">
43 |  | <link rel="alternate" type="application/x-all-item-rss+xml" title="tech.interfluidity.com - all items" href="https://tech.interfluidity.com/all-item-feed/index.rss">
44 | <link rel="alternate" type="application/rss+xml" title="interfluidity - all blogs" href="https://www.interfluidity.com/unify-rss/all-blogs.rss"> | <link rel="alternate" type="application/rss+xml" title="interfluidity - all blogs" href="https://www.interfluidity.com/unify-rss/all-blogs.rss">
45 | <link rel="alternate" type="application/rss+xml" title="interfluidity - all blogs and microblogs" href="https://www.interfluidity.com/unify-rss/all-blogs-and-microblogs.rss"> | <link rel="alternate" type="application/rss+xml" title="interfluidity - all blogs and microblogs" href="https://www.interfluidity.com/unify-rss/all-blogs-and-microblogs.rss">
46 |  | <link rel="alternate" type="application/x-single-item-rss+xml" title="Readying a blog for revision histories and sprouts under unstatic" href="index.rss">
47 | <link rel="stylesheet" href="../../../../css/style.css"> | <link rel="stylesheet" href="../../../../css/style.css">
48 | <link rel="stylesheet" href="../../../../css/highlightjs/steve-night-owl.css"><!-- theme for highlight.js --> | <link rel="stylesheet" href="../../../../css/highlightjs/steve-night-owl.css"><!-- theme for highlight.js -->
49 | <script src="../../../../js/highlight/highlight.min.js"></script> | <script src="../../../../js/highlight/highlight.min.js"></script>
⋮ | ⋮ | ⋮
77 | </div> | </div>
78 | <div id="content"> | <div id="content">
79 | <div class="day-stamp"> | <div class="day-stamp">
80 | 2024-06-02 <span class="arrow">⇒</span> | 2024-06-05 <span class="arrow">⇒</span>
81 | </div> | </div>
82 | <article class="presentation-single uid-readying-a-blog-for-sprouts"> | <article class="presentation-single uid-readying-a-blog-for-sprouts">
83 | <div class="entry-header"> | <div class="entry-header">
84 | <h1><a href="index.html">Readying a blog for revision histories and sprouts under unstatic</a></h1> | <h1><a href="index.html">Readying a blog for revision histories and sprouts under unstatic</a></h1>
85 | <hr class="below-title"> | <hr class="below-title">
86 | </div> | </div>
87 |  | <div class="update-prepend rss-description-exclude">
88 |  | <em> ➣ This post was meaningfully revised at 2024-06-06 @ 01:30 PM EDT. The previous revision is <a href="index-oldcommit-f9b8a24e6219588d1f7f570dd9d448d02a5c6529.html">here</a>, diff <a href="index-diff-f9b8a24e6219588d1f7f570dd9d448d02a5c6529-to-current.html">here</a>. (See <a href="index.html#update-history">update history</a>.) </em>
89 |  | <hr>
90 |  | </div>
91 | <div class="entry-body"> | <div class="entry-body">
92 | <div class="flexmark markdown"> | <div class="flexmark markdown">
93 | <p>I've been developing support for my take on <a href="https://v5.chriskrycho.com/essays/feeds-are-not-fit-for-gardening/">Chris Krycho' "sprouts"</a> against this blog. Much of that support is now built into <a href="https://github.com/swaldman/unstatic"><code>unstatic</code></a>, my library for building static-site generators. But it does also require some support from within applicatons of that library, from the scala code and the <a href="https://github.com/swaldman/untemplate-doc">untemplates</a> of the individual site generators.</p> | <p>I've been developing support for my take on <a href="https://v5.chriskrycho.com/essays/feeds-are-not-fit-for-gardening/">Chris Krycho' "sprouts"</a> against this blog. Much of that support is now built into <a href="https://github.com/swaldman/unstatic"><code>unstatic</code></a>, my library for building static-site generators. But it does also require some support from within applications of that library, from the scala code and the <a href="https://github.com/swaldman/untemplate-doc">untemplates</a> of the individual site generators.</p>
94 | <p>I'm going to upgrade my <a href="https://drafts.interfluidity.com/archive.html">"drafts"</a> blog to support revisions, diffs, and sprouts. I'll document what it takes to do that here.</p> | <p>I'm going to upgrade my <a href="https://drafts.interfluidity.com/archive.html">"drafts"</a> blog to support revisions, diffs, and sprouts. I'll document what it takes to do that here.</p>
95 | <h3><a href="#enable-revision--and-diff-generation-in-scala-code" id="enable-revision--and-diff-generation-in-scala-code" name="enable-revision--and-diff-generation-in-scala-code" class="anchorlink"></a>Enable revision- and diff-generation in Scala code</h3> | <h3><a href="#enable-revision--and-diff-generation-in-scala-code" id="enable-revision--and-diff-generation-in-scala-code" name="enable-revision--and-diff-generation-in-scala-code" class="anchorlink"></a>Enable revision- and diff-generation in Scala code</h3>
96 | <p>In the object <a href="https://github.com/swaldman/drafts.interfluidity.com/blob/main/src/com/interfluidity/drafts/DraftsSite.scala"><code>DraftsSite</code></a>, the <a href="https://github.com/swaldman/unstatic/blob/main/ztapir/src/unstatic/ztapir/ZTSite.scala"><code>unstatic.ztapir.ZTSite</code></a> that defines the site to be generated, inside the <a href="https://github.com/swaldman/unstatic/blob/main/ztapir/src/unstatic/ztapir/simple/SimpleBlog.scala"><code>unstatic.ztapir.simple.SimpleBlog</code></a> that defines the blog, add a <a href="https://github.com/swaldman/unstatic/blob/main/ztapir/src/unstatic/ztapir/simple/RevisionBinder.scala"><code>RevisionBinder</code></a> that can pull old revisions of pages and generate them into the website, and a <a href="https://github.com/swaldman/unstatic/blob/main/ztapir/src/unstatic/ztapir/simple/DiffBinder.scala"><code>DiffBinder</code></a> that can generate diffs between current and new revisions:</p> | <p>In the object <a href="https://github.com/swaldman/drafts.interfluidity.com/blob/main/src/com/interfluidity/drafts/DraftsSite.scala"><code>DraftsSite</code></a>, the <a href="https://github.com/swaldman/unstatic/blob/main/ztapir/src/unstatic/ztapir/ZTSite.scala"><code>unstatic.ztapir.ZTSite</code></a> that defines the site to be generated, inside the <a href="https://github.com/swaldman/unstatic/blob/main/ztapir/src/unstatic/ztapir/simple/SimpleBlog.scala"><code>unstatic.ztapir.simple.SimpleBlog</code></a> that defines the blog, add a <a href="https://github.com/swaldman/unstatic/blob/main/ztapir/src/unstatic/ztapir/simple/RevisionBinder.scala"><code>RevisionBinder</code></a> that can pull old revisions of pages and generate them into the website, and a <a href="https://github.com/swaldman/unstatic/blob/main/ztapir/src/unstatic/ztapir/simple/DiffBinder.scala"><code>DiffBinder</code></a> that can generate diffs between current and new revisions:</p>
⋮ | ⋮ | ⋮
113 | <p>So... We'll</p> | <p>So... We'll</p>
114 | <ol> | <ol>
115 | <li>Steal <a href="https://github.com/swaldman/tech.interfluidity.com/blob/main/untemplate/com/interfluidity/tech/blog/layout-update-history.html.untemplate"><code>layout-update-history.html.untemplate</code></a> from the tech blog, and <a href="https://github.com/swaldman/drafts.interfluidity.com/blob/main/untemplate/com/interfluidity/drafts/mainblog/layout-update-history.html.untemplate">bring it in as a layout of drafts</a>. (I had to import <code>com.interfluidity.drafts.DraftsSite.MainBlog</code>, and modify the link in the note to point to the drafts got repository, rather than the tech rep.)</li> | <li>Steal <a href="https://github.com/swaldman/tech.interfluidity.com/blob/main/untemplate/com/interfluidity/tech/blog/layout-update-history.html.untemplate"><code>layout-update-history.html.untemplate</code></a> from the tech blog, and <a href="https://github.com/swaldman/drafts.interfluidity.com/blob/main/untemplate/com/interfluidity/drafts/mainblog/layout-update-history.html.untemplate">bring it in as a layout of drafts</a>. (I had to import <code>com.interfluidity.drafts.DraftsSite.MainBlog</code>, and modify the link in the note to point to the drafts got repository, rather than the tech rep.)</li>
116 | <li>Modify <a href="https://github.com/swaldman/drafts.interfluidity.com/blob/main/untemplate/com/interfluidity/drafts/mainblog/layout-entry.html.untemplate"><code>layout-entry.html.untemplate</code></a> in drafts to bring in the new layout of update history. That turns out to be really easy, because we already have logic at the end of our entry layout to restrict addition of previous and next links to single page presentations. So all we have to do is add our update history layout just after the <code>div</code> for those links, but within the conditionally added region. It's literally just | <li>Modify <a href="https://github.com/swaldman/drafts.interfluidity.com/blob/main/untemplate/com/interfluidity/drafts/mainblog/layout-entry.html.untemplate"><code>layout-entry.html.untemplate</code></a> in drafts to bring in the new layout of update history. That turns out to be really easy, because we already have logic at the end of our entry layout to restrict addition of previous and next links to single page presentations. So all we have to do is add our update history layout just after the <code>div</code> for those links, but within the conditionally added region. It's literally just
117 | <pre><code class="language-plaintext"><( layout_update_history_html( input ) )> | <pre><code class="language-plaintext"><( layout_update_history_html( input ) )>
118 | </code></pre> | </code></pre>
119 | <p>inserted just after that <code>div</code>, still within the conditional region.</p></li> | <p>inserted just after that <code>div</code>, still within the conditional region.</p></li>
⋮ | ⋮ | ⋮
190 | </div> | </div>
191 | <div class="entry-footer"> | <div class="entry-footer">
192 | <div class="post-metainfo"> | <div class="post-metainfo">
193 | <a href="index.html">03:15 AM EDT</a> | <div class="updated-note">
194 |  | <a href="index.html#major-updates">Last major update at 2024-06-06 @ 01:30 PM EDT</a>
195 |  | </div>
196 |  | <div>
197 |  | <a href="index.html" class="pubtime">11:00 PM EDT</a>
198 |  | </div>
199 | </div> | </div>
200 | </div> | </div>
201 | </article> | </article>
⋮ | ⋮ | ⋮
208 | <a href="../../../../index.html">↑↑↑</a> | <a href="../../../../index.html">↑↑↑</a>
209 | </div> | </div>
210 | <div class="next"> | <div class="next">
211 |  | <a href="../../06/neonix/index.html">Neonix →</a>
212 | </div> | </div>
213 | </div> | </div>
214 | </div><!-- after-article --> | <div id="update-history" class="update-history">
215 |  | <h3 class="update-history-title"><a id="major-updates" href=""></a>Major revisions:</h3>
216 |  | <ul>
217 |  | <li><span class="update-timestamp"><i>2024-06-06 @ 01:30 PM EDT</i></span> — Correct bad publication date and time. (<a href="index-diff-f9b8a24e6219588d1f7f570dd9d448d02a5c6529-to-current.html">diff</a>)</li>
218 |  | <li><span class="update-timestamp"><i> <a href="index-oldcommit-f9b8a24e6219588d1f7f570dd9d448d02a5c6529.html">2024-06-05 @ 11:00 PM EDT</a></i></span> — Initial publication.</li>
219 |  | </ul>
220 |  | <div class="update-history-note">
221 |  | Timestamps represent "major", substantative revisions. There may have been subsequent typo fixes and language reworkings within a major revision, after the time displayed. For a more complete and fine-grained update history, you can view the <a href="https://github.com/swaldman/tech.interfluidity.com/commits/main/">git repository commit history</a>. The most recent minor modification of this entry occurred 2024-06-06 @ 02:26 PM EDT.
222 |  | </div>
223 |  | </div>
224 |  | </div>
225 |  | <!-- after-article -->
226 | </div> | </div>
227 | <div id="right-sidebar"> | <div id="right-sidebar">
228 | </div> | </div>
229 | </div> | </div>
230 | </body> | </body>
231 | </html> | </html>