OpenWetWare:Dewikify/Demo

From OpenWetWare
Jump to navigationJump to search

This is a demo and a playground for some of the things that can be done with the dewikify script. Feel free to modify this page however you wish. You should edit this page to look at the source that generates this!

<wikionly>You are on the wiki! Go to the dewikified page. </wikionly>

<nonwikionly>You are on the static page! Go to the wiki page or edit it. </nonwikionly>


Lists work. Item 2 only appears on the wiki and item 4 only on the static page, but note that the numbering is always correct (no number skipping)

  1. Item 1

<wikionly># Item 2</wikionly>

  1. Item 3

<nonwikionly># Item 4</nonwikionly>

  1. Item 5

In the above case, the tags surrounded the list markers. Look what happens if they are inside

  1. Item 1
  2. <wikionly>Item 2</wikionly>
  3. Item 3
  4. <nonwikionly>Item 4</nonwikionly>
  5. Item 5

You'll notice something that looks strange, but if you understand how the processing works, it makes sense. If a closing wikionly tag is followed by a newline, the newline is removed also (otherwise the previous list example wouldn't work). What you're getting here after processing is therefore two pound signs together which causes indentation. A simple solution is to simply add a space after the closing tag.

  1. Item 1
  2. <wikionly>Item 2</wikionly>
  3. Item 3
  4. <nonwikionly>Item 4</nonwikionly>
  5. Item 5

Note that this is different from the first list example as one of the list numbers is completely skipped. This is because MediaWiki doesn't show the items for which there is no text. If we want to force the number with nothing next to it, add a non-blanking space:

  1. Item 1
  2. <wikionly>Item 2</wikionly> 
  3. Item 3
  4. <nonwikionly>Item 4</nonwikionly> 
  5. Item 5

<wikionly>This text is bold on wiki and italic on static page</wikionly> <nonwikionly>This text is bold on wiki and italic on static page</nonwikionly>

Note that in this example, cannot simplify by putting one quote within one of the wikionly tags, because that would be splitting a wiki tag into two pieces.