OpenWetWare:Dewikify/Demo: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
----
----


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)
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). This is because if the wikionly tag surrounds the line (nothing else is on the line, the entire line is removed including the extra newline.


# Item 1
# Item 1
Line 29: Line 29:
# Item 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.
Note that this is different from the previous as one of the list numbers is completely skipped. In this case, the wikionly tags aren't the only thing on the line so the newline remains and there is an empty list element. But because MediaWiki doesn't show the items for which there is no text, we skip a number. If we want to force the number with nothing next to it, add a non-blanking space:
 
# Item 1
#<wikionly>Item 2</wikionly>
# Item 3
#<nonwikionly>Item 4</nonwikionly>
# 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:


# Item 1
# Item 1
Line 47: Line 39:
----
----


<wikionly>'''This text is bold on wiki and italic on static page'''</wikionly>
<wikionly>'</wikionly>''This text is bold on wiki and italic on static page''<wikionly>'</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.
In this example, we show how the wikionly tags are a kind of pre-processor, as an extra quote is added on the wiki only which converts it from italic to bold.

Latest revision as of 16:24, 19 January 2006

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). This is because if the wikionly tag surrounds the line (nothing else is on the line, the entire line is removed including the extra newline.

  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

Note that this is different from the previous as one of the list numbers is completely skipped. In this case, the wikionly tags aren't the only thing on the line so the newline remains and there is an empty list element. But because MediaWiki doesn't show the items for which there is no text, we skip a number. 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>'</wikionly>This text is bold on wiki and italic on static page<wikionly>'</wikionly>

In this example, we show how the wikionly tags are a kind of pre-processor, as an extra quote is added on the wiki only which converts it from italic to bold.