1
0
Fork 0

Behold my XHTML strictness

master
neingeist 19 years ago
parent 5243687d8f
commit cc9b45baec

@ -295,21 +295,21 @@ Licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/2
<h1>Neinomaten == Wikibots</h1> <h1>Neinomaten == Wikibots</h1>
<pre> <pre>
<font color="#a520f7">#!/usr/bin/env ruby</font> <span class="vim-control">#!/usr/bin/env ruby</span>
<font color="#a520f7">require</font> <font color="#6b59ce">'</font><font color="#ff00ff">mediawikibot</font><font color="#6b59ce">'</font> <span class="vim-control">require</span> <span class="vim-quote">'</span><span class="vim-constant">mediawikibot</span><span class="vim-quote">'</span>
<font color="#a52829"><b>if</b></font> <font color="#008a8c">ARGV</font>.size() != <font color="#ff00ff">2</font> <span class="vim-statement"><b>if</b></span> <span class="vim-var">ARGV</span>.size() != <span class="vim-constant">2</span>
<font color="#008a8c">$stderr</font>.print(<font color="#008a8c">$0</font> + <font color="#6b59ce">&quot;</font><font color="#ff00ff"> &lt;wiki-user&gt; &lt;wiki-password&gt;</font><font color="#6b59ce">\n</font><font color="#6b59ce">&quot;</font>) <span class="vim-var">$stderr</span>.print(<span class="vim-var">$0</span> + <span class="vim-quote">&quot;</span><span class="vim-constant"> &lt;wiki-user&gt; &lt;wiki-password&gt;</span><span class="vim-quote">\n</span><span class="vim-quote">&quot;</span>)
<font color="#a52829"><b>exit</b></font>(<font color="#ff00ff">1</font>) <span class="vim-statement"><b>exit</b></span>(<span class="vim-constant">1</span>)
<font color="#a52829"><b>end</b></font> <span class="vim-statement"><b>end</b></span>
b = <font color="#008a8c">MediaWikiBot</font>::<font color="#008a8c">WikiBot</font>.new(<font color="#6b59ce">&quot;</font><font color="#ff00ff"><a href="http://entropia.de/wiki/">http://entropia.de/wiki/</a></font><font color="#6b59ce">&quot;</font>) b = <span class="vim-var">MediaWikiBot</span>::<span class="vim-var">WikiBot</span>.new(<span class="vim-quote">&quot;</span><span class="vim-constant"><a href="http://entropia.de/wiki/">http://entropia.de/wiki/</a></span><span class="vim-quote">&quot;</span>)
b.login(<font color="#008a8c">ARGV</font>[<font color="#ff00ff">0</font>], <font color="#008a8c">ARGV</font>[<font color="#ff00ff">1</font>]) b.login(<span class="vim-var">ARGV</span>[<span class="vim-constant">0</span>], <span class="vim-var">ARGV</span>[<span class="vim-constant">1</span>])
old = b.get_raw(<font color="#6b59ce">&quot;</font><font color="#ff00ff">RoboRally</font><font color="#6b59ce">&quot;</font>) old = b.get_raw(<span class="vim-quote">&quot;</span><span class="vim-constant">RoboRally</span><span class="vim-quote">&quot;</span>)
new = old.gsub(<font color="#6b59ce">/</font><font color="#ff00ff">\[#reg ([^|]*?)\]</font><font color="#6b59ce">/i</font>, new = old.gsub(<span class="vim-quote">/</span><span class="vim-constant">\[#reg ([^|]*?)\]</span><span class="vim-quote">/i</span>,
<font color="#6b59ce">'</font><font color="#ff00ff">[[#Gesperrte Register|\1]]</font><font color="#6b59ce">'</font>) <span class="vim-quote">'</span><span class="vim-constant">[[#Gesperrte Register|\1]]</span><span class="vim-quote">'</span>)
b.edit(<font color="#6b59ce">&quot;</font><font color="#ff00ff">RoboRally</font><font color="#6b59ce">&quot;</font>, new, <font color="#6b59ce">&quot;</font><font color="#ff00ff">Kaputte interne Links repariert</font><font color="#6b59ce">&quot;</font>) b.edit(<span class="vim-quote">&quot;</span><span class="vim-constant">RoboRally</span><span class="vim-quote">&quot;</span>, new, <span class="vim-quote">&quot;</span><span class="vim-constant">Kaputte interne Links repariert</span><span class="vim-quote">&quot;</span>)
</pre> </pre>
</div> <!-- class="slide" --> </div> <!-- class="slide" -->

@ -106,6 +106,13 @@ html>body .external {border-bottom: none;}
img.incremental {visibility: hidden;} img.incremental {visibility: hidden;}
.slide .current {color: #B02;} .slide .current {color: #B02;}
.vim-quote { color: #6b59ce; }
.vim-statement { color: #a52829; }
.vim-constant { color: #ff00ff; }
.vim-control { color: #a520f7; }
.vim-var { color: #008a8c; }
img { border: 0; }
/* diagnostics /* diagnostics

@ -0,0 +1,8 @@
#!/bin/sh
f=$1
perl -pi -e 's!<font color="#6b59ce">(.*?)</font>!<span class="vim-quote">\1</span>!g' $f
perl -pi -e 's!<font color="#a52829">(.*?)</font>!<span class="vim-statement">\1</span>!g' $f
perl -pi -e 's!<font color="#ff00ff">(.*?)</font>!<span class="vim-constant">\1</span>!g' $f
perl -pi -e 's!<font color="#a520f7">(.*?)</font>!<span class="vim-control">\1</span>!g' $f
perl -pi -e 's!<font color="#008a8c">(.*?)</font>!<span class="vim-var">\1</span>!g' $f