If you like this site, I would appreciate a gift from my wishlist.
XML-Grammar-Fiction - Markup Languages for Writing Prose
XML-Grammar-Fiction provides Fiction-Text, a lightweight plaintext-based markup language, which can be used to write such fiction as stories, novellas, or possibly even novels. Fiction-Text is in turn converted to Fiction-XML, which is an XML-based grammar (which can be used directly). Fiction-XML, in turn, is translated to such formats as XHTML and DocBook/XML, for rendering by web-browsers, and for conversions to different formats, including PDF.
Also provided is Screenplay-Text and Screenplay-XML which are used for writing screenplays (or scripts), and can be translated to XHTML or to TEI-XML (Text Encoding Initivate)
XML-Grammar-Fiction is part of the Web-CPAN XML-Grammar project that provides several specialised processors for XML grammars for various tasks.
Project Links
For XML-Grammar-Fiction
- XML-Grammar-Fiction on search.cpan.org - download and more information.
- XML-Grammar-Fiction on kobesearch
- Freshmeat.net Record
Licence
XML-Grammar-Fiction is free and open-source software (FOSS) distributed under the MIT/X11 License, a permissive, public-domain-like licence.
Examples
Fiction-Text Examples
-
Distributed Examples- there are some short examples under t/fiction/data/ in the distribution (mostly in English).
-
The Pope Died on Sunday - a story in Hebrew under CC-by-sa.
-
The Enemy and How I Helped to Fight it - the Hebrew version of this story is written in Fiction-Text.
-
The Human Hacking Field Guide - the Hebrew translation was written using Fiction-Text.
Screenplay-Text Examples
-
Distributed Examples- there are some short and silly examples in the t/screenplay/data directory in the distribution.
-
The One with the Fountainhead - original text, but fan fiction of the T.V. show Friends.
-
Humanity - The Movie - all original text and concept. Under the CC-by-sa license.
-
Star Trek - “We The Living Dead” - all original text, but fan fiction of Star Trek.
-
Interviews with Open Source People - several interviews whose original hacky like-XML-but-not-quite source was converted to ScreenplayText and then rendered into XML and XHTML.
-
The Hitchhiker’s Guide to Star Trek - The Next Generation - David T. Lu’s and Mickey McCarter’s old parodical screenplay crosses The Hitchhiker’s Guide to the Galaxy and Star Trek: The Next Generation. It was converted into Screenplay-Text format using a crude perl-5.10.x script and from that translated into XHTML.
-
Selena Mandrake - The Slayer - screenplay for a film in English. Original text, but fan-fiction of “Buffy the Vampire Slayer” and other works of popular culture.
News
2011-05-22: XML-Grammar-Fiction version 0.5.1 is out
There are many improvements in this release. Since the last news item here, there were:
-
New tags - <ol>, <ul>, <li>, <programlisting> and <a href=> (the latter for for hypertext.)
-
Documentation improvement.
-
An XSLT stylesheet to convert Screenplay-Text to TEI .
-
Got rid of the <!DOCTYPE… declaration in the Screenplay-XML output. It made debugging difficult and was not necessary.
-
Add support for numeric entities such as [.
2011-04-05: XML-Grammar-Fiction version 0.1.5 is out
This release has many small bug-fixes and improvements:
-
The handling of a colon (“:”) inside a top-level description in XML-Grammar-Screenplay was fixed.
-
Fixed the handling of an innerdesc on the start of a line in the middle of a paragraph.
-
Add support for <i> tags in XML-Grammar-Screenplay.
Everyone are recommended to upgrade.
2009-11-25: XML-Grammar-Fiction version 0.0.2 was released
XML-Grammar-Fiction was released today, and should be available on CPAN mirrors. This release features several improvements to the code’s internals and automated tests suites. The external behaviour of the code should remain the same, but the code is now much more malleable for future improvements, and there may have been a few accidental fixes.
2009-11-05: XML-Grammar-Fiction version 0.0.1 was released
The first version of XML-Grammar-Fiction (v0.0.1) was unleashed onto the world today. It was written for my own personal use as a writer of Hebrew stories, but I naturally decided to release it as open-source software. As first versions go, this version is rough on the edges, and has hairy internals, and other warts, but still should be usable enough for people who are clueful enough.
Happy NaNoWriMo (National Novel Writing Month) and hopefully XML-Grammar-Fiction will prove of assistance to you for this NaNoWriMo or future ones.
Coverage of XML-Grammar-Fiction
Coverage in Shlomi Fish’s Blogs
Demos
Fiction Demo 1
If we have this sample Fiction-Text document:
<body id="index" lang="en-UK"> <title>David vs. Goliath - Part I</title> <s id="top"> <title>The Top Section</title> <!-- David has Green hair here --> King <a href="http://en.wikipedia.org/wiki/David">David</a> and Goliath were standing by each other. David said unto Goliath: “I will shoot you. I <b>swear</b> I will” <s id="goliath"> <title>Goliath's Response</title> <!-- Goliath has to reply to that. --> Goliath was not amused. He said to David: “Oh, really. <i>David</i>, the red-headed!”. </s> </s> </body>
Then after converting it to XML and then to XHTML we get this:
King David and Goliath were standing by each other.
David said unto Goliath: “I will shoot you. I swear I will”
Screenplay Demo 1
If we have this sample screenplay:
<s id="humanity" title="'Humanity' - The Movie"> [Note: This screenplay was written by <a href="http://www.shlomifish.org/">Shlomi Fish</a>, and is original artwork.] <s id="the-well" title="The Well"> [ The Well is shown. Several women are standing nearby with large pots near them. They are chatting. Three men approach. ] Man #1: OK. Let's move it. Man #2: You know, I heard of a guy called Moses who could move a stone like this all by himself. The Inventor's Voice from outside the frame: That's because he was using the Mosesiom 3000! Man #3: I beg your pardon? [ The Inventor enters the frame with his invention that looks suspiciously like a lever. ] The Inventor: With this ingenious invention one man can move this stone all by himself. Wanna try? Man #1: OK. I'll try. The Inventor: OK. First we tie the stone to the ropes here. [ He ties the stone] The Inventor: Now lift the other hand. Man #1: [After lifting the stone.] Wow, it's so easy, look I can move the stone here [moves it to the left], and here [ moves it to the right]. The Inventor: No! No! Don't misuse it. [The stone falls down on the well, splits into two pieces which both fall down the well. The men are amazed. ] The Inventor: Don't worry, I can get down and tie the ropes to each stone and we can lift it up in a flash... Man #1: I'll get the ropes. Man #2: I'll get the horses. [ They leave the frame ] The Inventor: This is not my day. Woman #1: Who is John Galt? </s> </s>
Then after converting it to XML and then to XHTML we get this:
'Humanity' - The Movie
[ Note: This screenplay was written by Shlomi Fish, and is original artwork. ]
The Well
[ The Well is shown. Several women are standing nearby with large pots near them. They are chatting. Three men approach. ]
[ The Inventor enters the frame with his invention that looks suspiciously like a lever. ]
[ He ties the stone ]
[ The stone falls down on the well, splits into two pieces which both fall down the well. The men are amazed. ]
[ They leave the frame ]
Similar Projects
-
TEI: Text Encoding Initiative - provides an XML grammar and related tools for encoding texts in digital form (including many artsy texts such as works of fiction, poems and scripts/screenplays).
-
Celtx - an open-source application that allows one to edit screenplays, novels, and other media pre-production resources. Uses well-formed HTML 4 for its data files, packaged in a .zip with many resources, so it may be less ideal than XML. It is also a GUI program that was quite sluggish from my experience.
-
AsciiDoc - a very rich and open-source markup language that can be used for notating text and can be converted into DocBook 4, directly into HTML, and several other formats.