site

(djk)
2011-06-05: Added ArchiveVersion and ArchiveUri macros.

Added ArchiveVersion and ArchiveUri macros.

diff --git a/doc/latest_release.txt b/doc/latest_release.txt
--- a/doc/latest_release.txt
+++ b/doc/latest_release.txt
@@ -1,30 +1,18 @@
-Fix bug that kept submissions with rebased changes from showing up in the
-"Discover" page in the 67724663687a version.
+Fixed the "Discover" page to draw lines for rebased versions.
 
+Added preliminary support for file diffs on the "Edit" page.
+It needs layout / CSS cleanup but it works.
 
-67724663687a:
-I added preliminary support for rebasing changes from other wiki versions.
+Added <<<ArchiveVersion>>> macro to print the 16 digit hex version
+of the current archive.
 
-You can load a "secondary" archive to rebase from either by using
-the "[rebase]" links in the "Discover" page or by explictly entering
-an archive uri at the bottom of a page and checking the "rebase"
-radio button.
+Added <<<ArchiveUri>>> macro to print a link to the archive SSK
+that the current wiki version was loaded from.
 
-The new macro:
+These macros where added so that people viewing dumped wiki
+freesites can tell which version / uri the wiki was
+dumped from.
 
-<<<RebasedChanges>>> shows a directory level diff between the
-parent version and the rebased version.
+Release notes for previous version:
+USK@kRM~jJVREwnN2qnA8R0Vt8HmpfRzBZ0j4rHC2cQ-0hw,2xcoQVdQLyqfTpF2DpkdUIbHFCeL4W~2X1phUYymnhM,AQACAAE/jfniki_releases/2/
 
-There have been a lot of changes and this release may be buggier
-than previous releases.
-
-If all else fails go back to the previous version:
-USK@kRM~jJVREwnN2qnA8R0Vt8HmpfRzBZ0j4rHC2cQ-0hw,2xcoQVdQLyqfTpF2DpkdUIbHFCeL4W~2X1phUYymnhM,AQACAAE/jfniki_releases/0/
-
-KNOWN LIMITATIONS:
-o There is no file level diffing yet (probably for a while yet)
-o You can't rebase into an empty archive.
-o There is no support in the changelog or discover UI for rebased
-  versions yet.
-o Submitted versions are INCOMPATIBLE with all earlier versions and
-  will cause spurious scary validation error. Sorry.
diff --git a/doc/quickstart.txt b/doc/quickstart.txt
--- a/doc/quickstart.txt
+++ b/doc/quickstart.txt
@@ -34,9 +34,6 @@ There are other wikis out there.
 
 Try entering "freenetdocwiki" in for the "Wiki Name" on the configuration page, then doing "Discover".
 
-=== Known Limitations ===
-# There is no merging or rebasing (yet).
-
 ----
 === Finding Your Private SSK in FMS===
 # Go to http://127.0.0.1:18080/localidentities.htm in the FMS web interface and click the "Export Identities" button
@@ -102,6 +99,6 @@ To subscribe to this board, got to your 
 
 If you can't find the group, add it.
 
