Ada Programming $WikiTagline
 

HTML -> PmWiki Convert

A Litte VIM script to help changing HTML Pages into PmWiki Files.

 
:function! MK_Wiki_Html_To_PmWiki ()
   :%substitute /\V”/”/ge
   :%substitute /\V“/“/ge
   :%substitute /\V–/–/ge
   :%substitute /\V"/"/ge
   :%substitute /\V&/&/ge
   :%substitute /\V&lt;/</ge
   :%substitute /\V&gt;/>/ge
   :%substitute /\V<SPAN\.\{-}>//ge
   :%substitute /\V<\/SPAN>//ge   
   :%substitute /\V<CITE\.\{-}>/§f§/ge
   :%substitute /\V<\/CITE>/§§/ge
   :%substitute /\V<KBD\.\{-}>/§b§/ge
   :%substitute /\V<\/KBD>/§§/ge
   :%substitute /\V<STRONG\.\{-}>/§k§/ge
   :%substitute /\V<\/STRONG>/§§/ge
   :%substitute /\V<I.\{-}>/§p§/ge
   :%substitute /\V<\/I>/§§/ge
   :%substitute /\V<VAR\.\{-}>/§n§/ge
   :%substitute /\V<\/VAR>/§§/ge
   :%substitute /\V<CODE\.\{-}>/§c§/ge
   :%substitute /\V<\/CODE>/§§/ge
   :%substitute /\V<SAMP\.\{-}>/§x§/ge
   :%substitute /\V<\/SAMP>/§§/ge
   :%substitute /\V<\/DD><DT>//ge
   :%substitute /\V<UL\.\{-}>//ge
   :%substitute /\V<\/UL>//ge
   :%substitute /\V\s\*<LI>/* /ge
   :%substitute /\V<H1\.\{-}>/! /ge
   :%substitute /\V<H2\.\{-}>/!! /ge
   :%substitute /\V<H3\.\{-}>/!!! /ge
   :%substitute /\V<H4\.\{-}>/!!!! /ge
   :%substitute /\V<\/H1>//ge
   :%substitute /\V<\/H2>//ge
   :%substitute /\V<\/H3>//ge
   :%substitute /\V<\/H4>//ge
   :%substitute /\V<P\.\{-}>/^M/ge
   :%substitute /\V<\/P>//ge
   :%substitute /\V<A HREF="\(\.\{-1,}\)">\(\.\{-1,}\)<\/A>/[[\1|\2]]/ge 
   :%substitute /\V<A NAME="\(\.\{-1,}\)"><\/A>/[[#\1]]/ge 
:endfunction
 

© 2005 Martin Krischik, Content is available under GNU Free Documentation License.