Answers.Body: <p>as suggested by "idiotprogrammer" it is possible to add such documents that are not part of the 'normal' reading flow.</p>
  
  <p>for instance while using the a2x epub generator from ASCIIDOC it is possible to add html documents that are listed in a RESOURCE_MANIFEST file. these documents are added in the OEBPS directory (in my case in a 'labs' subdirectory of OEBPS) and are not listed as part of the normal flow.</p>
  
  <p>BUT (there is a but) behaviour depends on the epub reader you use: Mac's Ibook works perfectly (you have special window for this lab document and you can come back to the book) but Calibre passes the document to your browser (which is not the thing I would expect) </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-09T15:07:02.657Z
Answers.Text: after other tests here are the things to do: documents should be added in the list of items AND in the spine with mention linear="no" -> in that case it seems to work everywhere (but is is not easy to automatize the creation of the opf file ... stil wondering to do that - using an ed script can be done but is complex-)
Answers.UserDisplayName: bear
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-09T11:49:18.153Z
Answers.LastActivityDate: 2017-10-09T11:49:18.153Z
Answers.UserDisplayName: bear
Answers.Body: <p>I don't really understand the question, but it is possible for an epub file to contain html files which do not appear in the main navigation document. They can be accessed indirectly through hyperlinks within the HTML document. </p>
  
  <p>See the answer I gave for a different but related question here: <a href="https://ebooks.stackexchange.com/a/7211/417">https://ebooks.stackexchange.com/a/7211/417</a></p>
  
  <p>By the way, if that is your question,  I recommend ignoring the epub2 way to do it and just do it the epub3 way. A lot of reading systems (including the Kindle ones) are ignoring the toc.ncx document if you have a <strong><code>&lt;nav epub:type="toc"&gt;</code></strong> element. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-08T19:27:03.333Z
Answers.Text: for sure my goal is not clear enough so let's try to clarify: I will get a book where 'normal' flow will be chapt1 then chapt2 ... at the end of chapt1 you may click on a link to read a document named labs1 then you go read this document (if needed) then go back to the end of chapt1. The labs1 document is hosted into the epub file. So instead of having a list of documents (the normal flow) you have a "tree" of documents.
Answers.UserDisplayName: bear
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-08T19:59:42.597Z
Answers.Text: So you want the docs to be included in the epub or external to it? If included and if the docs are HTML files, then you could simply link to them in such a way: href="otherdoc1.html", href="otherdoc2.html" href="otherdoc3.html"   but not have otherdoc1.html listed in the navigation document. Note that the file needs to be still listed in the package.opf file.
Answers.UserDisplayName: idiotprogrammer
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-09T09:55:15.463Z
Answers.Text: yes I want to have these files included in the epub document. I will try your solution and report the results. Thanks
Answers.UserDisplayName: bear
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-08T18:45:54.890Z
Answers.LastActivityDate: 2017-10-08T18:45:54.890Z
Answers.UserDisplayName: idiotprogrammer
Answers.Body: <p>apparently there is no need in readers to create another anchor to go back to the main flow (tested with Ibook and Calibre) 
  just adding correctly the documents in the opf file does work (plus the link from the master flow to the "non linear" documents)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-13T20:57:23.340Z
Answers.LastActivityDate: 2017-10-13T20:57:23.340Z
Answers.UserDisplayName: bear
Answers.Body: <p>The link to the file would look like: <code>file://mydir/myfile.txt</code>. But that doesn't mean the editor (like Calibre) would make a valid link out of that.
  Most programs only look for links that begin with "http://", "https://" or "ftp://" and do not linkify anything else.</p>
  
  <p>On a similar note you would create text like "click here for the lab", select that text, and create a link to "file://mydir/myfile.txt".</p>
  
  <p>So, where your epub is stored, you have to have a folder called "mydir" and under that would be "myfile.txt". The directory tree would look like this: </p>
  
  <p><code>
  myepub.epub
  mydir\myfile.txt
  </code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-22T12:25:08.003Z
Answers.LastActivityDate: 2017-11-22T12:25:08.003Z
Answers.UserDisplayName: Bulrush
Answers.Body: <p>I am not sure it's what you want/need, but the easiest way to do it is to add an (internal) anchor to the addendum, and at the end of the addendum another anchor to go back to the main flow. </p>
  
  <p>If the addenda are short, you may also consider putting them in footnotes.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-12T17:26:50.990Z
Answers.LastActivityDate: 2017-10-12T17:26:50.990Z
Answers.UserDisplayName: mau
Body: <p>Trying to explain the title: I am creating an EPUB document which is a programming course. In the document I want to refer to texts describing labs: these are not in the main flow of the main document: you can click if you want to read the labs (or not) and then get back to the main document.</p>
  
  <p>In the lab documents there are also links to solutions (you need to click and later come back)</p>
  
  <p>this means I want to have an hypertext tree in my epub with a main text with a normal flow and additions which are not part of the normal flow.
  How do I do that?
  thanks</p>
  
  <p>(note: EPUB is created using ASCIIDOC but I can write unix scripts massaging the files in the zip)</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-08T18:39:38.410Z
