diff options
author | David A. Madore <david+git@madore.org> | 2014-10-10 17:37:54 +0200 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2014-10-10 20:04:14 +0200 |
commit | 5b15f489d9793afdfe5dde2a2934c975b61567bd (patch) | |
tree | 4abb9f4a7287057bf182579780c63443011c1f91 | |
parent | 608c0e55989d40c0f8f3a47c244356acf5002f48 (diff) | |
download | damlengine-5b15f489d9793afdfe5dde2a2934c975b61567bd.tar.gz damlengine-5b15f489d9793afdfe5dde2a2934c975b61567bd.tar.bz2 damlengine-5b15f489d9793afdfe5dde2a2934c975b61567bd.zip |
Add the principle of a d:wrefcat="@single" type.
-rw-r--r-- | org/madore/damlengine/TodoWrefAttr.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/org/madore/damlengine/TodoWrefAttr.java b/org/madore/damlengine/TodoWrefAttr.java index aeb8bb2..428000a 100644 --- a/org/madore/damlengine/TodoWrefAttr.java +++ b/org/madore/damlengine/TodoWrefAttr.java @@ -54,7 +54,8 @@ public class TodoWrefAttr extends TodoAttr { if ( ! ((wrefYearStr+"-"+wrefMonthStr+"-"+wrefDayStr) .equals(esum.date)) ) throw new IllegalArgumentException("date mismatch for reference to entry "+wrefNumberStr); - if ( wrefCat != null && ! wrefCat.equals("@month") ) { + if ( wrefCat != null && ! wrefCat.equals("@month") + && ! wrefCat.equals("@single") ) { if ( esum.catSet == null || ! esum.catSet.contains(wrefCat) ) throw new IllegalArgumentException("reference to entry "+wrefNumberStr+" in wrong category "+wrefCat); } @@ -62,7 +63,7 @@ public class TodoWrefAttr extends TodoAttr { // Choose file portion of link target if ( esum != null && esum.doSinglePage != null && ! wrefSupplementStr.equals("") ) { // Linking to a _fragment_ of an entry that has a single page. - if ( wrefCat != null ) + if ( wrefCat != null && ! wrefCat.equals("@single") ) System.err.println("warning: ignoring d:wrefcat attribute!"); if ( ctx.wsc != null && ctx.wsc.sel != null && ctx.wsc instanceof Context.WeblogSingleSelectionContext @@ -74,7 +75,8 @@ public class TodoWrefAttr extends TodoAttr { && ctx.wsc.sel.contains(wrefNumber) ) { // Linking to an entry already present on this page. targetFile = ""; - } else if ( wrefCat != null && ! wrefCat.equals("@month") ) { + } else if ( wrefCat != null && ! wrefCat.equals("@month") + && ! wrefCat.equals("@single") ) { // Linking to an entry in a designated category. targetFile = targetStdDir + wrefCat + ".html"; } else { @@ -83,7 +85,7 @@ public class TodoWrefAttr extends TodoAttr { if ( esum != null && esum.doSinglePage != null // Note to self: remember we could be called from d:wxref // because of link on "older entries". - && ( wrefCat == null || ! wrefCat.equals("@month") ) ) { + && ( wrefCat == null || wrefCat.equals("@single") ) ) { targetFile = targetStdDir + esum.date + "-" + esum.doSinglePage + ".html"; } } |