I am trying to include a folder and all of its subdocuments in my Binder via the <$include> command. I’ve done this by selecting the <$include> tag and dropping the folder onto it. When I compile the document, however, only the text in the folder itself compiles (which is no text in this case); the documents within the folder don’t compile. Is this the intended behavior? Is there a way around it? I realize I could have a series of <$include> commands, one for each document in the folder, but that is a relatively inflexible method.
This is the extent of the <$Include> capability:
<$include>
<$include:textNameOrPath>
You can use the <$include…> placeholder to have text from an external
document inserted into the text during Compile. This can be useful if you have
text snippets that need repeating throughout for some reason.
To insert the main text of any document in the current project, either use the
<$include> tag and apply a document link to the whole tag that points to the
document whose text you wish to insert, or use <$include:docName>, where
“docName” is the name of the document you wish to be inserted. (Using
document links is the more reliable method.)
To insert the text of an external file, either use the <$include> tag with a link to
the external file, or use <$include:docPath>, where “docPath” is either the full or
relative path of the document whose text you wish to insert (relative paths should
be relative to the folder in which the project is stored). Note that only plain text
UTF-8 files and RTF files are supported, and only the text of such files will be
included (images, footnotes and comments are ignored in external RTF files that
are inserted in this manner).
The <$include…> tag is only supported in the following areas: the main text;
notes; title prefixes and suffixes; section layout prefixes and suffixes. You can
also use it in the ebook “Description” metadata field, but only if it appears on its
own.
Use the placeholder multiple times. Once per document (the ones you can’t currently get to compile), each instance as per the way @RevoTiLlor explained clearly.
<$include…> –> Folder (or not…)
<$include…> –> Child document 1
<$include…> –> Child document 2
<$include…> –> Child document 3
<$include…> –> Child document 4
…
This post might be of interest to you.
You should read the first post of the thread too (if not the whole thread), for context.
That’s too bad. It’d be nice to be able to include folders (with their child documents). That way you could, e.g., add a new child document to the folder, and it would be included in the next compile.
Have you looked at the other post I linked to?
That’s as close as it gets to it.
If you create a new folder/child document structure for your “twice” documents, right where you want them in the sequence, in the binder, you can either use a duplicate of the original, or copy/paste the original text in new blank documents, and they will compile like any other document.
In the post I linked to, it is exactly that, but in a way that allows the user to edit one of the duplicates, and have the changes be applied to all instances of that one text.
[EDIT] On a second read, I understand a bit better your last post. … Perhaps. … I can’t speak for the technical side of programming the app so, of course, but I can then imagine users asking for a way to exclude some documents in the ghost instance, and on and on…
In an attempt to make the above ideas a little more efficient and clean, here is how I would approach this:
-
Move the include list to the folder text for that include group, instead of scattered everywhere you need to reference the group.
- This keeps your source text clean, it only refers to the group itself with one placeholder in the text.
- The clutter, or mechanics we might say, of the long list of includes is tucked away in the group’s text itself, and is thus a part of its function.
-
To make the creation of these lists easier, combine two tools:
- Easy lists of links: First, after revealing the folder text, you might want to lock the editor (
Navigate ▸ Editor ▸ Lock in Placeshortcut) to make this easier: shift-click to select the contents of the folder in the binder, and drag and drop them into the folder’s text editor. Now you’ve got a list of links pointing back to the items, one per line, just like you want it. - Convert all line text to one phrase: To make the links work as inclusions though, open Find and Replace, set the Find Options type to “Regular Expression”, and then into the top field paste
^.+$, and into the bottom field,<$include>. That will replace the contents of each line that has text on it, from start to finish, and since the replacement is happening within formatting (rather than across it), it will do so without destroying the formatting we want: the original links.
- Easy lists of links: First, after revealing the folder text, you might want to lock the editor (
With this approach you’ve got something easy and simple to work with at the “surface” level, while writing, and something that requires only a little maintenance to keep up on the back end.
An interesting concept here is that we’re only using the parent-child relationship loosely. These “cluster include” targets could of course list links from all over the place. Any time you need a particular sequence of items, it isn’t a necessity that they all be arranged into one outline group like this. Maybe not something you need in particular right now, but I just wanted to underscore that what we’re really doing is creating a curated list of texts from throughout the binder that can be assembled into any given spot in the draft, via one inclusion to the curator.