Comments.Text: What do you mean "additions which are not part of the normal flow"? Do you mean that don't appear in the epub navigation document?
Comments.UserDisplayName: idiotprogrammer
Tags: <epub>
Title: how to create hypertext local to an EPUB document?
UserDisplayName: bear
ThreadText: # how to create hypertext local to an EPUB document?
  
  (Asked by: username_0 on 2017-10-07)
  
  Trying to explain the title: I am creating an EPUB document which is a programming course. In the document I want to refer to texts describing labs: these are not in the main flow of the main document: you can click if you want to read the labs (or not) and then get back to the main document.
  
  In the lab documents there are also links to solutions (you need to click and later come back)
  
  this means I want to have an hypertext tree in my epub with a main text with a normal flow and additions which are not part of the normal flow.
  How do I do that?
  thanks
  
  (note: EPUB is created using ASCIIDOC but I can write unix scripts massaging the files in the zip)
  
  **Tags:** epub
  
  > **Comments:**
  > **username_1**: What do you mean "additions which are not part of the normal flow"? Do you mean that don't appear in the epub navigation document?  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_0 on 2017-10-09. Score: 1
  
  as suggested by "username_1" it is possible to add such documents that are not part of the 'normal' reading flow.
  
  for instance while using the a2x epub generator from ASCIIDOC it is possible to add html documents that are listed in a RESOURCE\_MANIFEST file. these documents are added in the OEBPS directory (in my case in a 'labs' subdirectory of OEBPS) and are not listed as part of the normal flow.
  
  BUT (there is a but) behaviour depends on the epub reader you use: Mac's Ibook works perfectly (you have special window for this lab document and you can come back to the book) but Calibre passes the document to your browser (which is not the thing I would expect)
  
  > **Comments:**
  > **username_0**: after other tests here are the things to do: documents should be added in the list of items AND in the spine with mention linear="no" -> in that case it seems to work everywhere (but is is not easy to automatize the creation of the opf file ... stil wondering to do that - using an ed script can be done but is complex-)  
  
  ---
  
  ### Answer by username_1 on 2017-10-08. Score: 1
  
  I don't really understand the question, but it is possible for an epub file to contain html files which do not appear in the main navigation document. They can be accessed indirectly through hyperlinks within the HTML document.
  
  See the answer I gave for a different but related question here: <https://ebooks.stackexchange.com/a/7211/417>
  
  By the way, if that is your question, I recommend ignoring the epub2 way to do it and just do it the epub3 way. A lot of reading systems (including the Kindle ones) are ignoring the toc.ncx document if you have a  element.
  
  > **Comments:**
  > **username_0**: for sure my goal is not clear enough so let's try to clarify: I will get a book where 'normal' flow will be chapt1 then chapt2 ... at the end of chapt1 you may click on a link to read a document named labs1 then you go read this document (if needed) then go back to the end of chapt1. The labs1 document is hosted into the epub file. So instead of having a list of documents (the normal flow) you have a "tree" of documents.  
  > **username_1**: So you want the docs to be included in the epub or external to it? If included and if the docs are HTML files, then you could simply link to them in such a way: href="otherdoc1.html", href="otherdoc2.html" href="otherdoc3.html"   but not have otherdoc1.html listed in the navigation document. Note that the file needs to be still listed in the package.opf file.  
  > **username_0**: yes I want to have these files included in the epub document. I will try your solution and report the results. Thanks  
  
  ---
  
  ### Answer by username_0 on 2017-10-13. Score: 0
  
  apparently there is no need in readers to create another anchor to go back to the main flow (tested with Ibook and Calibre)
  just adding correctly the documents in the opf file does work (plus the link from the master flow to the "non linear" documents)
  
  
  ---
  
  ### Answer by username_2 on 2017-11-22. Score: 0
  
  The link to the file would look like: `file://mydir/myfile.txt`. But that doesn't mean the editor (like Calibre) would make a valid link out of that.
  Most programs only look for links that begin with "http://", "https://" or "ftp://" and do not linkify anything else.
  
  On a similar note you would create text like "click here for the lab", select that text, and create a link to "file://mydir/myfile.txt".
  
  So, where your epub is stored, you have to have a folder called "mydir" and under that would be "myfile.txt". The directory tree would look like this:
  
  `myepub.epub
  mydir\myfile.txt`
  
  
  ---
  
  ### Answer by username_3 on 2017-10-12. Score: 0
  
  I am not sure it's what you want/need, but the easiest way to do it is to add an (internal) anchor to the addendum, and at the end of the addendum another anchor to go back to the main flow.
  
  If the addenda are short, you may also consider putting them in footnotes.
  
  
  ---
  
  