Story XML Authoring Tool - Manual

TOC

GNU GENERAL PUBLIC LICENSE


Structure

* - means zero or more of these elements can be used.

+ - means one or more of these elements can be used.

Minimal Story Structure

book +
	title - Book's title (prints)

	book-info - Meta info about the book (prints on copyright page)
		author * - Book's author (prints)
		copyright - Copyright date and holder (prints)

	style-info - Control what is printed and how
		def-content * - Controls what content prints
		def-draft * - Controls what draft items print
		def-print * - Control the print output

	story-info - Meta info related to the story's content
		def-when - define the absolute time for relative time refs
		def-thread + - different threads
		def-who + - different characters (optional)

	chapter + - One or more chapters
		title - chapter title
		unit * - a scene or sequel - Print a blank line between each
			title - Draft print only
			thread * - def-thread id, and def-who id for viewpoint
				para * - block format
				p * - narrative paragraph, indented.
				s * - A character says something, def-who id
				t * - A thought by a character, def-who

Full Story Structure

book +
	title - Book's title (prints)
	subtitle - (optional)
	title-abbrev - printed in page head (optional)

	book-info - Meta info about the book (prints on copyright page)
		author * - Book's author (prints)
		pub-date - first publish date
		copyright - Copyright date and holder (prints)
		release-info - version control vars. (draft prints)
		biblio-id * - ISBN, URLs, etc (optional, prints)
		abstract - usually legal disclaimers (optional)

	style-info - Control what is printed and how
		def-content * - Controls what content prints
		def-draft * - Controls what draft items print
		def-print * - Control the print output

	story-info - Meta info related to the story's content
		def-when - define the absolute time for relative time refs
		def-thread + - different threads
		def-who + - different characters (optional)
		def-where * - scene/sequel locations (optional)
		ch-preface * - Common preface for, multi file output (optional)

	preface - Book's preface  (optional).  Prints after TOC

	chapter + - One or more chapters
		title - chapter title
		subtitle - (optional)
		title-abbrev - may be printed in page head (optional)
		chapter-info - Chapter meta info, used in draft outputs
			release-info
			pub-date
		prolog - Chapter preface (optional)
			para * - block format
			p * - indented
			pre * - preformatted text

		unit * - a scene or sequel - Print a blank line between each
			title - Draft print only
			outline - Outline comments, draft print only (optional)
				when - date/time, duration
				where - Location of scene or sequel (def-where)
				who - Characters present (def-who)
				description - summary, goal/disaster/reaction
					para * - block format
					p * - indented
					pre * - preformatted text

			thread * - def-thread id, and def-who id for viewpoint
				para * - block format
				p * - narrative paragraph, indented.
				s * - A character says something, def-who id
				t * - A thought by a character, def-who

		postlog - Chapter epilogue (optional)
			para * - block format
			p * - indented
			pre * - preformatted text

	epilog - Book's epilogue (optional)

Common Attributes (all elements)

condition

Condition is a general-purpose attribute with no specified semantics. It can be used as a processing instruction for adding modules. (optional).

Currently, this attribute has no effect.

id

"id" is an identifying string for the element. It must be unique at least within the document and it must begin with a letter. This attribute may be required for some elements.

lang

Lang should be a language code drawn from ISO 639 (perhaps extended with a country code drawn from ISO 3166, as en-US). Use it when you need to signal your application to change hyphenation and other display characteristics. (optional).

Currently, this attribute has no effect.

revision

Value, one of: "final", "in-progress", "draft" (optional).

The def-content defines what will be printed, based on the setting of this attribue for each element. If it is not defined "final" is assumed.

revisonflag

Value, one of: "changed", "added", "deleted", "off" (optional)

changed - in draft mode this text will print blue underline.

added - in draft mode this text will print green underline.

delete - in draft mode this text will print red strike-through In non-draft mode, deleted text won't be printed.

Standard Attribute Names

