]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Improve markdown loading. First, try to load it as a properl perl module,
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 10 Aug 2006 04:11:58 +0000 (04:11 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 10 Aug 2006 04:11:58 +0000 (04:11 +0000)
  in case it was installed as one. Then fall back to trying
  /usr/bin/markdown.
* Document in install page how to install markdown, since it has no
  installation procedure in the upstream tarball.

IkiWiki/Plugin/mdwn.pm
debian/changelog
doc/install.mdwn
doc/markdown/discussion.mdwn [deleted file]
doc/plugins/orphans.mdwn
doc/sandbox/foo.wiki

index c1f978ad3b99c2c0cd68c5aa75570725e3db8489..8e037f5de192377018cd81c8f12a10c89d76d9bf 100644 (file)
@@ -10,16 +10,24 @@ sub import { #{{{
        IkiWiki::hook(type => "htmlize", id => "mdwn", call => \&htmlize);
 } # }}}
 
+my $markdown_loaded=0;
 sub htmlize ($) { #{{{
        my $content = shift;
 
-       if (! $INC{"/usr/bin/markdown"}) {
-               # Note: a proper perl module is available in Debian
+       if (! $markdown_loaded) {
+               # Note: This hack to make markdown run as a proper perl
+               # module. A proper perl module is available in Debian
                # for markdown, but not upstream yet.
                no warnings 'once';
                $blosxom::version="is a proper perl module too much to ask?";
                use warnings 'all';
-               do "/usr/bin/markdown" || IkiWiki::error("failed to load /usr/bin/markdown: $!");
+
+               eval q{use Markdown};
+               if ($@) {
+                       do "/usr/bin/markdown" ||
+                               IkiWiki::error("failed to load Markdown.pm perl module ($@) or /usr/bin/markdown ($!)");
+               }
+               $markdown_loaded=1;
                require Encode;
        }
        
index c89500109826362f4c741be6729416b712f33a4a..c83c8bce0bc216b6500b315cd36cece643d75801 100644 (file)
@@ -9,9 +9,13 @@ ikiwiki (1.17) UNRELEASED; urgency=low
   * Remove <br> from end of aggregate preprocessor directive output.
   * Ship ikiwiki executable as ikiwiki.pl in source to avoid issues on
     case-sensative filesystems like OSX.
-  * Display an error message if /usr/bin/markdown can't be loaded.
+  * Improve markdown loading. First, try to load it as a properl perl module,
+    in case it was installed as one. Then fall back to trying
+    /usr/bin/markdown.
+  * Document in install page how to install markdown, since it has no
+    installation procedure in the upstream tarball.
 
- -- Joey Hess <joeyh@debian.org>  Wed,  9 Aug 2006 23:01:02 -0400
+ -- Joey Hess <joeyh@debian.org>  Wed,  9 Aug 2006 23:50:25 -0400
 
 ikiwiki (1.16) unstable; urgency=low
 
index d2b6b8833fd61720bc8f24a7202685032a88895b..49153c0d0067270beb10784ca94f4b7756d75ae9 100644 (file)
@@ -6,6 +6,10 @@ installed, and also uses the following perl modules if available:
 `HTML::Template` `Mail::SendMail` `Time::Duration` `Date::Parse`,
 `HTML::Scrubber`, `RPC::XML`, `XML::Simple`, `XML::Feed`
 
+If you're installing MarkDown by hand, note that it should be installed as
+`Markdown.pm` somewhere in perl's module search path, or alternately as
+`/usr/bin/markdown`. Ikiwiki will find it under either name.
+
 If you want to install from the tarball, you should make sure that the
 required perl modules are installed, then run:
 
diff --git a/doc/markdown/discussion.mdwn b/doc/markdown/discussion.mdwn
deleted file mode 100644 (file)
index dd63f17..0000000
+++ /dev/null
@@ -1 +0,0 @@
-in order to install Markdown, I had to copy the Markdown.pl file to /usr/bin/markdown 
\ No newline at end of file
index 2c4e52a3ff22845fa35fcc357d3532606db3c9ea..4591ebf59f939c742a911b49b5b3f8ff9f8bd51e 100644 (file)
@@ -1,5 +1,5 @@
-This plugin generates a list of possibly orphaned pages -- pages that no other page
-links to.
+This plugin generates a list of possibly orphaned pages -- pages that no
+other page links to.
 
 The optional parameter "pages" can be a [[PageSpec]] specifying the pages
 to check for orphans, default is search them all.
index 7e58da0466e7e00b9b31e6d8231beed59cb5ebfb..e06baad614817932d42b2a31675ebfe5608b4c5b 100644 (file)
@@ -1 +1 @@
-Look ma, this page uses '''wiki''' markup, not MarkDown! :-)
\ No newline at end of file
+Look ma, this page uses '''wiki''' markup, not MarkDown! :-)