Include Tag Processing

Jo
JoRo
Posts: 408
Joined: Sat May 26, 2018 6:40 am
Platform: Mac

Sat Jul 14, 2018 8:11 am Post

The sample project attached has two text files in the draft folder.

Both of these files have <$include:filename> tags that reference three texts stored in the research folder.

The first text file in the draft folder has no additional text after the include tags. When compiled (to PDF, RTF, etc), only the first include tag is processed.

The second text file in the draft folder has some additional text after the include tags. When compiled (to PDF, RTF, etc), all three include tags are processed.

The very strange thing here is that if the additional text is shortened, only one or two – depending on the length of the additional text – of the include tags are processed.

Is this a bug?

Include.pdf
(23.44 KiB) Downloaded 28 times


Include.zip
(53.44 KiB) Downloaded 18 times

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

Sat Jul 14, 2018 11:59 am Post

Yeah it does look like there is something odd thereabouts. I also tried using the document link format instead of referring to section types by name in the placeholder, and still got the same result. I suppose I’ve never come across this one because I either use it as the sole content of the file (acting more like a proxy for the original item) or embedded within a much longer document as a short phrase.

I’ll make sure Keith gets these results, thanks!
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

Jo
JoRo
Posts: 408
Joined: Sat May 26, 2018 6:40 am
Platform: Mac

Sat Jul 14, 2018 4:52 pm Post

Thanks, Ioa.

Just as an FYI, the issue started here:

https://www.literatureandlatte.com/foru ... =2&t=52823

Which led to here:

viewtopic.php?p=270610#p270610

I replicated the issue (having previously only used include tags as you describe) and then posted this thread.

Be good if it could be made to work for the other poster or for anyone else in the future.

Best.

kc
kcs304
Posts: 52
Joined: Fri Dec 08, 2017 8:49 pm
Platform: Mac

Tue Jul 17, 2018 5:16 pm Post

Thank you @Jo for raising this as a bug. I appreciate it. Hope this gets fixed in the next update.

-Kasey

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

Wed Jul 18, 2018 5:58 pm Post

Fixed for 3.0.4. (There's a bug in the code whereby the search range isn't being updated to account for the fact that there is now more text after the replacement, so it stops searching.)
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

Jo
JoRo
Posts: 408
Joined: Sat May 26, 2018 6:40 am
Platform: Mac

Thu Jul 19, 2018 6:23 am Post

Thanks.

kc
kcs304
Posts: 52
Joined: Fri Dec 08, 2017 8:49 pm
Platform: Mac

Mon Jul 23, 2018 5:13 am Post

Thank you for fixing it in 3.04 version. When do you plan to release that version?

Also, is it possible to expand these $include and variables in general before compile time? I want to display this information in composition mode. Is it possible? It would be very helpful, if I can see expanded document before compilation.

Thank you!

-Kasey

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

Mon Jul 23, 2018 8:18 am Post

I'm afraid I cannot say exactly when 3.0.4 will be released as there are a number of things that still need doing in that version before it is ready.

It is not possible to expand these tags before Compile time, no - these tags are specific to Compile. It would be impossible to have the text from other documents, or even from external files, appearing inside documents for live editing.

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

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

Mon Jul 23, 2018 10:44 am Post

This is in large part why I prefer using the document link format for these. If I need to look up the original text I can simply click on the linked <$include> tag. I’ll also sometimes “comment” the link by putting a short inline annotation after it, describing what will be included. Another side benefit for linking is that you by default get a backlink, meaning all included items will have a list of those documents that use their content, in the Document Bookmarks inspector tab.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

kc
kcs304
Posts: 52
Joined: Fri Dec 08, 2017 8:49 pm
Platform: Mac

Sun Jul 29, 2018 2:28 pm Post

Ambder,

That would work. Only one issue though. In composition mode when I am in document 1 and click on a link inside it to document 2. How do I go back to document 1? Previous/next document shortcut (option+cmd+up or down arrow would not work because the included document is in another folder. Is there a shortcut for editor back button? Can I add such a keyboard shortcut like other shortcuts I have? I don't see it in the menu item.

-Kasey

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

Sun Jul 29, 2018 2:45 pm Post

Definitely! The shortcuts are the same as in many Web browsers: ⌘[ and ⌘] for Back and Forward, respectively. The commands are in the Navigate ▸ Editor ▸  submenu; while there also note there are shortcuts for triggering history navigation in the other split, which may be of use if you prefer link settings that load the linked item in the other editor (not applicable to Composition mode of course).

Composition Mode uses its own history queue (much like each editor split has its own queue), which is built up while you use a session, and abandoned once you leave it.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

kc
kcs304
Posts: 52
Joined: Fri Dec 08, 2017 8:49 pm
Platform: Mac

Sun Jul 29, 2018 3:42 pm Post

Brilliant. thank you!

User avatar
Ianlhayes
Posts: 1
Joined: Sun Jun 17, 2018 8:22 pm
Platform: Mac + iOS

Wed Sep 19, 2018 3:08 pm Post

I just ran into this issue this morning! Yesterday was my first time learning about the <$include> tag, and I was so excited to use it for my grant-writing because different grants call for different elements of the same copy that I have split across several documents. Being able to plug-and-play would be so helpful. When can I expect this patch?