Help with HTML?

po
pomme4mois
Posts: 207
Joined: Wed Aug 10, 2016 11:13 pm
Platform: Mac

Sat Oct 21, 2017 2:50 pm Post

I understand it is possible to insert an HTML link within a Scrivener manuscript, and that the link will be maintained in a compiled ePub. I'm struggling to make this work.

In the attached example, when I touch the word Source, I want to jump to the Destination paragraph within the same ePub. If anyone can show how to insert the necessary HTML link into the Scrivener manuscript, I would appreciate it. Thx

FYI: I know that Edit > Scrivener Link provides the ability to jump within a manuscript, but not at paragraph level. If I can't make this work, maybe I will have to restructure my binder entries, such that each paragraph is a separate binder text file.

Screen Shot 2017-10-21 at 09.45.34.png
Screen Shot 2017-10-21 at 09.45.34.png (301.58 KiB) Viewed 1658 times

Ma
Mac
Posts: 86
Joined: Tue Jun 19, 2012 11:28 am
Platform: Mac + iOS

Sat Oct 21, 2017 3:33 pm Post

<a href="#anchor1">Source Paragraph</a>
Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.

<a name="anchor1"></a>Destination Paragraph
Lorem ipsum. Lorem ipsum. Lorem ipsum.

Then:
1. Select HTML sections on each line (the parts in bold above) and use Format > Formatting > Preserve Formatting
2. When compiling to ePub, select Compile > HTML Settings > Treat "Preserve Formatting" blocks as raw HTML

po
pomme4mois
Posts: 207
Joined: Wed Aug 10, 2016 11:13 pm
Platform: Mac

Sat Oct 21, 2017 6:11 pm Post

Hi Mac. Thank you for responding. I followed the steps but the links still do not function. FYI I loaded the compiled ePub into iBooks and into Kindle Previewer. Do you see anything incorrect in the attached?

In Compile > HTML Settings, I noticed the "Underline links" box is ticked, but the links are not underlined in the ePub. Makes me wonder if I have something else wrong elsewhere.

Screen Shot 2017-10-21 at 13.05.05.png
Screen Shot 2017-10-21 at 13.05.05.png (352.1 KiB) Viewed 1624 times

Ma
Mac
Posts: 86
Joined: Tue Jun 19, 2012 11:28 am
Platform: Mac + iOS

Sat Oct 21, 2017 6:52 pm Post

Hi

If the anchor point is already visible from where the link is, the page won't scroll, as it has no need to scroll. Try adding in more words to the first paragraph to create a significant gap between the link and the anchor. Does it then scroll as you need?

In iBooks (on macOS), links are usually blue rather than underlined. If you want to force the underline, use the following:

<span style="text-decoration: underline;"><a href="#anchor1">Source Paragraph</a></span>

Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.
Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.
Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.

Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.

Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.

Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.
Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.
Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.
Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum.


<a name="anchor1"></a>Destination Paragraph

Hope this works as needed. Does work in my local tests.

Sample Scrivener file and ePub attached.

Mac

ScrivenerTest.zip
(112.31 KiB) Downloaded 162 times

po
pomme4mois
Posts: 207
Joined: Wed Aug 10, 2016 11:13 pm
Platform: Mac

Sun Oct 22, 2017 3:15 pm Post

Thank you Mac. I really appreciate you taking the time to create a working example. It really helps. I noticed your ZIP file has been downloaded 11 times so far - so others found it useful too.

Thanks again!

Ma
Mac
Posts: 86
Joined: Tue Jun 19, 2012 11:28 am
Platform: Mac + iOS

Sun Oct 22, 2017 4:24 pm Post

Happy to help. Hope it works as you need it to.