svg2-tools: Add <edit:shorttitle/>.

details:   https://svgwg.org/hg/svg2-tools/rev/c442b4de16ac
branches:  
changeset: 77:c442b4de16ac
user:      Cameron McCormack <cam@mcc.id.au>
date:      Sat Apr 06 16:49:30 2013 +1100
description:
Add <edit:shorttitle/>.

diffstat:

 publish/processing.js |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (44 lines):

diff --git a/publish/processing.js b/publish/processing.js
--- a/publish/processing.js
+++ b/publish/processing.js
@@ -661,16 +661,20 @@ function doElementsWithAttributeCategory
 }
 
 function doWhenPublished(conf, page, n) {
   if (conf.maturity != 'ED') {
     return utils.replaceWithChildren(n);
   }
 }
 
+function doShortTitle(conf, page, n) {
+  return utils.replace(n, n.ownerDocument.createTextNode(conf.shortTitle));
+}
+
 exports.processReplacements = function(conf, page, doc) {
   var replacementFunctions = {
     minitoc: doMiniTOC,
     fulltoc: doFullTOC,
     completeidl: doCompleteIDL,
     interface: doInterface,
     example: doExample,
     includefile: doIncludeFile,
@@ -683,17 +687,18 @@ exports.processReplacements = function(c
     previousversion: doPreviousVersion,
     copyright: doCopyright,
     locallink: doLocalLink,
     attributetable: doAttributeTable,
     elementindex: doElementIndex,
     elementcategory: doElementCategory,
     attributecategory: doAttributeCategory,
     elementswithattributecategory: doElementsWithAttributeCategory,
-    whenpublished: doWhenPublished
+    whenpublished: doWhenPublished,
+    shorttitle: doShortTitle
   };
 
   utils.forEachNode(doc, function(n) {
     if (n.nodeType == n.ELEMENT_NODE &&
         n.namespaceURI == namespaces.edit &&
         n.localName != 'with') {
       if (!replacementFunctions[n.localName]) {
         utils.warn('unknown element "edit:' + n.localName + '"', n);

Received on Saturday, 6 April 2013 05:50:05 UTC