commit 88fc6be7078ba7c6768ca08dc29d84fc71e77793
parent aba8adb35f8d45290a790b4cfd47b71ccaa40b94
Author: St John Karp <contact@stjo.hn>
Date:   Sun, 30 Jan 2022 11:49:24 -0500
Remove JavaScript and Prince-related CSS
Removed JavaScript, which I'd used previously when this was designed
to integrate with Prince, and its related CSS. When using open-source
tools like wkhtmltopdf, these should be handled using command-line
options as documented in the examples in the readme.
Diffstat:
5 files changed, 34 insertions(+), 61 deletions(-)
diff --git a/README.md b/README.md
@@ -68,7 +68,35 @@ Finally, at the very end of your script, you write "The End." — and you're don
 ### Example Usage
 
 ```
-swipl --traditional -l playfair.pl -g 'play_to_html' < script.txt
+swipl --traditional -l playfair.pl -g 'play_to_html' < script.txt > script.html
+
+# For screenplays.
+wkhtmltopdf --enable-local-file-access \
+	--margin-bottom 1in \
+	--margin-top 1in \
+	--margin-right 1in \
+	--margin-left 1.5in \
+	--page-size letter \
+	--header-right '[page].' \
+	--header-font-name Courier \
+	--header-font-size 10
+	cover cover.html \
+	page script.html \
+	script.pdf
+
+# For stage plays.
+wkhtmltopdf --enable-local-file-access \
+	--margin-bottom 1in \
+	--margin-top 1in \
+	--margin-right 1in \
+	--margin-left 1.5in \
+	--page-size letter \
+	--header-right 'TITLE / [page]' \
+	--header-font-name Courier \
+	--header-font-size 10
+	cover cover.html \
+	page script.html \
+	script.pdf
 ```
 
 ## To-Do
diff --git a/common.css b/common.css
@@ -1,45 +1,19 @@
-@page {
-	margin: 1in 1in 1in 1.5in;
-	size: 8.5in 11in;	/* Letter paper */
-	@top-right {
-		font-family: monospace;
-		font-size: 12pt;
-	}
-}
-
-@page meta {
-	@top-right {
-		content: normal;
-	}
-}
-
-body {
-	font-family: monospace;
+* {
+	font-family: Courier, monospace;
 	font-size: 12pt;
-}
-
-div#titlepage,div#metapage {
-	page: meta;
-	page-break-after: always;
-}
-
-div#play {
-	counter-reset: page 1;
+	font-style: normal;
+	font-weight: normal;
+	margin: 0;
 }
 
 h1 {
 	page-break-after: avoid;
-	string-set: title content();
 	text-align: center;
-	font-size: 1em;
-	font-style: normal;
-	font-weight: normal;
 }
 
 p#author {
 	margin-top: 0.83em;
 	margin-bottom: 0.83em;
-	string-set: author content();
 	text-align: center;
 }
 
@@ -58,10 +32,6 @@ div.dialogue {
 	page-break-inside: avoid;
 }
 
-p {
-	margin-top: 0;
-}
-
 p.character {
 	margin-top: 1em;
 	margin-bottom: 0.04in;
@@ -88,6 +58,5 @@ p.characterStageDirections {
 }
 
 em {
-	font-style: normal;
 	text-decoration: underline;	
 }
diff --git a/javascript.js b/javascript.js
@@ -1,10 +0,0 @@
-function upperCase(text) {
-	return text.toUpperCase();
-}
-
-function getAuthor() {
-	return document.getElementById('authortag').getAttribute('last').toUpperCase();
-}
-
-Prince.addScriptFunc("upperCase", upperCase);
-Prince.addScriptFunc("getAuthor", getAuthor);
-\ No newline at end of file
diff --git a/scriptfrenzy_screen.css b/scriptfrenzy_screen.css
@@ -1,12 +1,5 @@
-@page {
-	@top-right {
-		content: counter(page) ".";
-	}
-}
-			
 h2.slug {
 	font-size: 1em;
-	font-weight: normal;
 	margin-top: 1em;
 }
 
diff --git a/scriptfrenzy_stage.css b/scriptfrenzy_stage.css
@@ -1,9 +1,3 @@
-@page {
-	@top-right {
-		content: prince-script(upperCase, string(title, first)) " / " counter(page);
-	}
-}
-			
 h3.actScene {
 	font-size: 1em;
 	page-break-before: always;