Creating a wiki format with flexifilter

cwgordon7@drupal.org's picture
public
group: Wiki
cwgordon7@drupal.org - Mon, 2008-01-14 02:05

Following the release of the Flexifilter module, I thought I'd mention how this can be used to create a mediawiki-style markup format— and it's completely customizable in that any features can be omitted, altered, or added.

  1. Prepend with </nowiki>.
  2. Append with <nowiki>
  3. Do a chunk grab on </nowiki> and <nowiki>.
    1. Add several pattern-based text replace components:
    2. Replace ''' (three single dashes) with alternating <strong> and </strong>.
    3. Replace '' (two single dashes) with alternating <em> and </em>.
    4. Replace ==== (four equals signs) with alternating <h4> and </h4>
    5. Replace === (three equals signs) with alternating <h3> and </h3>
    6. Replace == (two equals signs) with alternating <h2> and </h2>
    7. Create a chunk grabber on [[ and ]].
      1. Add an IF component within the chunk grabber.
        1. Add the condition "text contains" with the parameter |.
        2. As subcomponents of this IF statement, prepend with <a href="/drupalwikipath/
        3. String replace | with ">.
        4. Append </a>.
      2. Now, outside the if statement, create an IF NOT statement with the same condition.
        1. String replace ~ with \~ (escape the character).
        2. Append ~~.
        3. Add an advanced append. Step 20 should be added to this component.
        4. String replace ~~ with </a>.
        5. Now, outside of the advanced append, prepend with <a href="/drupalwikipath/
        6. String replace ~~ with ">
        7. String replace \~ with ~.