Skip to content
/ fountain Public

A PHP parser for Fountain: a simple markup syntax that allows screenplays to be written, edited, and shared in plain, human-readable text.

License

Notifications You must be signed in to change notification settings

tao/fountain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fountain Parser

Fountain is a simple markup syntax that allows screenplays to be written, edited, and shared in plain, human-readable text. Fountain allows you to work on your screenplay anywhere, on any computer, using any software that edits text files.

For more details on Fountain see http://fountain.io.

A demo is available on heroku for testing.

Getting started

The simple version for parsing a screenplay text straight into HTML:

    $input = "My fountain input text.";
    $screenplay = new \Fountain\Screenplay();
    $html = $screenplay->parse($input);

The longer version is that Fountain first creates a collection of Elements, which you may use for other purposes. Once the Fountain Elements have been parsed, the FountainTags class determines the correct HTML tags to print.

    $input = "My fountain input text.";
    // determine fountain elements
    $fountainElements = (new \Fountain\FountainParser())->parse($input);
    // parse fountain elements into html
    $html = (new \Fountain\FountainTags())->parse($fountainElements);

Mentions

The code has been built upon the previous work of these contributors.

About

A PHP parser for Fountain: a simple markup syntax that allows screenplays to be written, edited, and shared in plain, human-readable text.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages