[MKDoc-commit] [1.6] modifiers to allow template designers to use

bruno at mkdoc.demon.co.uk bruno at mkdoc.demon.co.uk
Fri Nov 18 15:04:19 GMT 2005


Log Message:
-----------
[1.6] modifiers to allow template designers to use MKDoc::Text::Structured

Tags:
----
mkdoc-1-6

Modified Files:
--------------
    mkd/flo:
        Object.pm

-------------- next part --------------
Index: Object.pm
===================================================================
RCS file: /var/spool/cvs/mkd/flo/Attic/Object.pm,v
retrieving revision 1.4.2.5
retrieving revision 1.4.2.6
diff -Lflo/Object.pm -Lflo/Object.pm -u -r1.4.2.5 -r1.4.2.6
--- flo/Object.pm
+++ flo/Object.pm
@@ -31,6 +31,7 @@
 use MKDoc::Config;
 use strict;
 use CGI::Carp;
+use MKDoc::Text::Structured;
 
 $Petal::Hash::MODIFIERS->{'config:'} = sub {
     my $hash  = shift;
@@ -38,6 +39,53 @@
     return MKDoc::Config->$key();
 };
 
+=pod
+
+Convert plain text into html using L<MKDoc::Text::Structured> and
+L<MKDoc::Text::Structured::Inline>.
+
+The as_html_entities: modifier will add smartquotes and convert simple ascii
+constructs such as (c) to their rich text equivalents.
+
+  <title petal:content="structure as_html_entities: title">Document Title</title>
+
+=cut
+
+$Petal::Hash::MODIFIERS->{'as_html_entities:'} = sub {
+    my $hash  = shift;
+    my $key   = shift;
+    return MKDoc::Text::Structured::Inline::process_entities_only ($hash->{$key});
+};
+
+=pod
+
+The as_html_inline: modifier will do the same, but will also add inline tags
+such as strong or abbr.
+
+  <h1 petal:content="structure as_html_inline: title">Document Title</h1>
+
+=cut
+
+$Petal::Hash::MODIFIERS->{'as_html_inline:'} = sub {
+    my $hash  = shift;
+    my $key   = shift;
+    return MKDoc::Text::Structured::Inline::process ($hash->{$key});
+};
+
+=pod
+
+The as_html_blocks: modifier will do the same, but will add block level
+structures such as paragraph tags, lists etc...
+
+  <div petal:content="structure as_html_blocks: description">Document Decription</div>
+
+=cut
+
+$Petal::Hash::MODIFIERS->{'as_html_blocks:'} = sub {
+    my $hash  = shift;
+    my $key   = shift;
+    return MKDoc::Text::Structured::process ($hash->{$key});
+};
 
 ##
 # $class->config;


More information about the MKDoc-commit mailing list