]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* inline: Add copyright/license info on a per-post basis to atom
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 9 Jan 2008 06:05:54 +0000 (01:05 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 9 Jan 2008 06:05:54 +0000 (01:05 -0500)
  feeds if available. (rss doesn't allow such info on a per-post basis)
* meta: Allow copyright/license metadata to contain arbitrary markup.

IkiWiki/Plugin/meta.pm
debian/changelog
doc/plugins/meta.mdwn
doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn
templates/atomitem.tmpl

index 987262a48c6961bed98b480e5466614b0588d5dc..88c942fa4f85ba2664eb9756e60421ee22aacc44 100644 (file)
@@ -43,6 +43,23 @@ sub scrub ($) { #{{{
        }
 } #}}}
 
        }
 } #}}}
 
+sub htmlize ($$$) { #{{{
+       my $page = shift;
+       my $destpage = shift;
+       my $text = shift;
+
+       $text=IkiWiki::htmlize($page, pagetype($pagesources{$page}),
+               IkiWiki::linkify($page, $destpage,
+               IkiWiki::preprocess($page, $destpage, $text)));
+
+       # hack to get rid of enclosing junk added by markdown
+       $text=~s!^<p>!!;
+       $text=~s!</p>$!!;
+       chomp $text;
+
+       return $text;
+}
+
 sub preprocess (@) { #{{{
        return "" unless @_;
        my %params=@_;
 sub preprocess (@) { #{{{
        return "" unless @_;
        my %params=@_;
@@ -193,12 +210,12 @@ sub pagetemplate (@) { #{{{
        if (exists $license{$page} && $template->query(name => "license") &&
            ($page eq $destpage || ! exists $license{$destpage} ||
             $license{$page} ne $license{$destpage})) {
        if (exists $license{$page} && $template->query(name => "license") &&
            ($page eq $destpage || ! exists $license{$destpage} ||
             $license{$page} ne $license{$destpage})) {
-               $template->param(license => IkiWiki::linkify($page, $destpage, $license{$page}));
+               $template->param(license => htmlize($page, $destpage, $license{$page}));
        }
        if (exists $copyright{$page} && $template->query(name => "copyright") &&
            ($page eq $destpage || ! exists $copyright{$destpage} ||
             $copyright{$page} ne $copyright{$destpage})) {
        }
        if (exists $copyright{$page} && $template->query(name => "copyright") &&
            ($page eq $destpage || ! exists $copyright{$destpage} ||
             $copyright{$page} ne $copyright{$destpage})) {
-               $template->param(copyright => IkiWiki::linkify($page, $destpage, $copyright{$page}));
+               $template->param(copyright => htmlize($page, $destpage, $copyright{$page}));
        }
 } # }}}
 
        }
 } # }}}
 
index 51dcaf8af52f3fa3b7ce01049ce143bebf20af12..d5117d867d1915226e870f096a49a9ea49ea8a55 100644 (file)
@@ -1,3 +1,11 @@
+ikiwiki (2.20) UNRELEASED; urgency=low
+
+  * inline: Add copyright/license info on a per-post basis to atom
+    feeds if available. (rss doesn't allow such info on a per-post basis)
+  * meta: Allow copyright/license metadata to contain arbitrary markup.
+
+ -- Joey Hess <joeyh@debian.org>  Wed, 09 Jan 2008 00:34:46 -0500
+
 ikiwiki (2.19) unstable; urgency=low
 
   * Only try postsignin if no other action matched. Fixes a bug where the
 ikiwiki (2.19) unstable; urgency=low
 
   * Only try postsignin if no other action matched. Fixes a bug where the
index 479d62c434034262e000a01f843079b49a2d89e8..ec4348e4132d2fc67917cf6db9b18e79b6c120a9 100644 (file)
@@ -27,12 +27,12 @@ Supported fields:
 * license
 
   Specifies a license for the page, for example, "GPL". Can contain
 * license
 
   Specifies a license for the page, for example, "GPL". Can contain
-  WikiLinks.
+  WikiLinks and arbitrary markup.
 
 * copyright
 
   Specifies the copyright of the page, for example, "Copyright 2007 by
 
 * copyright
 
   Specifies the copyright of the page, for example, "Copyright 2007 by
-  Joey Hess". Can contain WikiLinks.
+  Joey Hess". Can contain WikiLinks and arbitrary markup.
 
 * author
 
 
 * author
 
index fcec5cb56bca5c913c557aa7a2c679d1aea5f039..332b86bac1228ad1e04b850c5a937f66c7b38628 100644 (file)
@@ -1,12 +1,14 @@
 [[meta title="Integrated issue tracking with Ikiwiki"]]
 
 [[meta title="Integrated issue tracking with Ikiwiki"]]
 
-By Joey Hess, LinuxWorld.com
+[[meta author="Joey Hess, LinuxWorld.com"]]
 
 
-[[template id=note text="""
+[[meta copyright="""
+© 2007 Joey Hess <joeyh@ikiwiki.info>, LinuxWorld.com  
 [First published](http://www.linuxworld.com/news/2007/040607-integrated-issue-tracking-ikiwiki.html)
 on [LinuxWorld.com](http://www.linuxworld.com/), a publication of Network
 World Inc., 118 Turnpike Rd., Southboro, MA 01772.
 """]]
 [First published](http://www.linuxworld.com/news/2007/040607-integrated-issue-tracking-ikiwiki.html)
 on [LinuxWorld.com](http://www.linuxworld.com/), a publication of Network
 World Inc., 118 Turnpike Rd., Southboro, MA 01772.
 """]]
+[[meta license="[[GPL|freesoftware]]"]]
 
 Wikis are not just for encyclopedias and websites anymore. You can use
 Ikiwiki in combination with your revision control system to handle issue
 
 Wikis are not just for encyclopedias and websites anymore. You can use
 Ikiwiki in combination with your revision control system to handle issue
index 4dc2d07d6d1d8bfd726427253d4b8772841e442f..1b1d686dddebb0d830e1c32e2c203cf5c03469ff 100644 (file)
@@ -1,25 +1,44 @@
 <entry>
        <title><TMPL_VAR TITLE></title>
 <entry>
        <title><TMPL_VAR TITLE></title>
+       <id><TMPL_VAR URL></id>
+       <link href="<TMPL_VAR PERMALINK>"/>
        <TMPL_IF NAME="AUTHOR">
        <TMPL_IF NAME="AUTHOR">
-       <author><TMPL_VAR AUTHOR ESCAPE=HTML></author>
+        <author><name><TMPL_VAR AUTHOR ESCAPE=HTML></name></author>
+       </TMPL_IF>
+       <TMPL_IF NAME="COPYRIGHT">
+        <rights type="xhtml" xml:lang="en">
+         <div xmlns="http://www.w3.org/1999/xhtml">
+          <TMPL_IF NAME="LICENSE">
+           <TMPL_VAR LICENSE>
+           <TMPL_VAR COPYRIGHT>
+          <TMPL_ELSE>
+           <TMPL_VAR COPYRIGHT>
+          </TMPL_IF>
+         </div>
+        </rights>
        <TMPL_ELSE>
        <TMPL_ELSE>
+        <TMPL_IF NAME="LICENSE">
+         <rights type="xhtml" xml:lang="en">
+          <div xmlns="http://www.w3.org/1999/xhtml">
+           <TMPL_VAR LICENSE>
+          </div>
+         </rights>
+        </TMPL_IF>
        </TMPL_IF>
        </TMPL_IF>
-       <id><TMPL_VAR URL></id>
-       <link href="<TMPL_VAR PERMALINK>"/>
        <TMPL_IF NAME="CATEGORIES">
        <TMPL_IF NAME="CATEGORIES">
-       <TMPL_LOOP NAME="CATEGORIES">
-       <category term="<TMPL_VAR CATEGORY>" />
-       </TMPL_LOOP>
+        <TMPL_LOOP NAME="CATEGORIES">
+         <category term="<TMPL_VAR CATEGORY>" />
+        </TMPL_LOOP>
        </TMPL_IF>
        <updated><TMPL_VAR MDATE_3339></updated>
        <published><TMPL_VAR CDATE_3339></published>
        <TMPL_IF NAME="ENCLOSURE">
        </TMPL_IF>
        <updated><TMPL_VAR MDATE_3339></updated>
        <published><TMPL_VAR CDATE_3339></published>
        <TMPL_IF NAME="ENCLOSURE">
-       <link rel="enclosure" type="<TMPL_VAR TYPE>" href="<TMPL_VAR ENCLOSURE>" length="<TMPL_VAR LENGTH>" />
+        <link rel="enclosure" type="<TMPL_VAR TYPE>" href="<TMPL_VAR ENCLOSURE>" length="<TMPL_VAR LENGTH>" />
        <TMPL_ELSE>
        <TMPL_ELSE>
-       <content type="xhtml" xml:lang="en">
-        <div xmlns="http://www.w3.org/1999/xhtml">
-        <TMPL_VAR CONTENT>
-        </div>
-       </content>
+        <content type="xhtml" xml:lang="en">
+         <div xmlns="http://www.w3.org/1999/xhtml">
+         <TMPL_VAR CONTENT>
+         </div>
+        </content>
        </TMPL_IF>
 </entry>
        </TMPL_IF>
 </entry>