From f0df1950493061d294ac0162ff350c1420c28a4c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 24 Jun 2008 20:48:45 -0400 Subject: new txt plugin, was previously contrib/plaintext --- doc/plugins/contrib/plaintext.mdwn | 17 ------------- doc/plugins/contrib/plaintext/discussion.mdwn | 33 -------------------------- doc/plugins/plaintext/.discussion.mdwn.swp | Bin 0 -> 12288 bytes doc/plugins/plaintext/discussion.mdwn | 33 ++++++++++++++++++++++++++ doc/plugins/txt.mdwn | 14 +++++++++++ 5 files changed, 47 insertions(+), 50 deletions(-) delete mode 100644 doc/plugins/contrib/plaintext.mdwn delete mode 100644 doc/plugins/contrib/plaintext/discussion.mdwn create mode 100644 doc/plugins/plaintext/.discussion.mdwn.swp create mode 100644 doc/plugins/plaintext/discussion.mdwn create mode 100644 doc/plugins/txt.mdwn (limited to 'doc') diff --git a/doc/plugins/contrib/plaintext.mdwn b/doc/plugins/contrib/plaintext.mdwn deleted file mode 100644 index 0350bc3ca..000000000 --- a/doc/plugins/contrib/plaintext.mdwn +++ /dev/null @@ -1,17 +0,0 @@ -[[template id=plugin name=plaintext author="[[JeremieKoenig]]"]] -[[tag type/format]] - -I was surprised that no plugin seems to be available to render plaintext pages; -as I need one to implement the "[[todo/preview_changes]]" todo item, -I quickly wrote it. Maybe this can be included in ikiwiki? - -This plugins uses HTML::Entities::encode_entities() on the page's content -and wraps it in a `
`...`
` tag. - -Download from [here](http://www.jk.fr.eu.org/ikiwiki/plaintext.pm). - -## Problems - -Wikilinks are expanded as usual, and as such produce `text` -tags, which are displayed as plain text. Is there a way to disable the preprocessor -for some types of pages? \ No newline at end of file diff --git a/doc/plugins/contrib/plaintext/discussion.mdwn b/doc/plugins/contrib/plaintext/discussion.mdwn deleted file mode 100644 index 6b907e65c..000000000 --- a/doc/plugins/contrib/plaintext/discussion.mdwn +++ /dev/null @@ -1,33 +0,0 @@ -I guess the reason I never thought to write this is when I put a .txt file -in ikiwiki, I'm happy enough to see it copied through unchanged. - -I guess the advantage of using this plugin is that you get the page wrapper -around the preformatted text, and could even inline such a page. - -There is not currently a good way to turn off some processing steps for -some page types. It's either all or nothing. The patch in -[[todo/format_escape]] might allow a formatter to register its own special -version of htmllink that didn't do anything, but would that be enough? - ---[[Joey]] - -[Here](http://www.gmcmanus.org/plaintext.pm) is an alternate approach. -It encodes entities using a filter hook, before wikilinks are linkified. -So wikilinks turn up as links. -It also uses URI::Find to turn URIs into links. - -I'm not very familiar with Perl, so this code could be improved. - ---Gabriel - -I like this approach! It sidesteps the annoying problem, and it actually -makes the .txt format genuinely wiki-like, by allowing wikilinks and -preprocessor directices. - -The only thing I am not sure about is the conversion of external urls to -hyperlinks. - -Can you please add a copyright/license statemnt to the top of the plugin? -If you do, I'll add it to ikiwiki. Thanks! --[[Joey]] - -> I've added copyright and license (GPLv2 or later). --Gabriel diff --git a/doc/plugins/plaintext/.discussion.mdwn.swp b/doc/plugins/plaintext/.discussion.mdwn.swp new file mode 100644 index 000000000..df2347f9e Binary files /dev/null and b/doc/plugins/plaintext/.discussion.mdwn.swp differ diff --git a/doc/plugins/plaintext/discussion.mdwn b/doc/plugins/plaintext/discussion.mdwn new file mode 100644 index 000000000..6b907e65c --- /dev/null +++ b/doc/plugins/plaintext/discussion.mdwn @@ -0,0 +1,33 @@ +I guess the reason I never thought to write this is when I put a .txt file +in ikiwiki, I'm happy enough to see it copied through unchanged. + +I guess the advantage of using this plugin is that you get the page wrapper +around the preformatted text, and could even inline such a page. + +There is not currently a good way to turn off some processing steps for +some page types. It's either all or nothing. The patch in +[[todo/format_escape]] might allow a formatter to register its own special +version of htmllink that didn't do anything, but would that be enough? + +--[[Joey]] + +[Here](http://www.gmcmanus.org/plaintext.pm) is an alternate approach. +It encodes entities using a filter hook, before wikilinks are linkified. +So wikilinks turn up as links. +It also uses URI::Find to turn URIs into links. + +I'm not very familiar with Perl, so this code could be improved. + +--Gabriel + +I like this approach! It sidesteps the annoying problem, and it actually +makes the .txt format genuinely wiki-like, by allowing wikilinks and +preprocessor directices. + +The only thing I am not sure about is the conversion of external urls to +hyperlinks. + +Can you please add a copyright/license statemnt to the top of the plugin? +If you do, I'll add it to ikiwiki. Thanks! --[[Joey]] + +> I've added copyright and license (GPLv2 or later). --Gabriel diff --git a/doc/plugins/txt.mdwn b/doc/plugins/txt.mdwn new file mode 100644 index 000000000..8d8cb55c2 --- /dev/null +++ b/doc/plugins/txt.mdwn @@ -0,0 +1,14 @@ +[[template id=plugin name=txt author="[[Gabriel]]"]] +[[tag type/format]] + +This plugin makes ikiwiki treat files with names ending in ".txt" +as wiki pages. + +Unlike other [[type/format]] plugins, no formatting of markup in +txt files is done; the file contents is displayed to the user as-is, +with html markup characters such as ">" escaped. + +The only exceptions are that [[WikiLinks|WikiLink]] and +[[PreprocessorDirectives|PreprocessorDirective]] are still expanded by +ikiwiki, and that, if the [[cpan URI::Find]] perl module is installed, URLs +in the txt file are converted to hyperlinks. -- cgit v1.2.3