/[drupal]/contributions/modules/marksmarty/marksmarty.module
ViewVC logotype

Diff of /contributions/modules/marksmarty/marksmarty.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.20, Tue Jan 22 21:57:25 2008 UTC revision 1.21, Tue Jan 22 22:25:27 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: marksmarty.module,v 1.19 2008/01/22 21:19:06 weitzman Exp $  // $Id: marksmarty.module,v 1.20 2008/01/22 21:57:25 weitzman Exp $
3    
4  /********************************************************************  /********************************************************************
5   * Drupal Hooks   * Drupal Hooks
# Line 24  function marksmarty_filter($op, $delta = Line 24  function marksmarty_filter($op, $delta =
24    }    }
25  }  }
26    
27    function marksmarty_block($op = 'list', $delta = 0, $edit = array()) {
28      if ($op == 'list') {
29        $blocks[0] = array('info' => t('Marksmarty Filter Tips'));
30        return $blocks;
31      }
32      else if ($op == 'view') {
33        switch($delta) {
34          case 0:
35            $block = array('subject' => t('Title of block #1'),
36                           'content' => marksmarty_display_block_1());
37            break;
38        }
39        return $block;
40      }
41    }
42    
43    function marksmarty_display_block_1(){
44      $content = <<<END_MARKSMARTY_BLOCK
45    <pre>
46    ## Header 2 ##
47    ### Header 3 ###
48    #### Header 4 ####
49    ##### Header 5 #####
50    (Hashes on right are optional)
51    
52    Link [Drupal](http://drupal.org)
53    
54    Inline markup like _italics_,
55     **bold**, and `code()`.
56    
57    > Blockquote. Like email replies
58    >> And, they can be nested
59    
60    * Bullet lists are easy too
61    - Another one
62    + Another one
63    
64    1. A numbered list
65    2. Which is numbered
66    3. With periods and a space
67    
68    And now some code:
69        // Code is indented text
70        is_easy() to_remember();
71                                </pre>
72    END_MARKSMARTY_BLOCK;
73    
74      return $content;
75    
76    }
77    
78  function marksmarty_filter_tips($delta = 0, $format = -1, $long) {  function marksmarty_filter_tips($delta = 0, $format = -1, $long) {
79    if ($long) {    if ($long) {
80      $the_output = t('Quick Tips:<ul>      $the_output = t('Quick Tips:<ul>

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.2