idref or ref

One ID value.

idrefs or refs

One or more space separated ID values.

Text Elements

<para>

This text is block formatted with extra spaces between paragraphs.

<p>

Narrative paragraph. The first line is indented, and there is no extra spaces between paragraphs.

<s>

A character says something. The optional def-who attribute defines who is talking. It is formatted just like the p tag. In draft mode, you can request the def-who id to be printed.

<t>

A thought by a character. The def-who attribute is required. If the thread's viewpoint id matches the def-who id, then the text will print.

Inline Text Style Elements

<b>

Bold text.

<i>

Italic text.

<tt>

Fixed space, typewriter text.

<rev>

This is only used to mark modified text with the "revisonflag" attribute.

Complete story.dtd

The complete annotated story.dtd (Document Type Definition) can be found here. This describes all elements, and attributes.

Click on the element or entity name to see it's definition. Click on the '+' character, to see where it is used.

Story XML Samples

The sample files will show the complete use of the xml structure.

sample/sample-minimal.xml

This is a minimal story-xml template.

sample/sample-full.xml

This is an almost complete story-xml template.

sample/entity-example.xml

This file shows how you can use file entities to break up you book into separate files. You can also define text entities for common text phrases.
<?xml version="1.0"?>
<!DOCTYPE story-xml [
<!ENTITY book1 SYSTEM "book1.xml">
<!ENTITY ch1 SYSTEM "ch1.xml">
<!ENTITY ch2 SYSTEM "ch2.xml">
<!ENTITY gpl "GNU General Public License">
]>
<content>
  &book1;
  &ch1;
  &ch2;
</content>

sample/ebook-20869-h.xml

This is a complete story formatted with story-xml.

story.dtd

This Story Document Type Definition file will define exactly what is allowed and where.

Authoring Tools

A general text editor, such as VI or EMACS can be used to create the story-xml file, but xml authoring tools will use the DTD to help keep the structure "valid" and they will help with generating the required elements and attributes.

Serna

This is a complete authoring and publishing tool. It can be easily configured to use the story-xml DTD, and it's PDF formatting styles.

TBD: Installing and this tool, for use with story-xml...

editix

This a more general purpose XML tool.

TBD: Installing and this tool, for use with story-xml...


Rendering Tools

xsltproc

xlstproc is used generate the html files, html draft files, time-line files, and docbook xml files. It is also used to generate "fo" files, which are input to the PDF rendering programs.

fop

This is a free tool for generating PDF files.

RenderX xep

This tool will generate PDF files and the fonts can be "embedded" so that the PDF file can be used with publish-on-demand services like lulu.com

There is a free version of this tool, but it marks the bottom of the page with it's trademark. There are personal versions available for a reasonable cost.


Command Line Use

To generate the different output formats, run the "story-fmt" program, with one (or more) of the options followed by the input file name.

/opt/story-xml/bin/story-fmt
	-html -draft -chapter -fo -fop -renderx -project -docbook
	-style NAME -input FILE.xml

-html (default)

Output FILE.html

-draft html

Output FILE-draft.html Output FILE-timeline.html

chapter

(Not implemented)
Output FILE.chN.html

-fo

Output FILE.fo

-fop (pdf)

Output FILE.pdf

-renderx (pdf)

(Not implemented)
Output FILE.pdf

-project

(Not tested)
Output FILE-timeline.proj.xml

-docbook

(Not tested)
Output FILE.docbook.xml

-sytle NAME

(Not implemented)
Override the "style-ref" attribute in the "style-info" element, so that you can select a different "def-style" id.

-input FILE.xml

Input file name.

Example

PATH=$PATH:/opt/story-xml/bin
cp /opt/story-xml/doc/sample/ebook-20869-h.xml .

story-fmt -html -draft -fop -input ebook-20869-h.xml

Last modified: $Date: 2009/04/20 05:59:44 $ GMT