Commits

Anonymous committed 60fba1c

Added the 5th draft of The Enemy.

  • Participants
  • Parent commits bd9a268

Comments (0)

Files changed (6)

 
 lib/docbook/xml/Spark-Pre-Birth-of-a-Modern-Lisp.xml: t2/open-source/projects/Spark/mission/Spark-Pre-Birth-of-a-Modern-Lisp.txt
 	asciidoc --backend=docbook -o $@ $<
+
+t2/humour/TheEnemy/The-Enemy-rev5.html.wml: lib/htmls/The-Enemy-rev5.html-part
+
+lib/htmls/The-Enemy-rev5.html-part: t2/humour/TheEnemy/The-Enemy-Hebrew-rev5.xhtml.gz ./bin/extract-xhtml.pl
+	gunzip < $< | perl ./bin/extract-xhtml.pl -o $@ -
+
+t2/humour/TheEnemy/The-Enemy-English-rev5.html.wml: lib/htmls/The-Enemy-English-rev5.html-part
+
+lib/htmls/The-Enemy-English-rev5.html-part: t2/humour/TheEnemy/The-Enemy-English-rev5.xhtml.gz ./bin/extract-xhtml.pl
+	gunzip < $< | perl ./bin/extract-xhtml.pl -o $@ -

bin/extract-xhtml.pl

+#!/usr/bin/perl 
+
+use strict;
+use warnings;
+
+use XML::LibXML;
+use XML::LibXML::XPathContext;
+use Getopt::Long;
+
+my $out_fn;
+
+GetOptions(
+    "output|o=s" => \$out_fn,
+);
+
+# Input the filename
+my $filename = shift(@ARGV)
+    or die "Give me a filename as a command argument: myscript FILENAME";
+
+# Prepare the objects.
+my $xml = XML::LibXML->new;
+my $root_node = $xml->parse_file($filename);
+my $xpc = XML::LibXML::XPathContext->new($root_node);
+$xpc->registerNs("xhtml", "http://www.w3.org/1999/xhtml");
+
+
+{
+    my ($body_node) = $xpc->findnodes('//xhtml:body');
+
+    my $s = $body_node->toString();
+
+    $s =~ s{\A<body[^>]*>}{}sm;
+    $s =~ s{</body>\z}{};
+
+    $s =~ s{<h1[^>]*>.*?</h1>}{}sm;
+
+=begin Hello
+
+    # It's a kludge
+    $s =~ s{ lang="en"}{}g;
+    $s =~ s{ xml:lang="en"}{}g;
+    $s =~ s{ type="(1|disc)"}{}g;
+    $s =~ s{<hr[^/]*/>}{<hr />}g;
+    $s =~ s{ target="_top"}{}g;
+
+=end Hello
+
+=cut
+
+    open my $out, ">", $out_fn;
+    binmode $out, ":utf8";
+    print {$out} $s;
+    close($out);
+}
+

t2/humour/TheEnemy/The-Enemy-English-rev5.html.wml

+#include '../template.wml'
+#include "xhtml/1.x/std/toc.wml"
+
+<latemp_subject "&quot;The Enemy and How I Helped to Fight it&quot; - Text of
+the English Translation - Fifth Draft" />
+
+<p>
+<b>Written and Translated By:</b> Shlomi Fish
+</p>
+
+<h2* id="toc">Table of Contents</h2*>
+
+<toc />
+
+<div class="story">
+
+#include "htmls/The-Enemy-rev5.html-part"
+
+</div>
+

t2/humour/TheEnemy/The-Enemy-English-rev5.xhtml.gz

Binary file added.

t2/humour/TheEnemy/The-Enemy-Hebrew-rev5.xhtml.gz

Binary file added.

t2/humour/TheEnemy/The-Enemy-rev5.html.wml

+<set-var rtl_layout=1 />
+#include "multi-lang.wml"
+<set-var shlomif_lang="he" />
+
+#include '../template.wml'
+#include "xhtml/1.x/std/toc.wml"
+
+<latemp_subject "האויב ואיך עזרתי להילחם בו" />
+
+<h2* id="toc">תוכן העניינים</h2*>
+
+<toc />
+
+<p><b>מאת:</b> שלומי פיש </p>
+
+#include "htmls/The-Enemy-rev5.html-part"