Code Monkey home page Code Monkey logo

scenewriter's Introduction

Scenewriter - a Fountain Parser

Scenewriter is a command line program that parses files in Fountain markup language, and generates PDFs in the standard screenplay format. It doesn't implement the full Fountain spec yet, and probably has bugs. But it seems to kinda mostly work, to the limited extent I've tested it so far.

If you just want to download and use it, see the releases. Note that it's still an unfinished / preview release. But for basic scenes, it might already do everything you need. Issues that might be offputting are:

  • Full Fountain spec is not yet implemented
  • Only really tested with straightforward UTF8 / ASCII encoded documents, probably won't handle weirder encodings well
  • Title page is very basic - eg. no contact details

Here's direct links to the Windows, Mac and Linux versions.

Here's the reference version of the John August's Big Fish screenplay from fountain.io, and here's Scenewriter's effort at formatting the same fountain file. It's in the ballpark, but not 100% there yet. For the even less polished HTML output see here.

On my laptop, HTML generation is basically instant (~25ms for Big Fish). Generating the 119 page PDF from the same file takes about 0.4s.

If you'd especially like anything implemented or fixed please raise an issue. See the issues to get a vague idea of the current priorities.

Usage

./scenewriter --help

Usage: scenewriter [..options..] input_filename

Options:

             --pdf     Write PDF file (default)
            --html     Write HTML file
           --stats     Show screenplay stats

              --a4     A4 page size (default)
                -a

          --letter     US Letter page size
                -l

 --output filename     Choose output filename (default is the input
       -o filename     filename but with .pdf or .html extension)

            --help     Show this help


     Eg: scenewriter --a4 --pdf -o "My Screenplay final-v23.pdf" my_screenplay.fountain

or just: scenewriter my_screenplay.fountain

(if you're using the Windows version it'll be scenewriter.exe).

Python bindings

If you want to call scenewriter code from python, there are very rudimentary bindings here.

scenewriter's People

Contributors

joeboy avatar

Stargazers

 avatar

Watchers

 avatar

scenewriter's Issues

Builds / releases

Should do automated builds / releases, at least for Windows and Mac. I guess with Rust's static binaries it should be easy for Linux too? Will have to check that out.

Switch to Courier Prime

Seems to be the most liked font for screenplays (there's also Courier Screenplay but Courier Prime seems to be the frontrunner?)

Support HTML output

Should be pretty easy to do, and it'll be easier to test HTML output than PDF.

Redo PDF generation

I think at some point I might want to redo PDF generation, cutting out genpdf and probably printpdf. I think, given the simple monospaced nature of the output, it should be a massive deal to work at a lower level (ie. lopdf). That'd mean I could cut out the genpdf / printpdf forks I introduced for underlining, could do smarter page breaks (widows / orphans). I guess not being based on forked packages might also make it more publishable as a crate.

Support text formatting within elements

Ie. *italics*, **bold**, probably other things if I bothered to check the spec.

I think this should just be a matter of passing the parsed element texts through a simple formatter.

Smarter page breaks

At the moment it's entirely dumb about where it puts page breaks, it'll happily put the speaker name on page 12 and their dialogue on page 13. Should look into that.

Slim down PDF output

At present Farce produces PDFs that are >400k for a "Hello World" fountain file. I suspect almost all the bloat is the embedded font. Would be good if there was some way to exclude unused glyphs or something. Could also provide an option to use the default PDF Courier font.

Support underlining

It turns out underlining isn't exactly supported in the PDF format, you have to "manually" draw a line in the right place (or add an annotation, which doesn't look any easier). This seems annoyingly hard to do, probably needs to be supported upstream in genpdf or printpdf.

Tests

Given that there's a fair few fountain parsers in the wild, I think it'd be good to work on some "portable" tests. A simple way would be to have some hooks that do things like invoke fountain -> html conversion, and compare the results to a reference output. A complication would be that different tools will (legitimately) generate different looking html, so that'll either require some fiddling (more hooks?) or the specific html output will be part of the tests. Hmm.

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.