Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 42eb905

Merged from trunk.

  • Participants
  • Parent commits 3c1fc8a
  • Branches convert-to-Parser-MGC

Comments (0)

Files changed (29)

File perl/modules/XML-Grammar-Fiction/Changes

 Revision history for XML-Grammar-Fiction.
 
+    - Screenplay: fix a colon inside a description that broke the 
+    proto-text. (E.g: "[David turns towards Goliath and says:]").
+
+    * Add the tag-release.pl script to tag a release using svn.berlios.de.
+
+0.1.4       Mon Apr  4 00:50:07 IDT 2011
     * ::Screenplay - Fix the innerdesc on the start of the line in the middle 
     of the paragraph. Like:
 
         - they cancelled each other most of the time except for in this 
         case.
 
-        - Screenplay: fix a colon inside a description that broke the 
-        proto-text. (E.g: "[David turns towards Goliath and says:]").
+    * ::Screenplay - add support for Screenplay-Text's <i> tags which get
+    translated into Screenplay-XML's <italics> tags.
 
 0.1.3       Fri Dec 17 19:38:45 IST 2010
         - Moved some unused source files to the rejects directory.

File perl/modules/XML-Grammar-Fiction/MANIFEST

 rejects/QnD.pm
 rejects/Screenplay_Parser_QnD.pm
 t/00-load.t
+tag-release.pl
 t/app-to-html.t
 t/boilerplate.t
 t/data/docbook/with-internal-description.docbook.xml
 t/screenplay/data/proto-text/with-description.txt
 t/screenplay/data/proto-text/with-dialogue.txt
 t/screenplay/data/proto-text/with-entities.txt
+t/screenplay/data/proto-text/with-i-element-inside-paragraphs.txt
 t/screenplay/data/proto-text/with-internal-description-at-start-of-line.txt
 t/screenplay/data/proto-text/with-internal-description.txt
 t/screenplay/data/proto-text/with-multi-line-comments.txt
 t/screenplay/data/xml/with-description.xml
 t/screenplay/data/xml/with-dialogue.xml
 t/screenplay/data/xml/with-entities.xml
+t/screenplay/data/xml/with-i-element-inside-paragraphs.xml
 t/screenplay/data/xml/with-internal-description-at-start-of-line.xml
 t/screenplay/data/xml/with-internal-description.xml
 t/screenplay/data/xml/with-multi-line-comments.xml

File perl/modules/XML-Grammar-Fiction/extradata/screenplay-xml-to-html.xslt

     </strong>
 </xsl:template>
 
+<xsl:template match="sp:italics">
+    <em class="italics">
+        <xsl:apply-templates />
+    </em>
+</xsl:template>
+
 <xsl:template match="sp:inlinedesc">
     <span class="inlinedesc">[<xsl:apply-templates />]</span>
 </xsl:template>

File perl/modules/XML-Grammar-Fiction/extradata/screenplay-xml.rng

             <text/>
             <ref name="ulink"/>
             <ref name="bold"/>
+            <ref name="italics"/>
         </choice>
     </define>
     <define name="scene">
             <text />
         </element>
     </define>
+    <define name="italics">
+        <element name="sp:italics">
+            <text />
+        </element>
+    </define>
     <define name="ulink">
         <element name="sp:ulink">
                 <attribute name="url">
                     <choice>
                         <text />
                         <ref name="bold"/>
+                        <ref name="italics"/>
                     </choice>
             </zeroOrMore>
         </element>

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head1 SYNOPSIS
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/App/FromProto.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head1 SYNOPSIS
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/App/ToDocBook.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head1 SYNOPSIS
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/App/ToHTML.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head1 SYNOPSIS
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/Base.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head1 METHODS
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/Err.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 use Exception::Class
     (

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head2 new()
 
     return "b";
 }
 
-sub _handle_elem_of_name_i
+sub _italics_tag_name
 {
-    my ($self, $elem) = @_;
-
-    $self->_output_tag_with_childs(
-        {
-            start => ["i"],
-            elem => $elem,
-        }
-    );
-
-    return;
+    return "i";
 }
 
-
 sub _handle_text_start
 {
     my ($self, $elem) = @_;

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Nodes.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 package XML::Grammar::Fiction::FromProto::Node;
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Parser.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head1 AUTHOR
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Parser/LineIterator.pm

 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =head1 SYNOPSIS
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 sub _non_tag_text_unit_consume_regex {
     return qr{(?:\<|^\n?$)}ms;

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Parser/XmlIterator.pm

 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =head1 SYNOPSIS
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/RendererBase.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head2 new()
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/Struct/Tag.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 has 'name' => (is => "rw", isa => "Str");
 has 'line' => (is => "rw", isa => "Int");

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/ToDocBook.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head2 new()
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/ToHTML.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head2 new()
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/FictionBase/TagsTree2XML.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
     return;
 }
 
+sub _handle_elem_of_name_i
+{
+    my ($self, $elem) = @_;
+
+    $self->_output_tag_with_childs(
+        {
+            start => [$self->_italics_tag_name],
+            elem => $elem,
+        }
+    );
+
+    return;
+}
 =head2 meta()
 
 Internal - (to settle pod-coverage.).

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head1 SYNOPSIS
 
 
 =item 2. XML-like tags.
 
-Supported tags are C<< <b> >> for bold tags, C<< <a href="..."> >> for
-hyperlinks, and an empty C<< <br /> >> tag for line-breaks.
+Supported tags are C<< <b> >> for bold text, C<< <i> >> for italics,
+C<< <a href="..."> >> for hyperlinks, and an empty C<< <br /> >> tag for line-breaks.
 
 =item 3. Entities
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/FromProto.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head2 new()
 
     return "bold";
 }
 
