From b31e8c08260b0da95014caea078f3155d4707e28 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jan 2008 01:05:54 -0500 Subject: * 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. --- IkiWiki/Plugin/meta.pm | 21 ++++++++++- debian/changelog | 8 ++++ doc/plugins/meta.mdwn | 4 +- .../integrated_issue_tracking_with_ikiwiki.mdwn | 6 ++- templates/atomitem.tmpl | 43 ++++++++++++++++------ 5 files changed, 64 insertions(+), 18 deletions(-) diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 987262a48..88c942fa4 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -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!^

!!; + $text=~s!

$!!; + chomp $text; + + return $text; +} + 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})) { - $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})) { - $template->param(copyright => IkiWiki::linkify($page, $destpage, $copyright{$page})); + $template->param(copyright => htmlize($page, $destpage, $copyright{$page})); } } # }}} diff --git a/debian/changelog b/debian/changelog index 51dcaf8af..d5117d867 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 diff --git a/doc/plugins/meta.mdwn b/doc/plugins/meta.mdwn index 479d62c43..ec4348e41 100644 --- a/doc/plugins/meta.mdwn +++ b/doc/plugins/meta.mdwn @@ -27,12 +27,12 @@ Supported fields: * 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 - Joey Hess". Can contain WikiLinks. + Joey Hess". Can contain WikiLinks and arbitrary markup. * author diff --git a/doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn b/doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn index fcec5cb56..332b86bac 100644 --- a/doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn +++ b/doc/tips/integrated_issue_tracking_with_ikiwiki.mdwn @@ -1,12 +1,14 @@ [[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 , 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. """]] +[[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 diff --git a/templates/atomitem.tmpl b/templates/atomitem.tmpl index 4dc2d07d6..1b1d686dd 100644 --- a/templates/atomitem.tmpl +++ b/templates/atomitem.tmpl @@ -1,25 +1,44 @@ <TMPL_VAR TITLE> + + - + + + + +
+ + + + + + +
+
+ + +
+ +
+
+
- - - - - + + + - + - -
- -
-
+ +
+ +
+
-- cgit v1.2.3