-Also, Freetalk does not have the NNTP server enabled by default. You can do that in the Freetalk settings page (http://127.0.0.1:8888/Freetalk/Settings) by setting the "Enable NNTP server?" option to "true" in the "Global settings" section. 
+Also, Freetalk does not have the NNTP server enabled by default. You can do that in the Freetalk settings page (http://127.0.0.1:8888/Freetalk/Settings) by setting the "Enable NNTP server?" option to "true" in the "Global settings" section.
 
 It claims that you have to restart your node for the settings to take effect, but you can just go to your Freenet plugins page and click the "Reload" button for the Freetalk plugin to make these settings take effect.
diff --git a/readme.txt b/readme.txt
--- a/readme.txt
+++ b/readme.txt
@@ -1,4 +1,4 @@
-20110529
+20110605
 djk@isFiaD04zgAgnrEC5XJt1i4IE7AkNPqhBG5bONi6Yks
 
 WARNING:
diff --git a/release/cut_release.py b/release/cut_release.py
--- a/release/cut_release.py
+++ b/release/cut_release.py
@@ -67,7 +67,7 @@ PUBLIC_SITE = "USK@kRM~jJVREwnN2qnA8R0Vt
 
 FREENET_DOC_WIKI_IDX = 34
 FNIKI_IDX = 84
-REPO_IDX = 15
+REPO_IDX = 17
 
 ############################################################
 
diff --git a/src/fniki/wiki/WikiParserDelegate.java b/src/fniki/wiki/WikiParserDelegate.java
--- a/src/fniki/wiki/WikiParserDelegate.java
+++ b/src/fniki/wiki/WikiParserDelegate.java
@@ -97,6 +97,33 @@ public abstract class WikiParserDelegate
         return true;
     }
 
+    // Depends on CSS in add_header.css
+    protected boolean processedArchiveUriMacro(StringBuilder sb, String text) {
+        String uri = mArchiveManager.getParentUri();
+        if (uri == null) {
+            sb.append("???");
+            return true;
+        }
+
+        sb.append("<a class=\"archiveuri\" href=\""+ makeFreenetLink("freenet:" + uri) +"\">");
+        sb.append(escapeHTML(uri));
+        sb.append("</a>");
+        return true;
+    }
+
+    // Depends on CSS in add_header.css
+    protected boolean processedArchiveVersionMacro(StringBuilder sb, String text) {
+        String uri = mArchiveManager.getParentUri();
+        if (uri == null) {
+            sb.append("???");
+            return true;
+        }
+        sb.append("<span class=\"archivever\">");
+        sb.append(escapeHTML(getVersionHex(uri)));
+        sb.append("</span>");
+        return true;
+    }
+
     public boolean processedMacro(StringBuilder sb, String text) {
         if (text.equals("LocalChanges")) {
             return processedLocalChangesMacro(sb, text);
@@ -104,6 +131,10 @@ public abstract class WikiParserDelegate
             return processedRebasedChangesMacro(sb, text);
         } else if (text.equals("TitleIndex")) {
             return processedTitleIndexMacro(sb, text);
+        } else if (text.equals("ArchiveUri")) {
+            return processedArchiveUriMacro(sb, text);
+        } else if (text.equals("ArchiveVersion")) {
+            return processedArchiveVersionMacro(sb, text);
         }
         return false;
     }
diff --git a/style/add_header.css b/style/add_header.css
--- a/style/add_header.css
+++ b/style/add_header.css
@@ -2,8 +2,10 @@ div.indent{margin-left:20px;}
 div.center{text-align:center;}
 blockquote{margin-left:20px;background-color:#e0e0e0;}
 span.underline{text-decoration:underline;}
-body { background-color: #FFFFFF; color: #000000 }
-a { color: #1f6b9e }
+body { background-color: #FFFFFF; color: #000000;}
+a { color: #1f6b9e;}
 .pagetitle {text-align:left;}
 .talktitle {text-align:right;}
 .notalktitle {color:#c0c0c0;text-align:right;}
+.archiveuri {font-family: monospace; font-size: 70%;}
+.archivever {font-family: monospace;}
diff --git a/templates/wiki_dump_template.html b/templates/wiki_dump_template.html
--- a/templates/wiki_dump_template.html
+++ b/templates/wiki_dump_template.html
@@ -3,8 +3,20 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>%s</title>
-<style type="text/css">div.indent{margin-left:20px;} div.center{text-align:center;} blockquote{margin-left:20px;background-color:#e0e0e0;} span.underline{text-decoration:underline;}
+<style type="text/css">
+div.indent{margin-left:20px;}
+div.center{text-align:center;}
+blockquote{margin-left:20px;background-color:#e0e0e0;}
+span.underline{text-decoration:underline;}
+body { background-color: #FFFFFF; color: #000000;}
+a { color: #1f6b9e; }
+.pagetitle {text-align:left;}
+.talktitle {text-align:right;}
+.notalktitle {color:#c0c0c0;text-align:right;}
+.archiveuri {font-family: monospace; font-size: 70%% }
+.archivever {font-family: monospace;}
 </style>
+<!-- LOOK above. TRICKY: There is double percent to get a literal percent because this is a format string.-->
 </head>
 <body>
 <h1>%s</h1>