(Re-)integrate fountain reader
referring to https://github.com/jgm/pandoc/issues/4228,
Unfortunately, jgm's pandoc's instructions from 4 years ago no longer work, as they rely on external tools that are themselves deprecated.
Moreover, fountain.io's own reference code basically died about 10 years ago.
fountain is a very small markup language, https://fountain.io/syntax/, with some script idiosyncrasies. fountain is the (only) standard script markup language. this is not affected by fountain.io's demise.
I think this means an exporter to fountain is not needed or useful (RIP).
An importer of fountain would be very useful. If pandoc implemented fountain, it would probably become the standard implementation, too.
with very limited features, It shouldn't be too hard, either, as the fountain markup format is far more modest than, say, markdown. Only scene headings seem slightly more complex.[^printing]
Unhampered by cooperation with fountain.io's bugs, and with its very few features in the markup, and deliberately ignoring simultaneous dialog (as noted in the discussion), I would think that fountain->html (for view) and fountain->pdf (for print) would be great, with fountain->word appreciated, would be easy and straightforward.
I am even tempted to write a standalone fountain->html in perl (a language I know), probably a few hours for the basics is all that I would need. My only hesitation is that I may inadvertently generate html format that pandoc can no longer understand.
[^printing]: this is a little more complex. there is a 55-line/page standard in the industry [https://screenwriting.io/what-is-standard-screenplay-format/], plus page numbers; and this broke in fountain.io's own code, probably as macOS converged to iOS over the last 10 years, seriously hampering usefulness of all kinds of code downstream, such as Marked 2.
I just tried the lua filter from jgm/pandoc-fountain, and it seems to work fine with latest pandoc. What is the problem you're having with it?
pandoc -f fountain.lua --css fountain.css --template fountain.html5 -o out.html
Steel, in the middle of a heated phone call:
STEEL
They’re coming out of the woodwork!
(pause)
No, everybody we’ve put away!
(pause)
Point Blank Sniper?
.SNIPER SCOPE POV
From what seems like only INCHES AWAY. _Steel’s face FILLS the *Leupold Mark 4* scope_.
^D
[WARNING] This document format requires a nonempty <title> element.
Defaulting to '-' as the title.
To specify a title, use 'title' in metadata or --metadata title="...".
Here's what the result looks like:
The principal problem starts with the installation...
$ brew reinstall wkhtmltopdf
Warning: wkhtmltopdf has been deprecated because it is discontinued upstream! It will be disabled on 2024-12-17.
Could you add your fountain input file? When I run it on my own simple sample, I don't get anything that looks halfway nice. I tried --standalone conversion, but I can't manage somehow. I used
Title: A Script
Author: An author
Contact: <[email protected]>
.INT. SOMETIMES, SOMEWHERE
! The camera sweeps over the audience.
SINGER:
La la
FRIEND:
I love pandoc.
SINGER:
Really?
I checked in Marked-2 that this was a reasonable input file. then I used
pandoc --standalone -f fountain.lua -css fountain.css --template fountain.html5 sample.fountain -o out.html.
probably my lack of knowledge, but with the wkhtmltopdf about to disappear, too,....
This worked fine for me. It gives you an HTML file. I don't know what it's supposed to look like, but this is what it does look like:
What's the problem?
If you want a PDF,
pandoc -f fountain.lua --css fountain.css --template fountain.html5 sample.fountain -o out.pdf --pdf-engine=wkhtmltopdf
If you don't want to use wkhtmltopdf, try installing pagedjs-cli, and use
--pdf-engine=pagedjs-cli
(there are a number of other options, described in the manual).
was all my fault (of course). I can only suggest smaller changes then.
- mention
--pdf-engine=pagedjs-clialso onhttps://github.com/pandoc/pandoc-fountain(git for the fountain use), and not justwkhtmltopdf. - include the
sample.fountainandsample.outfile in the git for the fountain use, just making it a tiny bit easier to confirm that one has it all set up. - add a warning message to
pandocwhen someone uses a command line switch that suggests a typo...I wrote-cssinstead of--css, and couldn't backtrack because I never had any working version. now that I had one (using your command), I could replicate the difference, and from here it was a 5-second easy correction to my typo.
thx, jgm.
-css has the same meaning as -c ss, i.e. --css ss, so it's not actually wrong; it's just not what you intended.
I'll modify the repo as suggested.
I know about the -css interpretation, but I bet you that 99.999% of people who type this meant --css. thus, for the common dual-dash options, I would emit a warning (not an error). In fact, I would do this for each --[a-z]+ option that you list in pandoc --help.
if you wanted more intelligence, for stupid people like myself, you could add a basic check on what follows. 'ss' would have had to be a URL. but this is not worth the programming effort.