You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was really impressed by how the https://quoteunquoteapps.com/weekendread/ app works. It lets you read screenplays on a smartphone, without the soul-sucking pain of pinching in and out of a PDF file. For me it was a great mix of ease of use combined with the standard way of screenplays.
So I decided to throw together a PHP script to convert my .fountain files to such HTML, so that I could just share screenplay links with friends, and they could ready them with the same ease, as I had discovered on the https://quoteunquoteapps.com/weekendread/ app.
Given the kind of fanboy I am of VSCode, I was like- lets see what is out there, and that's when I found your plugin, installed it immediately, and LOVED it.
Thanks for making this man. I look forward to sending some pull requests your way soon.
===
Here is the quick and dirty PHP I was on my way with before I found your plugin.
<?php
// Define various things a line could be.
define('MIN_VALUE', '0.0');
define('UNKNOWN_LINE_TYPE', 0);
define('EMPTY_LINE', 1);
define('SCENE_HEADING', 2);
define('CHARACTER', 3);
define('DIALOGUE', 4);
define('ACTION_LINE', 5);
define('TRANSITION', 6);
$code = [
'UNKNOWN_LINE_TYPE',
'EMPTY_LINE',
'SCENE_HEADING',
'CHARACTER',
'DIALOGUE',
'ACTION_LINE',
'TRANSITION',
];
$filepath = "/Users/sumeetpareek/github/[masked this part of the path]/main-draft.fountain";
$lines = file($filepath, FILE_IGNORE_NEW_LINES);
$line_type = [];
// Do not proceed if the first line is not empty.
if (!empty($lines[0])) {
die("First line of the input file must be an empty line.\n\n");
}
$line_type[0] = EMPTY_LINE;
// Iterate on every line to set their line_type.
for ($curr_line_num = 1; $curr_line_num < count($lines); $curr_line_num++) {
$curr_line = $lines[$curr_line_num];
if (empty($curr_line)) {
$line_type[$curr_line_num] = EMPTY_LINE;
continue;
}
if (substr($curr_line, 0, 1) === "." || substr($curr_line, 0, 3) === "EXT" || substr($curr_line, 0, 3) === "INT") {
$line_type[$curr_line_num] = SCENE_HEADING;
continue;
}
if (substr($curr_line, 0, 2) === "> " || (strtoupper($curr_line) == $curr_line && substr($curr_line, -1) == ":")) {
$line_type[$curr_line_num] = TRANSITION;
continue;
}
if (strtoupper($curr_line) == $curr_line) {
$line_type[$curr_line_num] = CHARACTER;
continue;
}
if ($line_type[$curr_line_num - 1] == CHARACTER) {
$line_type[$curr_line_num] = DIALOGUE;
continue;
}
// Or if none of those then it is an action line.
$line_type[$curr_line_num] = ACTION_LINE;
}
// Print every line_type and line.
for ($curr_line_num = 0; $curr_line_num < count($lines); $curr_line_num++) {
$key = $line_type[$curr_line_num];
print "\n(( $code[$key] )) ". $lines[$curr_line_num];
}
The text was updated successfully, but these errors were encountered:
I'm glad you like it! A lot of credit should go to Piotr Jamróz and Matt Daly who wrote afterwriting and fountain-js, which this extension is heavily based upon.
Also, thanks for the code, but I know very little about php and the extension is written fully in typescript :/
(P.S. don't forget you can always leave ratings on the visual studio marketplace :P)
I was really impressed by how the https://quoteunquoteapps.com/weekendread/ app works. It lets you read screenplays on a smartphone, without the soul-sucking pain of pinching in and out of a PDF file. For me it was a great mix of
ease of use
combined withthe standard way
of screenplays.So I decided to throw together a PHP script to convert my
.fountain
files to such HTML, so that I could just share screenplay links with friends, and they could ready them with the same ease, as I had discovered on the https://quoteunquoteapps.com/weekendread/ app.Given the kind of fanboy I am of VSCode, I was like- lets see what is out there, and that's when I found your plugin, installed it immediately, and LOVED it.
Thanks for making this man. I look forward to sending some pull requests your way soon.
===
Here is the quick and dirty PHP I was on my way with before I found your plugin.
The text was updated successfully, but these errors were encountered: