nyousefi / fountain Goto Github PK
View Code? Open in Web Editor NEWAn open source implementation of the Fountain screenplay formatting language.
Home Page: http://fountain.io
License: MIT License
An open source implementation of the Fountain screenplay formatting language.
Home Page: http://fountain.io
License: MIT License
Apologies for using the issues feature to do this but it seemed like the best place to notify watchers of the project.
I've been working on a JavaScript parser for Fountain that some users might be interested in. The parser and code itself are available on my GitHub page (http://github.com/mattdaly/Fountain.js) and a converter application is set up on a GitHub Pages page (http://mattdaly.github.com/Fountain.js/). The parser itself is still being optimized (I approach it a little differently to the official Obj-C code), and the css styling for the formatted HTML needs some tweaking.
Right now, it's just the parser and HTML formatter/converter. I have an analyser in the works that'll pump out a bunch of character, scene and time of day (and more) information. I'm also working on better page rendering.
If anyone wants to contribute please feel free, or pass on any suggestions or problems you encounter.
When a document does not provide any title page information, fountain still generates a title page. Would it be possible to suppress empty title pages, or say explicitly that you would like no title page, e.g., Title page: off
?
I want to help add to the symtx but not much of a programmer but I have figured out how to do symtx in notepad++. Can send you the symtx file out of notepad++, can you use it?
Currently, I'm having trouble deciding, where to put my thoughts on something (let's say, worldbuilding) in the screenplay. Of course, it can't be anywhere where it would be printed. I'm aware of the synopses syntax (=
) as well as the title page fountain offers for key-value pairs. So, which of the options do you feel, is more intuitive to you?
Option 1: Synopses
Title: Example screenplay
= World building notes: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
= Dramaturgical notes: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
====
INT. A room -- DAY
Option 2: Title page
Title: Example screenplay
World building notes:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Dramaturgical notes:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
====
INT. A room -- DAY
I thought about foot- or endnotes, however, since they are not explicitly part of the fountain standard (just the markdown one), I refrained from using them.
I'm calling FastFountainParser to get an NSMutableArray of the script, but [[Notes]] don't always seem to come through correctly. If I place them around Character Names, I've noticed the parser will confuse the whole line for an Action line.
When I'm working in Highland, it seems to process Notes really well. I can place them anywhere and they'll be hidden.
It appears a similar thing happens with Boneyard text. If it happens in the middle of Character lines, it just kinda kills the whole Character line.
Did you have to write custom code to get around this for Highland?
FNHTMLScript fails to translate linebreaks inside element texts into linebreaks in html. I suggest fixing this by adding text = [[text stringByReplacingOccurrencesOfString:@"\n" withString:@"<br>"] mutableCopy];
somewhere inside - (NSString *)bodyForScript
inside FNHTMLScript
As mentioned in the Atom 1.28 blog post, a new parser is being developed. I don't think the current parse will be deprecated anytime soon, but we should track the maturity of Tree-Sitter and determine at a later point if it's appropriate to support it.
Could someone add sound effects to the sytax? This would be great for those who are doing an audio drama script, comic, video games or stage play.
sytax possibilities
I found some sample scripts to illustrate the snytx output for comic books and audio drama script.
The parts of the website that are broken are:
It looks like these PHP pages are missing. Notice: Undefined variable: path in /home/wb0mw4kg687n/domains/fountain.io/html/faq.php on line 8
Fountain format is the most cool format to write scripts in.
I use Obsidian and would love to see it there.
On the home page, the link to the PDF example currently is https://fountain.io/_downloads/Big-Fish..pdf (the dot is accidentally doubled), while it should be https://fountain.io/_downloads/Big-Fish.pdf .
Is there a MIME type that is recommended to use for Fountain?
E.g. "text/vnd.fountain" ?
BTW, I'm a big fan of Fountain and have used it in a couple of open source projects.
I've found that I get the odd hanging dash in action and dialogue as the spec currently lacks a way to add a non-breaking space. I suggest the syntax \\s
(backslash space) so that lines ending in possible hanging dashes could be written as something like...
CHARLIE
I don't want to deal with any hanging dashes, I'm\ -
STEPHANIE
Too dashing?
I've already implemented this for Emacs if you'd like to see how it might work in practice.
If I include a parenthetical character extension after a character name like this:
SPECIALIST O'HARA (tensely)
Wire cutters.
it will be rendered into this HTML:
<div class="action"><p>SPECIALIST O'HARA (tensely)<br/>Wire cutters.</p></div>
It seems like it should be rendered as a class="character"
according to the documentation, but I may be missing something.
(Is this the place to raise issues with Fountain's syntax? Anyway, I'm doing it.)
Looking over http://fountain.io/syntax I notice that the suggested way to avoid automatic categorization is to include two trailing spaces on a line.
Relying on trailing whitespace is bad, for a few reasons- not the least of which is that lots of stuff, including the editor I use every day, is set to strip trailing whitespace on file save (preserving trailing whitespace is a great way to introduce infuriating, invisible diffs). Making the non-syntactic line breaks whitespace-indistinguishable also just plain makes the Fountain doc hard to read - if line breaks are my single cue for the end of dialogue, I'm going to be totally thrown when they're to mean something completely different.
Maybe add another rule that lets lines end at the last printable character? I'd suggest stripping empty pairs of parentheses at the end of a line, like this:
DEALER
Ten.
Four.
Dealer gets a seven.
()
Hit or stand sir?
Or this:
ROBERT
But, wait- if I'm not- and this is- but that's- oh my-
IN A FLASH OF SMOKE, ROBERT CEASES TO BE A CHARACTER. ()
This was his own fault for messing with the Syntax of Life.
I'm thinking empty parentheses because it kind of resembles what it kind of represents, a completely invisible, nigh-imperceptible, meta (beat)
.
If, for some unfathomable reason, a line needs an empty set of parentheses at the end, they could be backslash escaped, like how **non-emphatic asterisks__ are:
NEO, bent over the terminal, finally realizing his destiny, uses every last ounce
of his strength to deliver the last salvation of humanity:
(XCU on screen)
Matrix.free\(\)
Also, continuing from that last idea, it should be possible (I don't know if this works with the current spec or not) for an action to start with an escaped leading right-angle-bracket, so we can represent things like actions at command prompts with:
\> new Matrix.enslavement(Machines)
Hello, I think Fountain is a really interesting project! As an exercise to learn about Parsing Expression Grammar, I've been trying to write up a formal PEG specification for the Fountain format.
This is very much still a work in progress, but I have a PEST grammar for Fountain defined here that I believe satisfies all the test cases in this repo.
I realize this is kind of presumptuous, but how would you feel about adopting/collaborating on an "official" PEG specification for the Fountain format? I think having one formal definition as an implementation-agnostic specification would be cleaner than a series of regular expressions in Objective C code.
Apologies for what I'm sure is an extremely dumb question, but I'm trying to get Fountain working with Typora. The README says to copy the Fountain Group files into my project. But there's just one .md file. Do I need to create a parent folder for the "project" and put the Fountain Group files in there with the .md? Or drop the files somewhere into Typora's directory? Opening a .fountain file in Typora doesn't load the rules with the markdown.
Thanks for the help!
Is this left up to a developer's implementation of the fountain syntax or is this a rule? I do not see a reference to needing a space after the forced slugline. Without the space the parsers (writer duet and screenplain tested) interprets .BLAHBLAH as a character name.
Shouldn't the dot force the slugline no matter what is on the next line?
As a further rational I think my script looks quite a bit messier with those extra spaces...but maybe I use too many sub slugs? :)
The three videos inserted at https://fountain.io/howto are all of them set with autoplay=1
. This means that, just by landing on the page all three start playing simultaneously. The videos are hidden, but the sound from all three of them plays in the background.
I have observed this in both Firefox and Edge. It doesn't happen in Chrome.
(Note that all of them are embedded using Flash; while fixing the autoplay problem, it might be a good moment to change this to HTML5, but this is just a suggestion)
P.D. I'm opening this issue here as I cannot find any other more appropriate place or way of contact. Feel free to redirect this to whoever is interested or can fix the problem.
add the markdown images syntax to the notes syntax
https://www.markdownguide.org/basic-syntax#images-1
To add an image, add an exclamation mark (!), followed by alt text in brackets, and the path or URL to the image asset in parentheses. You can optionally add a title after the URL in the parentheses.
[[It was supposed to be Vietnamese, right?]]
this will help make an actors notebook app
I’d like to suggest adding “Episode” as new element/key for fountain title pages. This element could be used for an episode number or title and would ideally come between title and credit. I’ve added it to my parser and pdf maker, and found it very useful when I’m writing for tv.
I thought, it might be a good idea, to collect all issues concerning syntax extension to have kind of an overview of where we stand on these issues (maybe @nyousefi can create a label for that):
Title | Status | Proposed syntax | Rendered as | Suggested by |
---|---|---|---|---|
Stage directions | discussion | +stage directions+ |
<div style="text-align:right;">stage directions</span> |
@Reaper10 |
Sound effects | discussion |
|
@Reaper10 | |
Scene metadata | discussion | @severdia | ||
Element references | discussion | [{label}]({type}:{identifier}) |
<a href="[{type}:{identifier}">{label}</a> utilizing CURIE/URN |
@shaedrich |
dramatis personae | discussion | table | https://scriptigo.com/help/fountain-format/133-improvements-to-the-fountain-format | @severdia |
Script lining | discussion | [[ and ]] , starting with the word "LINE" |
vertical lines with different colors | @shaedrich |
Annotations | discussion | extended markdown syntax to highlight text (== and == ) in connection with footnotes ([^1] and [^abbr]: endnote text or ^[inline footnote] ) |
<mark title="{label}">{text selection}</mark> |
@shaedrich |
Hi!
I started writing a fountain parser (https://github.com/Joeboy/farce, still WIP). I'm thinking of including a copy of the Big Fish .fountain and .pdf files so I can compare farce's output to the "reference" version. Just wanted to confirm it's legitimately covered by the project's MIT license? I notice it says "Copyright: (c) 2003 Columbia Pictures" on the title page.
Sorry if this is an awkward question. I'm also open to suggestions for other "reference" files.
Hi Nima,
Quick question: Do sections require a newline afterwards? The syntax page doesn't say so explicitly, and I'm starting to see content from Storyist customers of the form:
# Act 1
= Synopsis 1
INT. LOCATION - DAY
and
# Act 2
## Sequence 1
INT. LOCATION - DAY
Slugline allows it, but FastFountainParser doesn't recognize it. If it is allowed, we should probably update the parser. If not, the syntax page.
-Steve
Hi,
Are there any current open source solutions that would allow me to convert final draft / celtx or even pdfs into the fountain format?
Cheers
Chris
I'd really like to add Fountain support to an app, but...
Are you still using the RegexKitLite distribution from Sourceforge (http://regexkit.sourceforge.net/#RegexKitLite)?
I am getting warnings of:
if(cachedRegex != NULL) { cachedRegex->buffer = NULL; cachedRegex->setToRange = NSNotFoundRange; cachedRegex->lastFindRange = NSNotFoundRange; cachedRegex->lastMatchRange = NSNotFoundRange; }
return(0UL);
around line 969 of RegexKitLite.m.
I know RegexKitLite hasn't been updated in years, but if you know anyway to fix it or have a fork that you are using, I'd really like to know about it. (there are also some 'code will never be executed warnings).
IOS 8.4, xCode 6.4
Has anyone tried to use Fountain inside a template for iA Writer?
I can't get it done. Maybe I'm not the only one.
Looking at the specs of Boneyard, it seems that no "inline" boneyard is allowed, this even is done inside FastFountainParser which checks for line-start.
Is "inline" Boneyard possible, or is it not wanted? It is not clear to me (because not explicitly specified), if this is allowed or not.
Am I missing something?
On my project, I'm encouraging other writers to use text-based formats like markdown and fountain. I've set up a set of skeleton templates for the various files we use for a story - outline, script, etc. I would like to include at the top of these files some helpful hints as well as links to syntax pages. For example, in fountain scripts I'd like to include a comment that contains a link to https://fountain.io/syntax .
The syntax specification does say "The optional Title Page is always the first thing in a Fountain document" (https://fountain.io/syntax#section-titlepage), but I wonder if the possibility of comments that precede the title hadn't been considered when this rule was established.
Will not build in Xcode 8.3 targeted for iOS 8.3 and returns message:
ld: framework not found cocoa
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I APOLOGIZE IN ADVANCE for posting this here, since it really isn't what Github is about, but I've looked all over the place and can't find anywhere else to post this. If someone can point me to a better place, I'd really appreciate it. Meanwhile:
Is there any data out there indicating how many people are using Fountain? I'm trying to make a case to my co-workers about using Fountain as the basis for some new application work, but without any sort of usage data, it's hard to make a convincing case. Does anybody have anything relevant or useful? Apologies again, and thanks!
Title.
I’ve recently added Fountain
to the CocoaPods package manager repo.
CocoaPods is a tool for managing dependencies for OS X and iOS Xcode projects and provides a central repository for iOS/OS X libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.
However, Fountain
doesn't have any version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.
Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.
In case you didn’t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:
$ git tag -a 1.0.0 -m "Tag release 1.0.0"
$ git push --tags
Hi
Hopefully I'm not being too tribal here, but it seems to me that Objective C is not the ideal language for a "reference" implementation in 2023. I would guess not many developers are able or motivated to get Objective C code working. I admittedly haven't really tried, but it looks like in particular XCode is a bit painful on Linux. It seems like various people (including me) are implementing fountain parsers in other languages.
It would be great if there was a set of tests we could easily run to assess the conformance of other implementations, written in something with wider support and adoption (maybe Python?). It doesn't seem like this repo is being very actively maintained at the moment, but I just leave this here in case anybody takes an interest. Maybe what I'm looking for even exists somewhere already?
Is there a way to have multiple alternative variants of a scene (alternative dialogue, shorter scene, etc.) in a spec script that, for example let's say the writers room of a TV show, would agree on one of them before turning it into a shooting script? If that's possible, how would one properly format/denote that?
Some further explanation: Let's say, the original scene is quite expensive. The director would like to include it when possible but that might depend on other episodes of the show. So they write an cheaper scene variant just in case until a decision is made on this because they don't have time to wait and then rewrite the scene, since, clearly, time is money.
The Fountain spec is of course inspired by Markdown syntax, with some features left out; for example, I know screenplays don't generally have multiple levels of hierarchical headings...
But what do you think of maybe adding some Markdown features back in? For example, I can see how hyperlinks would be useful when making a reference to some external source. And embedded images could be a much more efficient way of describing the author's intended blocking for a scene.
I have more coding experience with JavaScript than with Objective C, so I was going to fork Fountain.js -- but I thought I'd ask if you liked this idea being a part of the official Fountain markup specification before I start a nonstandard implementation.
An easy-to-solve issue: There is a typo in https://fountain.io/syntax#section-overview
Underline by bracketing with underscrores.
Hi. I'd like to create Abstract Syntax Trees out of Fountain documents.
Is there a grammar spec or a reference compatibility document (kind of like a TCK) so that I can know that I'm parsing documents correctly?
Thanks!
Has the regex been updated by any chance?
Hi Nima,
Excellent code. Thanks for sharing it.
I did notice one issue: In "The Last Birthday Card," the paragraph
"Scott exasperatedly throws down the card on the table and picks up the phone, hitting speed dial #1..."
is parsed as a section with the content "#1..." It should be action with the entire paragraph as content.
-Steve
Works great on OS X, but i'd love to be able to implement a server-side parser for web applications. Any plans to port to *nix, or any links to anyone looking at this?
I have a scene description in my .fountain file that looks like this:
Joe watches Maggie get up, leave the room, then come back carrying a
chair from his dining table in the other room.
In my case, my text editor (vim, but who cares, this is a bigger issue than just vim) is configured to add a newline after 72 characters.
I get output that looks like this (I'm using screenplain):
Joe watches Maggie get up, leave the room, then come back
carrying a
chair from his dining table in the other room.
But I want output that looks like this instead:
Joe watches Maggie get up, leave the room, then come back carrying a chair from his dining table in the other room.
What I want is that the wrapping should happen at the very end. Sorta like in HTML, line breaks get ignored usually. The line breaks are just because I don't like really long lines.
This might be a fanciful wish, but I wonder if it is even possible to have the parsing apps understand that some newlines should be discarded, but others should be respected.
Is there already a way to achieve what I want? In other words, can I split my lines at 72 characters, but have those newlines be ignored.
This might be a "eat my cake and have it too" thing, but I'm hoping that other folks at least understand what I'm hoping for.
Fountain helpfully provides support for title pages. As explained in the FAQ:
Why should Fountain support a title page?
One goal of Fountain is that you could write an entire screenplay with it, and easily export and/or print something that a colleague could read and provide feedback.
However, Fountain does not have any syntax for a cast of characters page, a.k.a. dramatis personae. While this is not standard for screenplays, it is essential for stage plays. I realize that Fountain is intended primarily for screenwriting, but it seems to me that this one addition would make it a robust tool for stage writing as well.
I propose a syntax like this, which would more generally allow Fountain to generate full pages with two-column tables and a title, which could be useful for call sheets, tech cues, or other informational lists related to a script:
| Characters
| Claudius | King of Denmark
| Hamlet | Son to the late, and nephew to the present king
I'd be happy to work on the implementation and submit a pull request if you think it's a good idea.
(Apologies if this isn't the best forum to request additions to the Fountain spec itself. As far as I could tell, there are no guidelines for feature requests on http://fountain.io.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.