multiple HTML file creation for nonlinear story telling

User avatar
AmberV
Posts: 21545
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Thu Feb 01, 2018 10:34 pm Post

You need to be editing the format itself, rather than the project’s compile settings (which can be seen in the screenshot). Over in the leftmost column are your formats. Right-click on the one that is highlighted and edit it. You might need to duplicate it first if it is a built-in format. The instructions should make more sense once you’re in the right place.

Ah, but Kindles don’t support EPUB. Or did you mean to use the same compile technique for MOBI?


Well yes and no. KDP does accept ePub files on upload (they will convert it for you to a format Kindles can read), but you can also compile straight out of Scrivener using the “KF8” compile type, at the top. I’d recommend the latter along with some testing in their software/devices since this is an unusual approach.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

bo
bostonquad
Posts: 38
Joined: Tue Nov 28, 2017 7:12 pm
Platform: Mac

Thu Feb 01, 2018 10:42 pm Post

rdale wrote:Solution two: scramble the order of everything after the first entry.
[..]
Also, there are tools for building interactive fiction that might be better suited to obscuring the underlying story chapters.


Thanks for the suggestions. In my case, I don't see scrambling the order to be as helpful as it would be for an adventure story. (I used Choose Your Own Adventure as a close-enough reference point. I'm writing a Platonic dialog and I want to encourage the reader to pursue whatever points pique their interest. It remains to be seen whether it's desirable to implement a Platonic dialog this way, but I want to try it.)

It's good to learn the existence of these tools (also of Storyspace; thanks Katherine), but I'd like output that can be consumed by standard ebook readers.

bo
bostonquad
Posts: 38
Joined: Tue Nov 28, 2017 7:12 pm
Platform: Mac

Fri Feb 02, 2018 12:06 am Post

AmberV wrote:The instructions should make more sense once you’re in the right place.


Ah, yes, thank you.

I think I followed the instructions (.scriv file attached in case you can point out where I did not), and generated an epub file. Here's what I found:

In iBooks, I can't get past the TOC. (Could be something simple I'm doing wrong?)
In Adobe Digital Editions, the content is not hidden as desired.

I also tried compiling without the option "Generate HTML table of contents" in an attempt to test in iBooks. This time, iBooks reported the file was corrupt, and Adobe Digital Editions reported "Errors were encountered in this item".

As always, I appreciate any insight.
Nonlinear Test.scriv.zip
(13.69 KiB) Downloaded 35 times

User avatar
KB
Site Admin
Posts: 19840
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Fri Feb 02, 2018 12:07 pm Post

You're just in the basic options there - you'll need to delve a bit deeper for this by creating your own Compile format. Click on the gear icon below the Formats list and either create a new Format or duplicate and edit the Ebook format. You'll most likely want to check out our video tutorials on Compile at this point, because once you start editing and creating Compile formats there are a lot of options. :)

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
AmberV
Posts: 21545
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Fri Feb 02, 2018 12:41 pm Post

Great, it looks like you have all of the major ingredients in place and figured out. There are a few tweaks you would need to make in order to make this approach work, and ultimately work more intuitively:

  • You probably do not need the HTML ToC since there is only one point of entry for the rest of the book—but I would consider adding an informal one, one that actually does have a cheat sheet list to every section, but isn’t designated as a regular ToC. Why? If someone loses their place somehow, they will be entirely unable to get back to where they were, short of following the whole long chain all over again—a bit like watching a David Lynch DVD. So some kind of “appendix” entry at the end that maybe has a paragraph explaining spoilers are to follow, and the role of the hyperlink list, could be valuable.

    So in the ToC tab of the compile overview screen, I disabled Generate HTML table of contents (I believe you got errors trying that before because removing that section left not a single public section available, thanks to the problem described in the next bullet). I didn’t bother making a cheat sheet for this simple test—I just mention that more for future reference. It isn’t necessary to making this technique work.
  • Next up: the reason your sample isn’t working properly is that your “Hidden” Section Layout isn’t generating proper section breaks. If you look at the Section Layouts preview column in compile overview, you’ll note that the “Hidden” preview tile stipulates section breaks will occur for folders only. So what is happening is “The end!” is getting glued onto the end of the one section you meant to have as the entry point, which is in turn making that section invisible as well. Thus the only visible content in your eBook is the ToC page, which is empty because all sections in the book are invisible.

    Solution: go into the Separators compile format pane and for the “Hidden” layout, disable defaults. That should be all you need to do, since your underlying settings for that layout are for “Section Breaks” both before and between hidden sections.
  • The last ingredient you need to make this work is hyperlinks. :) Back in the general options tab on the overview screen (where you posted your initial screenshot), ensure Convert document links to HTML links is enabled. At the moment your link to “The end!” is stripped out, leaving it entirely inaccessible.

Give that a test compile, and now you should have a book that opens directly to the starter page.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

bo
bostonquad
Posts: 38
Joined: Tue Nov 28, 2017 7:12 pm
Platform: Mac

Fri Feb 02, 2018 9:34 pm Post

AmberV wrote:Give that a test compile, and now you should have a book that opens directly to the starter page.


Yes, thank you for that explanation and the detailed steps... I got the restricted content aspect to work in iBooks!

