multiple HTML file creation for nonlinear story telling

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

Tue Jan 30, 2018 5:46 pm Post

(This post focuses on HTML because my understanding is EPUB and MOBI do not fully support what I'm about to suggest. I'd love to know if I'm mistaken.)

Suppose one wanted to write a Chose Your Own Adventure story. It seems to me that instead of generating a single monolithic HTML file, a more appropriate form would be to have multiple HTML files, where one is the starting point, and others are reached only through hyperlinks.

(Although my project is not an adventure story, it does have a similar nonlinear nature.)

I'd love to have this as an HTML-compile option... or to know if there's something I'm overlooking.

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

Tue Jan 30, 2018 6:45 pm Post

Epub and Mobi should be able to do this just fine. Internally, they are separate HTML files inside a zip file, and support linking between different documents. So this would be best done as an ePub ebook, I think.

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

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

Wed Jan 31, 2018 9:24 pm Post

Thanks, but it's not the linking between documents I'm concerned about; I'm concerned about restricting access to only the links, as opposed to letting the reader access all content by paging forward.

To make sure I'm clear about the restriction I'm referring to...
suppose "a.html" contains:

Code: Select all

The **ONLY** way to see the exciting conclusion is to use <a href="b.html">this link.</a>


I can create a MOBI containing a.html and b.html, and the link works fine. But in my trials, the reader can also read "b.html" by paging forward, which I don't want.

I was told MOBI doesn't support this. That's why I was hoping for a chance to achieve this through separate HTML file generation. If MOBI does in fact support this restriction, I'd love some hints on how to achieve it.

User avatar
Jaysen
Posts: 5883
Joined: Mon Dec 17, 2007 4:00 am
Platform: Mac + Windows
Location: East-Be-Jesus-Nowhere SC, USA

Thu Feb 01, 2018 12:40 am Post

How will a reader access these html files?
Jaysen

I have a wife and 2 kids that I can only attribute to a wiggle, a giggle, and the realization that she was out of my league so I might as well be happy with her as a friend. 24 years marriage later, I can't imagine life without her. -Me 10/7/09

Image

User avatar
kewms
Posts: 3731
Joined: Fri Feb 02, 2007 5:22 pm
Platform: Mac

Thu Feb 01, 2018 2:31 am Post

Jaysen wrote:How will a reader access these html files?


Would have to be some kind of web browser, it seems to me. Or a dedicated hypertext reader/authoring tool like StorySpace. (http://www.eastgate.com/storyspace/)

Katherine
Scrivener Support Team

User avatar
Jaysen
Posts: 5883
Joined: Mon Dec 17, 2007 4:00 am
Platform: Mac + Windows
Location: East-Be-Jesus-Nowhere SC, USA

Thu Feb 01, 2018 2:50 am Post

Which, to me, would be easy to circumvent and read in any order I want. I’m thinking, that to really prevent someone like me from skipping ahead, you’re looking at flash or some other encapsulating app.

Either way I wonder if maybe the issue isnt really worth the effort. Guys like me will almost always get to the data if we want too.

But I may be evil. :evil:
Jaysen

I have a wife and 2 kids that I can only attribute to a wiggle, a giggle, and the realization that she was out of my league so I might as well be happy with her as a friend. 24 years marriage later, I can't imagine life without her. -Me 10/7/09

Image

User avatar
kewms
Posts: 3731
Joined: Fri Feb 02, 2007 5:22 pm
Platform: Mac

Thu Feb 01, 2018 7:02 am Post

Well, presumably a reader who chooses a non-linear story has some willingness to "play along" with the trope and not put effort into circumventing it. So the mechanism doesn't need to be strong enough to withstand a dedicated attack, it just needs to prevent casual or accidental mis-navigation.

Katherine
Scrivener Support Team

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

Thu Feb 01, 2018 2:26 pm Post

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
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
rdale
Posts: 1156
Joined: Tue Jul 14, 2015 1:07 pm
Platform: Mac, Win + iOS
Location: St. Louis, MO
Contact:

Thu Feb 01, 2018 2:42 pm Post

Solution two: scramble the order of everything after the first entry. That's how physical "choose your own adventure" books used to work. Also, there are tools for building interactive fiction that might be better suited to obscuring the underlying story chapters. Here's a link to a number of open source tools I found at the top of a google search results page: https://itsfoss.com/create-interactive-fiction/
FKA: robertdguthrie
AKA: R Dale Guthrie, Robert, Mr. Obscure, and "Oh, it's you again".

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

Thu Feb 01, 2018 5:50 pm Post

rdale wrote:Solution two: scramble the order of everything after the first entry. That's how physical "choose your own adventure" books used to work. Also, there are tools for building interactive fiction that might be better suited to obscuring the underlying story chapters. Here's a link to a number of open source tools I found at the top of a google search results page: https://itsfoss.com/create-interactive-fiction/


That's a very good point - I could skip through the pages of the Choose Your Own Adventure books I had as a kid, so using an ebook would be no different from having a print version...
"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:

Thu Feb 01, 2018 6:57 pm Post

How about the new feature (ePub3/KF8) that can hide a Section Layout from typical navigation methods and make it only accessible via direct links? To test:

  1. Edit your compile format and go into the Section Layouts pane.
  2. Click on the layout currently being used for normal sections and click the + button to duplicate it.
  3. In the “Settings” tab, click the Hide section in e-book option.
  4. Save the format and back in the compile overview screen, click the Assign Section Layouts... button. Select the section type on the right, and assign your new “hidden” section layout to it.
  5. Finally, ensure Convert document links to HTML links is enabled in the general options tab on the right, and compile.

In my testing, whether or not it is really hidden is kind of up to the reader software. Calibre’s eBook viewer for example will blithely ignore that anything is hidden and allow full page to page navigation. But iBooks and Adobe Digital Editions (which together account for most eBook reading software and devices outside of Kindle) do seem to produce the desired result.

The main drawback is that normal page to page navigation becomes completely inoperable. You can page through a section, but once you get to the end of the section the only way out of it is through a hyperlink or via some “Back” button capability in the reader. That may however be considered a feature in this case.

I haven’t tested it, but this should work with Kindles as well.
.:.
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 9:53 pm Post

Jaysen wrote:How will a reader access these html files?


My intent is to have the content accessed through links.

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

Thu Feb 01, 2018 9:58 pm Post

kewms wrote:Well, presumably a reader who chooses a non-linear story has some willingness to "play along" with the trope and not put effort into circumventing it. So the mechanism doesn't need to be strong enough to withstand a dedicated attack, it just needs to prevent casual or accidental mis-navigation.

Katherine


Agreed, and well-put. I don't see being able to circumvent the trope as being any more of a problem than a reader being able to skip to the last chapter of a mystery novel.

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

Thu Feb 01, 2018 10:02 pm Post

KB wrote:One solution:

Compile to ePub [..] just keep the HTML, CSS and any image files you need for your book.



Excellent! Thanks for the idea. That should solve the HTML side; now to explore what's possible in EPUB (which I'm now considering thanks to Amber's post...)

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

Thu Feb 01, 2018 10:24 pm Post

AmberV wrote:How about the new feature (ePub3/KF8) that can hide a Section Layout from typical navigation methods and make it only accessible via direct links?
[..]
[3] In the “Settings” tab, click the Hide section in e-book option.


Thank you, this sounds promising! However, you lost me on step 3. This is what I see... am I in the wrong place?
Screen Shot 2018-02-01 at 3.16.03 PM.png
Screen Shot 2018-02-01 at 3.16.03 PM.png (242.97 KiB) Viewed 1091 times


AmberV wrote:I haven’t tested it, but this should work with Kindles as well.

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