PDF→EPUB: Visually clarify macros.

Only wrap the text that the user is supposed to enter in
<code>-tags. Before it was easy to misinterpret and enter extra spaces.
This commit is contained in:
tastytea 2021-03-16 00:37:32 +01:00
parent 3574b902d8
commit 255408907b
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 7 additions and 7 deletions

View File

@ -160,7 +160,7 @@ next paragraph and repeat…
Now you should have a text file with 1 paragraph per line. We need to wrap all
lines in `<p>` tags, except block quotes and sub-headlines. Either use another
macro (`<p> kbd:[<end>] </p> kbd:[<down>] kbd:[<down>] kbd:[<home>]`) or this
macro (`<p>` kbd:[<end>] `</p>` kbd:[<down>] kbd:[<down>] kbd:[<home>]) or this
elisp function:
[source,elisp]
@ -184,15 +184,15 @@ hyperlink-able, so we can't just wrap them in plain `<p>` tags, they need IDs. I
like to use `<span>1</span><p id="fn1">[…]</p>` if there is only one
footnote-section or `<span>1</span><p id="fn1_1">[…]</p>` for
chapter-footnotes. We are going to use a macro with a counter to generate
consecutively numbered IDs. First, set the counter to 1 with `kbd:[C-x]
kbd:[C-k] kbd:[C-c] 1`. Then, record this macro:
consecutively numbered IDs. First, set the counter to 1 with kbd:[C-x]
kbd:[C-k] kbd:[C-c] `1`. Then, record this macro:
`<span> kbd:[C-x] kbd:[C-k] kbd:[<tab>] kbd:[C-u] -1 kbd:[C-x] kbd:[C-k]
kbd:[C-a] </span><p id="fn kbd:[C-x] kbd:[C-k] kbd:[<tab>] "> kbd:[<end>] </p>
kbd:[<down>] kbd:[<down>] kbd:[<home>]`
`<span>` kbd:[C-x] kbd:[C-k] kbd:[<tab>] kbd:[C-u] `-1` kbd:[C-x] kbd:[C-k]
kbd:[C-a] `</span><p id="fn` kbd:[C-x] kbd:[C-k] kbd:[<tab>] `">` kbd:[<end>]
`</p>` kbd:[<down>] kbd:[<down>] kbd:[<home>]
[NOTE]
`kbd:[C-u] -1 kbd:[C-x] kbd:[C-k] kbd:[C-a]` “adds” -1 to the counter, so that
kbd:[C-u] `-1` kbd:[C-x] kbd:[C-k] kbd:[C-a] “adds” -1 to the counter, so that
we can use the same number again.
Call the macro until every footnote is wrapped and copy them to Calibre.