Here's where my "restricted content" testing stands...
iBooks handles an ePub with restricted content properly. ✅
Adobe Digital Editions 4.5 does not. ❌
Calibre 3.16.0 does not. ❌
Kindle Previewer 3.17.1 does not. ❌
Kindle app on Mac, Kindle app on iPhone, and Kindle Paperwhite do not correctly handle a mobi file generated from Scrivener in the same way as the ePub. ❌
It will work in web browsers when the HTML is broken up properly. ✅

Well, 2 out of 6 ain't bad. Actually, it is rather bad. Maybe more support will come in time.

In any case, it looks like Scrivener is doing all it can do to support this feature, so I'm happy with it. Also, I love the support and responsiveness of this forum. Thanks everyone!

User avatar
KB
Site Admin
Posts: 19840
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Fri Feb 02, 2018 10:05 pm Post

I can't believe I forgot about that option!

The way this works, incidentally, is that when you tell Scrivener to hide the section in the eBook, it gets the "Linear" attribute for the section element in the OPF XML of the ebook to "No" - this means that it will not be navigable when you move through the book linearly. Looking at this discussion on the Kindle forums, it seems that the Kindle does not yet support this flag. The OPF file is part of the epub format, and Kindle files are created by converting a bunch of files that epubs also use using Amazon's kindlegen utility. So, hopefully Amazon will add this feature at some point. I'll need to do a little more research, because I might need to remove this option from the Kindle format if it has no effect.

Digital Editions has no excuse, though! It's part of the epub specifications, so if Digital Editions isn't respecting it then they are not implementing epub support correctly...

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
llis
Posts: 5
Joined: Thu Dec 12, 2013 4:36 pm
Platform: Mac
Contact:

Sun Feb 04, 2018 3:39 pm Post

There are also the softer means of encouraging reader compliance:

* Link to anchors down low on pages (link not to targetpage.xhtml but targetpage.xhtml#nextaction. Fill the upper part of the pages with warnings of spoilers.

* Shuffle the order of the xhtml files so that anyone just trying to page through will get nothing but a jumble.

* Include in your navigation TOC only a few pages, like a How to experience this interactive story page, plus some common backmatter material. (Amazon's conversion process may try to force the issue and index everything, but if you have no H elements, maybe they won't. I haven't tested that. And you could also just include major inflection points in the story, like "Will Joe catch the bus?" so people can jump to points again in case they get lost.)

* Any html TOC can go at the end of the book.

This is all pretty straightforward if you're getting into the epub code in an app like Sigil.

bo
bostonquad
Posts: 38
Joined: Tue Nov 28, 2017 7:12 pm
Platform: Mac

Mon Feb 05, 2018 6:51 am Post

KB wrote:[..] it seems that the Kindle does not yet support this flag. [..]
Digital Editions has no excuse, though! It's part of the epub specifications, so if Digital Editions isn't respecting it then they are not implementing epub support correctly...

Thanks Keith... I suspected the mobi spec didn't try to support this. And it's good to know that up-to-spec epub readers are supposed to.

bo
bostonquad
Posts: 38
Joined: Tue Nov 28, 2017 7:12 pm
Platform: Mac

Tue Feb 06, 2018 5:27 am Post

llis wrote:There are also the softer means of encouraging reader compliance [..]

Thanks for the tips, Ilis.

User avatar
AmberV
Posts: 21545
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Tue Feb 06, 2018 11:16 am Post

ADE is a mixed bag from what I can see. It does, at least for me, restrict navigation to the initial section, and none of the keyboard shortcuts or associated menu commands for flipping to the Next or Previous page are functional. The result of the test .epub is a single screen book. Likewise you cannot click the Left and Right buttons in the footer bar.

But you can scroll manually through the book content and get into hidden sections while doing so. Thus that scrubber must not be attached to any of the standard ePub navigation controls.

That’s probably a good sign for those physical reader devices based on the ADE engine. The GUI scrubber isn’t a feature that is present on most book readers.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

bo
bostonquad
Posts: 38
Joined: Tue Nov 28, 2017 7:12 pm
Platform: Mac

Mon Feb 12, 2018 11:16 pm Post

AmberV wrote:[..]none of the keyboard shortcuts or associated menu commands for flipping to the Next or Previous page are functional. [..] The GUI scrubber isn’t a feature that is present on most book readers.


Good to know... thanks Amber! If I have a chance to test that on Nook or Kobo, I'll report the results.

bo
bostonquad
Posts: 38
Joined: Tue Nov 28, 2017 7:12 pm
Platform: Mac

Tue Feb 13, 2018 12:52 am Post

KB wrote:One solution:

1. Compile to ePub.

2. In the options area of Compile, tick "Save source files in a folder with exported ePub file".

3. Discard all the files you don't need (the .ePub file, contents file etc) and just keep the HTML, CSS and any image files you need for your book.

All the best,
Keith


Just got around to trying this. I was assuming I'd find an HTML file per binder document; instead I find a single body.xhtml (not counting contents.xhtml). Is there an option I missed? (The idea being that the reader can't simply scroll ahead.)

User avatar
AmberV
Posts: 21545
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Tue Feb 13, 2018 10:23 am Post

Try testing a project with more than one section break in it. A section break is the marker that indicates a new internal file in an ePub document.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

bo
bostonquad
Posts: 38
Joined: Tue Nov 28, 2017 7:12 pm
Platform: Mac

Wed Feb 14, 2018 5:23 am Post

AmberV wrote:Try testing a project with more than one section break in it.

Aha! Thanks for helping out this newbie, who needs to take Keith's advice to check out the compile tutorials. :|