GithubHelp home page GithubHelp logo

arikrupnik / fountainhead Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 150 KB

Tools for using Fountain.io screenplays throughout the production process

License: GNU General Public License v3.0

Makefile 3.37% CSS 5.81% C++ 1.31% Python 86.39% XSLT 3.12%

fountainhead's Introduction

Fountainhead

Tools for using Fountain.io screenplays throughout production process

fountainhead.py: converts .fountain files to XML

Fully implements the Fountain spec. Requires Python Markdown ($ pip install markdown). Outputs semantic XML that corresponds to implicit structure in .fountain documents.

Input:

INT. HOUSE - DAY

MARY (O.S.)
I can't believe how easy it is to write in Fountain.

TOM
(typing)
Look! I just made a parenthetical!

Output:

<?xml version="1.0"?>
<?xml-stylesheet href="ftx.css"?>
<fountain>
  <scene>
    <scene-heading>INT. HOUSE - DAY</scene-heading>
    <dialogue>
      <character>
        <name>MARY</name>
        <extension>(O.S.)</extension>
      </character>
      <line>I can't believe how easy it is to write in Fountain.</line>
    </dialogue>
    <dialogue>
      <character>
        <name>TOM</name>
      </character>
      <parenthetical>(typing)</parenthetical>
      <line>Look! I just made a parenthetical!</line>
    </dialogue>
  </scene>
</fountain>

The output can display directly in browsers with the use of included CSS stylesheet, or further convert to PDF using Weasyprint and the included makefile.

Syntax extensions

Section identifiers

Fountainhead parses identifiers out of section headings in addition to scene headings. #ACT II #ii# becomes <section heading="Act II" id="ii">

At user option (-x or --syntax-extensions switch), Fountainhead interprets additional syntax outside the scope of the Fountain spec.

=<include.fountain

Fountainhead parses the file named include.fountain and inserts its parse tree in place of this directive. This feature allows breaking a screenplay into smaller files that are easier to edit individually. Changing the order of scenes, for example, means moving one line instead of hundreds at a time.

Fountainhead parses the include first, rather than including its source directly. This keeps includes from messing up the structure of the including file. Any scene or section that starts in a file ends in the same file.

If the filename includes a fragment identifier (e.g., file.fountain#scene_id), Fountainhead includes only the scene or section with that identifier. A common use case for this feature is keeping "mirror" scenes together for editing. For example, two characters may have a confrontation at the beginning of a screenplay and the end; the differences between these interactions show character development. It's easy to keep the mirror images consistent if they reside in the same file.

Semantic linebreaks

By default, Fountainhead follows the Fountain spec: "Unlike some markup languages, Fountain takes every carriage return as intent." At user option (-s or --semantic-linebreaks switch), Fountainhead collapses single linefeeds into spaces. http://rhodesmill.org/brandon/2012/one-sentence-per-line

plot-summary.xslt: extracts plot summary from a Fountain screenplay

I like to start a screenplay by writing a treatment or a plot summary. I can use it to gauge interest in my story, and solicit early feedback. Once I start writing action and dialog, it's convenient to have the plot summary and the screenplay in the same place. It's easy to reference the summary as I'm developing the story, and it's easy to keep the summary up to date as the story evolves. Keeping the summary in =synopsis elements inside a .fountain screenplay allows me to keep one source of truth. This stylesheet extracts these synopses along with section headings and outputs them as plain markdown. The output includes Title and Logline keys when those are present in the .fountain source.

fountainhead's People

Contributors

arikrupnik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fountainhead's Issues

Double space at the end of a line to prevent line folding in semantic line mode

In semantic linebreak mode, Fountainhead follows the Markdown convention of treating adjacent lines as parts of the same paragraph. It is desirable to follow the Markdown feature that allows the author to force a linebreak if a line terminates in two spaces.

Here's an example from the Fountain spec. Note the two spaces after "long beat. " in the second line.

They drink long and well from the beers.

And then there's a long beat.  
Longer than is funny.
Long enough to be depressing.

The men look at each other.

With semantic linebreaks option, Fountainhead parses this so:

<fountain><action>They drink long and well from the beers.

And then there's a long beat.   Longer than is funny. Long enough to be depressing.

The men look at each other.</action></fountain>

The desirable interpretation is:

<fountain><action>They drink long and well from the beers.

And then there's a long beat.
Longer than is funny. Long enough to be depressing.

The men look at each other.</action></fountain>

Acceptance tests

Create tests/*ftx that contain correct parse results for tests/*fountain and tests/Makefile to verify automatically that fountainhead.py results match these expectations.

Empty <action/> elements

Empty elements appear where insignificant empty lines appear in the source .fountain.

Examples:

A file's last significant element is dialogue, and the file has a trailing new line. The new line becomes <action/>

From tests/character.fountain:

CHARACTER
Line


.dual dialogue

This becomes (note at the end of the first scene):

<fountain>
  <synopsis>character lines with extensions, dual dialogue</synopsis>
  <scene><scene-heading><location>regular dialogue</location></scene-heading>
    <dialogue><character><name>CHARACTER</name></character>
      <line>Line</line>
    </dialogue>
    <action/>
  </scene>
  <scene>
    <scene-heading><location>dual dialogue</location></scene-heading>

Parse out scene headings

Break EXT. LOCATION - DAY into

<scene-heading>
  <type>EXT.</type>
  <location>LOCATION</location>
  <time>DAY</time>
</scene-heading>

Need to look into more complex cases--parenthesis, more than one dash, etc.

Add markup syntax for screenplay breakdown

It is desirable to designate words in Action elements as referring to specific props, characters, effects, etc. for breaking down a script. The goal is to have a list of props, actors, etc., for every scene.

Each of these props, characters, locations, etc., may have it's own page with descriptions, photos, notes. It may say whether the item is available or if the production is still looking for it. This requires specifying a format (and presumably directory layout) for these supplementary materials as well as for the output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.