Skip to content

Commit 716b290

Browse files
committed
Various fixes for Glow-worm
* Stop justifying all text. We previously tried to un-justify some bold "heading" paragraphs only, but several slipped through, and in general it fits the tone of online conversations better to look more "computer-like" and less "book-like". * Stop fixing up hyphens, dashes, capitalizations (e.g. "earths" vs. "Earths"), standardized spellings ("ok" vs. "okay"), etc. These fixes do not apply to online conversations. * Stop un-capitalizing the "/Kill" command. It seems possible that this works capitalized, and most commands typed by Kenzie are capitalized, so this sticks better to author intent. There's also the chance that it's significant, as she has a small line about watching her capitalization and punctuation, and as she gets a bit down, she stops capitalizing the last two commands. * Fix a couple of inconsistent names: "JohnsonJar" vs. "Johnsonjar" and "FlyingKevin" vs. "Flying_Kevin". * Fix a few instances of misplaced bolding on usernames (the logged-in user's name is supposed to be bold). * Fix a few instances of bad paragraph breaks vs. line breaks in chat conversations. This also includes a bolding spot-fix for Ward Last 20.e5.
1 parent 67ec627 commit 716b290

File tree

4 files changed

+77
-27
lines changed

4 files changed

+77
-27
lines changed

lib/convert-worker.js

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getChapterString(chapter, bookTitle, chapterSubstitutions, rawChapterDo
3131
<!DOCTYPE html>
3232
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
3333
itemscope="itemscope" itemtype="https://schema.org/Chapter"
34-
itemid="${chapter.url}" class="chapter">
34+
itemid="${chapter.url}" class="chapter ${bookTitle}">
3535
<head>
3636
<meta charset="utf-8"/>
3737
<title>${chapter.usedTitle}</title>
@@ -241,6 +241,7 @@ function getBodyXML(chapter, bookTitle, chapterSubstitutions, contentEl) {
241241
xml = xml.replace(/<br \/>(\s*)<\/strong>/ug, "</strong><br />$1");
242242
xml = xml.replace(/(\s*)<\/strong>/ug, "</strong>$1");
243243
xml = xml.replace(/><strong>(.*)<\/strong>:</ug, "><strong>$1:</strong><");
244+
xml = xml.replace(/<strong><br \/>\n/ug, "<br />\n<strong>");
244245

245246
// No need for line breaks before paragraph ends or after paragraph starts
246247
// These often occur with the <br>s inside <b>/<strong>/<em>/<i> fixed above.
@@ -275,20 +276,25 @@ function getBodyXML(chapter, bookTitle, chapterSubstitutions, contentEl) {
275276
"🤨"
276277
);
277278

278-
xml = fixTruncatedWords(xml);
279-
xml = fixDialogueTags(xml);
280-
xml = fixForeignNames(xml);
279+
// This needs to happen before other name-related fixes.
281280
xml = standardizeNames(xml);
282-
xml = fixEmDashes(xml);
283-
xml = enDashJointNames(xml);
284-
xml = fixPossessives(xml);
281+
282+
// Glow-worm is a bunch of people posting online, so they rarely use proper punctuation or standardized spelling, etc.
283+
if (bookTitle !== "Glow-worm") {
284+
xml = fixTruncatedWords(xml);
285+
xml = fixDialogueTags(xml);
286+
xml = fixForeignNames(xml);
287+
xml = fixEmDashes(xml);
288+
xml = enDashJointNames(xml);
289+
xml = fixPossessives(xml);
290+
xml = fixCapitalization(xml, bookTitle);
291+
xml = fixMispellings(xml);
292+
xml = fixHyphens(xml);
293+
xml = standardizeSpellings(xml);
294+
xml = fixCaseNumbers(xml);
295+
}
285296
xml = cleanSceneBreaks(xml);
286-
xml = fixCapitalization(xml, bookTitle);
287-
xml = fixMispellings(xml);
288-
xml = fixHyphens(xml);
289-
xml = standardizeSpellings(xml);
290-
xml = fixCaseNumbers(xml);
291-
xml = fixParahumansOnline(xml, bookTitle);
297+
xml = fixParahumansOnline(xml);
292298

293299
// One-off fixes
294300
for (const substitution of chapterSubstitutions) {
@@ -411,6 +417,12 @@ function standardizeNames(xml) {
411417
// 73 instances of Über to 2 of Uber
412418
xml = xml.replace(/Uber/ug, "Über");
413419

420+
// 5 instances of Johnsonjar to 2 instances of JohnsonJar
421+
xml = xml.replace(/JohnsonJar/ug, "Johnsonjar");
422+
423+
// 4 instances of Flying_Kevin to 2 instances of FlyingKevin
424+
xml = xml.replace(/FlyingKevin/ug, "Flying_Kevin");
425+
414426
return xml;
415427
}
416428

@@ -826,7 +838,7 @@ function fixCaseNumbers(xml) {
826838
return xml;
827839
}
828840

829-
function fixParahumansOnline(xml, bookTitle) {
841+
function fixParahumansOnline(xml) {
830842
xml = xml.replaceAll("Using identity</strong> “<strong>", "Using identity “");
831843
xml = xml.replaceAll(
832844
`Forum <span style="text-decoration: underline;">thread.</span>`,
@@ -845,10 +857,6 @@ function fixParahumansOnline(xml, bookTitle) {
845857
`You are currently logged in, <strong><span style="text-decoration: underline;">$1</span></strong>`
846858
);
847859

848-
// /kill should be always lowercase, since it's a bot-command.
849-
// The leading space is important to avoid catching "Kiss/Kill".
850-
xml = xml.replaceAll(" /Kill", " /kill");
851-
852860
// Most cases have the colon but some don't.
853861
xml = xml.replace(/(Replied on \w+ \d{1,2}(?:st|nd|rd|th),? ?Y?\d*)<br \/>/ug, "$1:<br />");
854862

@@ -858,12 +866,7 @@ function fixParahumansOnline(xml, bookTitle) {
858866
// It's inconsistent to exclude the punctuation from the bolding; fix it.
859867
xml = xml.replace(/<strong>Welcome back to (.+?)<\/strong>!/ug, "<strong>Welcome back to $1!</strong>");
860868

861-
// Glow-worm has some bold paragraphs that look quite bad when justified, so try to force left-alignment.
862-
// Don't apply this globally, e.g. to <body>, because there are some long messages, transcribed articles, etc. where
863-
// justification is nice.
864-
if (bookTitle === "Glow-worm") {
865-
xml = xml.replace(/<p><strong>(.*)<\/strong><br \/>/ug, `<p style="text-align: left;"><strong>$1</strong><br />`);
866-
}
869+
xml = xml.replace(/<p> <strong>(.*)<\/strong><\/p>/ug, `<p><strong>♦ $1</strong></p>`);
867870

868871
return xml;
869872
}

scaffolding/OEBPS/chapter.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@
2323
:root.chapter h1 {
2424
text-align: center;
2525
}
26+
27+
:root.Glow-worm p {
28+
text-align: left;
29+
}

substitutions/glow-worm.subs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,44 @@
11
@ https://www.parahumans.net/2017/10/21/glow-worm-0-1/
2-
- <p><em>Ward is the second work in the Parahumans series, and reading</em> <strong><a href="https://parahumans.wordpress.com/">Worm</a></strong> <em>first is strongly recommended. A lot of this won’t make sense otherwise and if you do find yourself a fan of the universe, the spoilers in Ward will affect the reading of the other work.</em></p>\n<p><em>Ward is not recommended for young or sensitive readers.</em></p>\n<p><em>The Glow-worm chapters were a teaser event leading up to Worm 2. They aren’t required reading but offer flavor and additional angles by which to view certain characters. They take the form of forum posts, chat conversations and emails.</em></p>\n<p><em>They’re best described as a kind of a post-epilogue, pseudo-prologue bridge between the series. Those who read them on the Worm site shouldn’t feel the need to read them again—they’re included here for convenience’s sake, with a few readability improvements.</em></p>\n<p>If you’re not interested or find this hard to read, click <a href="/2017/09/11/daybreak-1-1/"><strong>here</strong></a> to jump to chapter 1.</p>\n<p style="text-align: center;">⊙</p>\n
2+
- <p><em>Ward is the second work in the Parahumans series, and reading</em> <strong><a href="https://parahumans.wordpress.com/">Worm</a></strong> <em>first is strongly recommended. A lot of this won’t make sense otherwise and if you do find yourself a fan of the universe, the spoilers in Ward will affect the reading of the other work.</em></p>\n<p><em>Ward is not recommended for young or sensitive readers.</em></p>\n<p><em>The Glow-worm chapters were a teaser event leading up to Worm 2. They aren’t required reading but offer flavor and additional angles by which to view certain characters. They take the form of forum posts, chat conversations and emails.</em></p>\n<p><em>They’re best described as a kind of a post-epilogue, pseudo-prologue bridge between the series. Those who read them on the Worm site shouldn’t feel the need to read them again – they’re included here for convenience’s sake, with a few readability improvements.</em></p>\n<p>If you’re not interested or find this hard to read, click <a href="/2017/09/11/daybreak-1-1/"><strong>here</strong></a> to jump to chapter 1.</p>\n<p style="text-align: center;">⊙</p>\n
33
+
44
# This is out of place in an ebook.
5+
6+
- they’re aloof.<br />\nI say
7+
+ they’re aloof.</p>\n<p style="padding-left: 30px;">I say
8+
9+
@ https://www.parahumans.net/2017/10/26/glow-worm-0-3/
10+
- <strong> Point_Me_@_The_Sky:</strong>
11+
+ Point_Me_@_The_Sky:
12+
# Only the logged-in user is bolded in PHO conversations.
13+
14+
@ https://www.parahumans.net/2017/10/28/glow-worm-0-4/
15+
r <br />\n<strong><br />\nof5
16+
s </p>\n<p style="padding-left: 30px;"><strong>of5
17+
18+
- Researching.<br />\nHeart_Shaped_Pupil:
19+
+ Researching.</p>\n<p style="padding-left: 30px;">Heart_Shaped_Pupil:
20+
21+
- you’ve talked about 😉 ?<br />\n<strong>of5</strong>:
22+
+ you’ve talked about 😉 ?</p>\n<p style="padding-left: 30px;"><strong>of5</strong>:
23+
24+
- technical side, searches.<br />\nHeart_Shaped_Pupil:
25+
+ technical side, searches.</p>\n<p style="padding-left: 30px;">Heart_Shaped_Pupil:
26+
27+
- good to our R!<br />\n<strong>of5</strong>:
28+
+ good to our R!</p>\n<p style="padding-left: 30px;"><strong>of5</strong>:
29+
30+
- I owe you one.<br />\nQuestionable_Mammal:
31+
+ I owe you one.</p>\n<p style="padding-left: 30px;">Questionable_Mammal:
32+
33+
- give on next meet.<br />\n<strong>of5</strong>:
34+
+ give on next meet.</p>\n<p style="padding-left: 30px;"><strong>of5</strong>:
35+
36+
- …go keep researching<br />\nHeart_Shaped_Pupil: entertain lady friend!<br />\nQuestionable_Mammal:
37+
+ go keep researching</p>\n<p style="padding-left: 30px;">Heart_Shaped_Pupil: entertain lady friend!</p>\n<p style="padding-left: 30px;">Questionable_Mammal:
38+
39+
- a plan of action later.<br />\nHeart_Shaped_Pupil: we’ll figure out a plan of action later &gt;:)<br />\n<strong>of5</strong>:
40+
+ a plan of action later.</p>\n<p style="padding-left: 30px;">Heart_Shaped_Pupil: we’ll figure out a plan of action later &gt;:)</p>\n<p style="padding-left: 30px;"><strong>of5</strong>:
41+
42+
@ https://www.parahumans.net/2017/10/31/glow-worm-0-6/
43+
- <p>A_real: Hello. Thank you for the prompt response. I’m Sydney</p>\n<p>Curious_Cephalopod: I can guess what this is about</p>
44+
+ <p style="padding-left: 30px;">A_real: Hello. Thank you for the prompt response. I’m Sydney</p>\n<p style="padding-left: 30px;"><strong>Curious_Cephalopod:</strong> I can guess what this is about</p>

substitutions/ward.subs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3602,8 +3602,11 @@
36023602
- listening, lost in tinkering—</p>
36033603
+ listening, lost in tinkering—”</p>
36043604

3605-
- <p>:Transmit<strong><br />\nI’ve got
3606-
+ <p style="padding-left: 30px;">:Transmit<strong><br />I’ve got
3605+
- <strong>:</strong>Transmit<br />
3606+
+ :Transmit<br />
3607+
3608+
- <p>:Transmit<br />\n<strong>I’ve got
3609+
+ <p style="padding-left: 30px;">:Transmit<br />\n<strong>I’ve got
36073610

36083611

36093612
@ https://www.parahumans.net/2020/04/28/last-20-e6/

0 commit comments

Comments
 (0)