Permalink
Browse files

Added makefile, updated documentation

  • Loading branch information...
olivertaylor committed Nov 16, 2014
1 parent 89417a3 commit 6f8fdc7d075901f2482eca61163941ea8a8d4f77
Showing with 38 additions and 33 deletions.
  1. +20 −18 README.md
  2. +5 −0 makefile
  3. +13 −15 textplay
@@ -1,35 +1,37 @@
Textplay
========

Textplay is a simple command-line script that converts screenplays written in [Fountain][fountain] formatted plain-text to a variety of useful formats: HTML, FDX ([Final Draft][finaldraft]), or PDF ([PrinceXML][prince] required).
Textplay is a simple command-line script that converts screenplays written in [Fountain][fountain] formatted plain-text to HTML, XML, and FDX ([Final Draft][finaldraft]).

Textplay has been rigorously tested against fountain documents, but it is not perfect, if you encounter a problem please [open a github issue][ghiss].

## Installation

1. I recommend cloning this repository somewhere convenient, then creating a symbolic link to `textplay` in `/usr/local/bin/`
2. `gem install textplay` (gem may not always be up-to-date)
Clone this repo somewhere convenient, `cd` into that directory, run `make install`. This will place a symbolic link to textplay in `/usr/local/bin/`. This symbolic link can be removed with `make uninstall`.

Textplay was built using Mac OS 10.6-9 and Ruby 1.8-2.0. I have only tested it in this environment, if you want to run Textplay in another environment (such as Windows) you may have to modify the code.
Textplay was built using Mac OS 10.6-10 and Ruby 1.8-2.0. I have only tested it in this environment, if you want to run Textplay in another environment (such as Windows) you may have to modify the code.

## Command-line interface
## Using textplay

Calling Textplay from the command-line is simple:
textplay [options]

`textplay [options] [input-path] [output-path]`
-h, --help Display the help text
-s, --snippet Do not include document headers/footers
-f, --fdx Convert to Final Draft .fdx
-x, --xml Output as the internal raw XML

* The first argument is always an input-path.
* The second argument is always an output-path.
* If there's no output-path textplay prints to `STDOUT` (PDFs go to `/tmp/`).
* If there's no input-path textplay reads from `STDIN`.
By default textplay converts to a fully-formed HTML document.

Textplay has a number of options you can call in the command line:
Texplay is designed to be a Unix tool, thus it always reads from STDIN and
writes to STDOUT. To make a file use standard Unix redirection. For example:

* `-h`, `--help` Displays the help text, including configuration options.
* `-s`, `--snippet` Create snippet instead of full document with headers/footers
* `-f`, `--fdx` Converts the file to FDX instead of HTML.
* `-p`, `--pdf` Converts the file to PDF ([PrinceXML][prince] must be installed on your system).
* `-x`, `--xml` Output as the internal raw XML
textplay < screenplay.fountain > screenplay.html

As another example, textplay has been tested extensively with
[PrinceXML](http://princexml.com). To make a PDF from a fountain document,
use this:

textplay < screenplay.fountain | prince - screenplay.pdf

## Configuring textplay

@@ -44,7 +46,7 @@ Using Fountain's `key:value` title-page syntax, you can control how textplay int
* Textplay is smart about what constitutes a transition. Usually, there's no need to escape transitions, but you can.
* An action line that contains no lower-case letters is converted to a slugline.
* In some cases Textplay does not assume that every whitespace character you type (newlines, spaces, and tabs) is intentional. For example, if you type one space on the line immediately below an all-caps line, Fountain assumes you'd like a Character saying “ ”. Textplay assumes you accidentally typed a space.
* Textplay only allows a single blank line between elements.
* Textplay collapses multiple blank line between elements to a single blank line.

### Q. What parts of the Fountain spec are not supported?

@@ -0,0 +1,5 @@
install: textplay
ln -s $(PWD)/textplay /usr/local/bin/

uninstall: textplay
rm /usr/local/bin/textplay
@@ -107,27 +107,25 @@ optparse.parse!
help_text = "
TEXTPLAY
Usage: textplay [options]
textplay [options]
Texplay is designed to be a Unix tool, thus it always reads from
STDIN and writes to STDOUT. To make a file use standard Unix
redirection. For example:
-h, --help Display the help text
-s, --snippet Do not include document headers/footers
-f, --fdx Convert to Final Draft .fdx
-x, --xml Output as the internal raw XML
textplay < screenplay.fountain > screenplay.html
By default textplay converts to a fully-formed HTML document.
As another example, textplay has been tested extensively with
PrinceXML (http://princexml.com). To make a PDF from a fountain
document, use this:
Texplay is designed to be a Unix tool, thus it always reads from STDIN and
writes to STDOUT. To make a file use standard Unix redirection. For example:
cat screenplay.fountain | textplay | prince - screenplay.pdf
textplay < screenplay.fountain > screenplay.html
By default textplay converts to a fully-formed HTML document.
As another example, textplay has been tested extensively with
[PrinceXML](http://princexml.com). To make a PDF from a fountain document,
use this:
Options:
-h, --help Display the help text
-s, --snippet Do not include document headers/footers
-f, --fdx Convert to Final Draft .fdx
-x, --xml Output as the internal raw XML
textplay < screenplay.fountain | prince - screenplay.pdf
ABOUT TEXTPLAY

0 comments on commit 6f8fdc7

Please sign in to comment.