From 334753103c002111a839ce7f1e03ac24e24654d0 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sun, 13 Jun 2021 11:39:34 -0500 Subject: [PATCH] Fix quote style in step by step guide to prevent ! from becoming history expansion --- www/contribute/producing-an-ebook-step-by-step.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/contribute/producing-an-ebook-step-by-step.php b/www/contribute/producing-an-ebook-step-by-step.php index 9727b755..e58c35f2 100644 --- a/www/contribute/producing-an-ebook-step-by-step.php +++ b/www/contribute/producing-an-ebook-step-by-step.php @@ -115,7 +115,7 @@ proceed to seal up my confession, I bring the life of that unhappy Henry Jekyll

The file we downloaded contains the entire work. Jekyll is a short work, but for longer work it quickly becomes impractical to have the entire text in one file. Not only is it a pain to edit, but ereaders often have trouble with extremely large files.

The next step is to split the file at logical places; that usually means at each chapter break. For works that contain their chapters in larger “parts,” the part division should also be its own file. For example, see Treasure Island.

To split the work, we use se split-file. se split-file takes a single file and breaks it in to a new file every time it encounters the markup <!--se:split-->. se split-file automatically includes basic header and footer markup in each split file.

-

Notice that in our source file, each chapter is marked with an <h2> element. We can use that to our advantage and save ourselves the trouble of adding the <!--se:split--> markup by hand:

sed --in-place "s|<h2|<!--se:split--><h2|g" src/epub/text/body.xhtml +

Notice that in our source file, each chapter is marked with an <h2> element. We can use that to our advantage and save ourselves the trouble of adding the <!--se:split--> markup by hand:

sed --in-place 's|<h2|<!--se:split--><h2|g' src/epub/text/body.xhtml

Now that we’ve added our markers, we split the file. se split-file puts the results in our current directory and conveniently names them by chapter number.

se split-file src/epub/text/body.xhtml mv chapter* src/epub/text/

Once we’re happy that the source file has been split correctly, we can remove it.

rm src/epub/text/body.xhtml @@ -271,7 +271,7 @@ proceed to seal up my confession, I bring the life of that unhappy Henry Jekyll
  • Semantics rules for abbreviations. Abbreviations should always be wrapped in the <abbr> element and with the correct class attribute.

    Specifically, see the typography rules for initials. Wrap people’s initials in <abbr class="name">. This command helps wrap initials:

    - se interactive-replace "(?<\!<abbr[^<]*?>)([A-Z]\.(\s?[A-Z]\.)*)(?\!</abbr>|”)" "<abbr class=\"name\">\1</abbr>" src/epub/text/* + se interactive-replace '(?<!<abbr[^<]*?>)([A-Z]\.(\s?[A-Z]\.)*)(?!</abbr>|”)' '<abbr class="name">\1</abbr>' src/epub/text/*
  • Typography rules for times. Wrap a.m. and p.m. in <abbr class="time"> and add a no-break space between digits and a.m. or p.m.

    @@ -375,7 +375,7 @@ proceed to seal up my confession, I bring the life of that unhappy Henry Jekyll - se interactive-replace '(?<![Ee]ach and )([Ee])very one(?!\s+of)' "\1veryone" src/epub/text/* + se interactive-replace '(?<![Ee]ach and )([Ee])very one(?!\s+of)' "\1veryone" src/epub/text/*
  • every thing ➔ everything

    @@ -463,7 +463,7 @@ proceed to seal up my confession, I bring the life of that unhappy Henry Jekyll - se interactive-replace '(?<!in\s+)\b([Aa])ny way(?!\s+(?:of|to))' "\1nyway" src/epub/text/* + se interactive-replace '(?<!in\s+)\b([Aa])ny way(?!\s+(?:of|to))' "\1nyway" src/epub/text/*
  • mean time ➔ meantime