+sub _italics_tag_name
+{
+    return "italics";
+}
+
 sub _write_elem
 {
     my ($self, $args) = @_;

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/ToDocBook.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head2 new()
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/ToHTML.pm

 
 =head1 VERSION
 
-Version 0.1.3
+Version 0.1.4
 
 =cut
 
-our $VERSION = '0.1.3';
+our $VERSION = '0.1.4';
 
 =head2 new()
 

File perl/modules/XML-Grammar-Fiction/t/screenplay/data/proto-text/with-i-element-inside-paragraphs.txt

+<s id="top">
+
+<s id="david_and_goliath">
+
+[David and <a href="http://en.wikipedia.org/wiki/Goliath">Goliath</a> are 
+standing by each other.]
+
+David: I will kill you.
+
+Goliath: no way, you little idiot!
+
+David: yes way!
+
+++++: In the name of <a href="http://real-allah.tld/">Allah, the 
+<i>merciful</i>, real merciful</a>, I will show you the power of my sling. 
+
+++: I shall sling you and bing you till infinity.
+
+[David takes his sling.]
+
+Goliath: I'm still <a href="http://wait.tld/">waiting</a>.
+
+David: so you are.
+
+[David puts a stone in his sling and shoots Goliath. He hits.]
+
+</s>
+
+</s>

File perl/modules/XML-Grammar-Fiction/t/screenplay/data/xml/with-i-element-inside-paragraphs.xml

+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE document SYSTEM "screenplay-xml.dtd">
+<document xmlns="http://web-cpan.berlios.de/modules/XML-Grammar-Screenplay/screenplay-xml-0.2/">
+    <head>
+    </head>
+    <body id="index">
+<scene id="top">
+    <scene id="david_and_goliath">
+        <description>
+            <para>
+                David and 
+                <ulink url="http://en.wikipedia.org/wiki/Goliath">Goliath</ulink> 
+                are standing by each other.
+            </para>
+        </description>
+        <saying character="David">
+            <para>
+                I will kill you.
+            </para>
+        </saying>
+        <saying character="Goliath">
+            <para>
+                no way, you little idiot!
+            </para>
+        </saying>
+        <saying character="David">
+            <para>
+                yes way!
+            </para>
+            <para>
+                In the name of <ulink url="http://real-allah.tld/">Allah, the <italics>merciful</italics>, real merciful</ulink>, I will show you the power 
+                of my sling.
+            </para>
+            <para>
+                I shall sling you and bing you till infinity.
+            </para>
+        </saying>
+        <description>
+            <para>
+                David takes his sling.
+            </para>
+        </description>
+    <saying character="Goliath">
+        <para>
+            I'm still <ulink url="http://wait.tld/">waiting</ulink>.
+        </para>
+    </saying>
+    <saying character="David">
+        <para>
+            so you are.
+        </para>
+    </saying>
+    <description>
+        <para>
+            David puts a stone in his sling and shoots Goliath. He hits.
+        </para>
+    </description>
+</scene>
+</scene>
+</body>
+</document>

File perl/modules/XML-Grammar-Fiction/t/screenplay/proto-text-to-xml-using-custom-parser.t

         dialogue-with-several-paragraphs
         with-description
         with-tags-inside-paragraphs
+        with-i-element-inside-paragraphs
         with-internal-description
         with-comments
         with-multi-para-desc

File perl/modules/XML-Grammar-Fiction/tag-release.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use IO::All;
+
+my ($version) = 
+    (map { m{\$VERSION *= *'([^']+)'} ? ($1) : () } 
+    io->file('lib/XML/Grammar/Fiction.pm')->getlines()
+    )
+    ;
+
+if (!defined ($version))
+{
+    die "Version is undefined!";
+}
+
+my $mini_repos_base = 'https://svn.berlios.de/svnroot/repos/web-cpan/XML-Grammar-Fiction';
+
+my @cmd = (
+    "svn", "copy", "-m",
+    "Tagging the XML-Grammar-Fiction release as $version",
+    "$mini_repos_base/trunk",
+    "$mini_repos_base/tags/releases/$version",
+);
+
+print join(" ", map { /\s/ ? qq{"$_"} : $_ } @cmd), "\n";
+exec(@cmd);
+