[Bps-public-commit] wifty branch, master, updated. 7943ee80731022b101abb303c2887bf725160383

Thomas Sibley trs at bestpractical.com
Tue Jun 29 17:05:04 EDT 2010


The branch, master has been updated
       via  7943ee80731022b101abb303c2887bf725160383 (commit)
      from  c4adc533b5a554792e20450c2ea7c55059222e6e (commit)

Summary of changes:
 lib/Wifty/View.pm |  104 +++++++++++++++++++++++++++++------------------------
 1 files changed, 57 insertions(+), 47 deletions(-)

- Log -----------------------------------------------------------------
commit 7943ee80731022b101abb303c2887bf725160383
Author: Thomas Sibley <tom at zulutango.org>
Date:   Tue Jun 29 17:06:10 2010 -0400

    Link to the Kwiki formatting rules when applicable

diff --git a/lib/Wifty/View.pm b/lib/Wifty/View.pm
index 4af28d8..130325e 100644
--- a/lib/Wifty/View.pm
+++ b/lib/Wifty/View.pm
@@ -161,74 +161,84 @@ private template 'search_box' => sub {
 };
 
 private template markup => sub {
-    return undef unless Jifty->config->app('Formatter') eq 'Markdown';
-
-    div {{ id is 'syntax' }
-        div {
-            a {{
-                href    is "#",
-                onclick is 'jQuery("syntax_content").toggle();return(false);'
-            } b {_('Wiki Syntax Help')} }
+    my $formatter = Jifty->config->app('Formatter');
+
+    if ( $formatter eq 'Kwiki' ) {
+        div {{ id is 'syntax' }
+            hyperlink(
+                label => 'Kwiki Formatting Rules',
+                url   => 'http://www.kwiki.org/?KwikiFormattingRules'
+            );
         };
-        div {{ id is 'syntax_content' }
-            h3   {'Phrase Emphasis'};
-            code {
-                b {'**bold**'; };
-                i {'_italic_'};
+    }
+    elsif ( $formatter eq 'Markdown' ) {
+        div {{ id is 'syntax' }
+            div {
+                a {{
+                    href    is "#",
+                    onclick is 'jQuery("syntax_content").toggle();return(false);'
+                } b {_('Wiki Syntax Help')} }
             };
+            div {{ id is 'syntax_content' }
+                h3   {'Phrase Emphasis'};
+                code {
+                    b {'**bold**'; };
+                    i {'_italic_'};
+                };
 
-            h3 {'Links'};
+                h3 {'Links'};
 
-            code {'Show me a [wiki page](WikiPage)'};
-            code {'An [example](http://url.com/ "Title")'};
+                code {'Show me a [wiki page](WikiPage)'};
+                code {'An [example](http://url.com/ "Title")'};
 
-            h3 {'Headers'};
+                h3 {'Headers'};
 
-            code { pre { join "\n",
-                '# Header 1', '## Header 1', '###### Header 6'
-            } };
+                code { pre { join "\n",
+                    '# Header 1', '## Header 1', '###### Header 6'
+                } };
 
-            h3 {'Lists'};
+                h3 {'Lists'};
 
-            p {'Ordered, without paragraphs:'};
+                p {'Ordered, without paragraphs:'};
 
-            code { pre { join "\n", '1. Foo', '2. Bar' } };
+                code { pre { join "\n", '1. Foo', '2. Bar' } };
 
-            p {'Unordered, with paragraphs:'};
+                p {'Unordered, with paragraphs:'};
 
-            code { pre { join "\n",
-                '*   A list item.', 
-                'With multiple paragraphs.',
-                '*   Bar',
-            } };
+                code { pre { join "\n",
+                    '*   A list item.', 
+                    'With multiple paragraphs.',
+                    '*   Bar',
+                } };
 
-            h3 {'Code Spans'};
+                h3 {'Code Spans'};
 
-            p { code {'`<code>`'}; outs(' - spans are delimited by backticks') };
+                p { code {'`<code>`'}; outs(' - spans are delimited by backticks') };
 
-            h3 {'Preformatted Code Blocks'};
+                h3 {'Preformatted Code Blocks'};
 
-            p {'Indent every line of a code block by at least 4 spaces.'};
+                p {'Indent every line of a code block by at least 4 spaces.'};
 
-            code {
-                pre {
-                    'This is a normal paragraph.' . "\n\n" . "\n"
-                        . '    This is a preformatted' . "\n"
-                        . '    code block.';
+                code {
+                    pre {
+                        'This is a normal paragraph.' . "\n\n" . "\n"
+                            . '    This is a preformatted' . "\n"
+                            . '    code block.';
+                    };
                 };
-            };
 
-            h3 {'Horizontal Rules'};
+                h3 {'Horizontal Rules'};
 
-            p {
-                outs('Three or more dashes: '); code {'---'};
-            };
+                p {
+                    outs('Three or more dashes: '); code {'---'};
+                };
 
-            address {
-                outs_raw '(Thanks to <a href="http://daringfireball.net/projects/markdown/dingus">Daring Fireball</a>)';
-            }
+                address {
+                    outs_raw '(Thanks to <a href="http://daringfireball.net/projects/markdown/dingus">Daring Fireball</a>)';
+                }
+            };
+            script { outs_raw 'jQuery("syntax_content").toggle();' };
         };
-        script { outs_raw 'jQuery("syntax_content").toggle();' };
     };
 };
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list