ruwex 0.1.0

Fast Rust rewrite of wikiextractor: extract and clean text from Wikimedia XML dumps
Documentation
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" version="0.10" xml:lang="en">
  <siteinfo>
    <sitename>Wikipedia</sitename>
    <base>https://en.wikipedia.org/wiki/Main_Page</base>
    <namespaces>
      <namespace key="0" />
      <namespace key="1">Talk</namespace>
      <namespace key="10">Template</namespace>
    </namespaces>
  </siteinfo>
  <page>
    <title>Anarchism</title>
    <ns>0</ns>
    <id>12</id>
    <revision>
      <id>1001</id>
      <text>{{Infobox political ideology
| name = Anarchism
| image = A-anarchy.svg
}}
'''Anarchism''' is a [[political philosophy]] and [[Political movement|movement]] that is skeptical of all justifications for [[authority]].&lt;ref name="def"&gt;{{cite book |last=Smith |title=Anarchy}}&lt;/ref&gt; It calls for ''voluntary'' associations and '''''mutual aid'''''.

== Etymology ==
The word comes from {{lang-grc|ἀναρχία|anarkhia}}, meaning "without a ruler".&lt;ref&gt;See dictionary.&lt;/ref&gt; Compare [[wikt:anarchy|anarchy]]s and [[File:Flag.svg|thumb|A [[black flag]] used by anarchists]] symbols.

=== Usage ===
Early usage was pejorative.&lt;br&gt;Later it became neutral. A range of 1&amp;ndash;5 %, or 100&amp;nbsp;km, or &lt;&lt;quoted&gt;&gt; text....... and math: &lt;math&gt;E = mc^2&lt;/math&gt; plus code &lt;code&gt;x = 1&lt;/code&gt;.

== History ==
{| class="wikitable"
! Year !! Event
|-
| 1840 || {{nested|template|inside={{deep|thing}}}} table cell
|}
* First item with [[link]]
* Second item
# Numbered ''thing''
; Definition : term
: Indented line follows here.

An external [https://example.org/path?a=b example site] and bare [https://example.org] and image http://example.com/pic.jpg end.

__NOTOC__
== Empty section ==

== See also ==
* [[List of anarchist movements]]

&lt;gallery&gt;
File:A.jpg|caption one
File:B.jpg|caption two
&lt;/gallery&gt;

&lt;syntaxhighlight lang="python"&gt;
def f(x):
    return x &lt; 2  # comparison
&lt;/syntaxhighlight&gt;

Final paragraph with entity &amp;amp; literal, a {{fake template}} gone, and (parenthetical line).
</text>
    </revision>
  </page>
  <page>
    <title>Talk:Anarchism</title>
    <ns>1</ns>
    <id>13</id>
    <revision>
      <id>1002</id>
      <text>Discussion page content here.</text>
    </revision>
  </page>
  <page>
    <title>Anarchy (disambiguation)</title>
    <ns>0</ns>
    <id>14</id>
    <redirect title="Anarchy" />
    <revision>
      <id>1003</id>
      <text>#REDIRECT [[Anarchy]] {{R from ambiguous}}</text>
    </revision>
  </page>
  <page>
    <title>Beta</title>
    <ns>0</ns>
    <id>15</id>
    <revision>
      <id>1004</id>
      <text>Beta is the second letter. See [[Alpha]], [[Gamma|the third]], [[Category:Greek letters]] and [[:File:Beta.svg|an image link]] and [[w:Beta|wiki beta]].

A line with     multiple   spaces, a tab&#9;here, double,, commas and ,. mix.

&lt;div class="x"&gt;Inside a div block that spans
multiple lines&lt;/div&gt;
&lt;span style="y"&gt;span kept content&lt;/span&gt; after span.
&lt;!-- a comment
spanning lines --&gt; visible after comment.
&lt;ref name="a"/&gt; self closing ref gone. &lt;nowiki/&gt; also.
&lt;small&gt;small text dropped entirely&lt;/small&gt; tail kept.
&lt;sub&gt;sub kept&lt;/sub&gt; and &lt;sup&gt;sup kept&lt;/sup&gt;.
&lt;timeline&gt;whole timeline dropped&lt;/timeline&gt; tail stays.
</text>
    </revision>
  </page>
  <page>
    <title>Gamma</title>
    <ns>0</ns>
    <id>16</id>
    <revision>
      <id>1005</id>
      <text>{{Greet|name=World}} and {{Greet}} and {{Wrap|Bob}}.

Centuries: {{Century|year=1999}} and {{Century|year=2001}}.

Inc gives {{Inc|payload}} and Only gives {{Only}}.

Redirected: {{Redir|name=Via redirect}} Loop: {{Loop}} Ppp: {{Ppp|p=q|q=r}}
</text>
    </revision>
  </page>
  <page>
    <title>Template:Greet</title>
    <ns>10</ns>
    <id>101</id>
    <revision>
      <id>2001</id>
      <text>Hello '''{{{name|stranger}}}'''{{#if:{{{punct|}}}|{{{punct}}}|!}}</text>
    </revision>
  </page>
  <page>
    <title>Template:Wrap</title>
    <ns>10</ns>
    <id>102</id>
    <revision>
      <id>2002</id>
      <text>({{Greet|name={{{1}}}}})</text>
    </revision>
  </page>
  <page>
    <title>Template:Century</title>
    <ns>10</ns>
    <id>103</id>
    <revision>
      <id>2003</id>
      <text>{{#expr:({{{year}}}-1)//100+1}}</text>
    </revision>
  </page>
  <page>
    <title>Template:Inc</title>
    <ns>10</ns>
    <id>104</id>
    <revision>
      <id>2004</id>
      <text>&lt;noinclude&gt;Documentation {{Greet}}&lt;/noinclude&gt;&lt;includeonly&gt;included {{{1|}}}&lt;/includeonly&gt;</text>
    </revision>
  </page>
  <page>
    <title>Template:Only</title>
    <ns>10</ns>
    <id>105</id>
    <revision>
      <id>2005</id>
      <text>before&lt;onlyinclude&gt;ONLY&lt;/onlyinclude&gt;middle&lt;onlyinclude&gt;-THIS&lt;/onlyinclude&gt;after</text>
    </revision>
  </page>
  <page>
    <title>Template:Redir</title>
    <ns>10</ns>
    <id>106</id>
    <revision>
      <id>2006</id>
      <text>#REDIRECT [[Template:Greet]]</text>
    </revision>
  </page>
  <page>
    <title>Template:Loop</title>
    <ns>10</ns>
    <id>107</id>
    <revision>
      <id>2007</id>
      <text>x{{Loop}}</text>
    </revision>
  </page>
  <page>
    <title>Template:Ppp</title>
    <ns>10</ns>
    <id>108</id>
    <revision>
      <id>2008</id>
      <text>{{{{{{p}}}}}}</text>
    </revision>
  </page>
</mediawiki>