Say I have a HTML5 target which publishes a TOC which is a blog (being continually updated) which is in reverse chronological order; that is, the most recent entries are at the top of the TOC.
But I'd also like to create a book (PDF or EPUB) version which is in chronological order; that is, the earliest entry is at the top of TOC and so start of the book.
To simply things, the TOC only has one level of entries; no topics are nested.
Is there a way to do this on the fly, without having to manually create and update one TOC to be the reverse of the other?
P.
Creating on-the-fly reverse TOC?
-
- Sr. Propeller Head
- Posts: 247
- Joined: Thu May 24, 2018 3:11 pm
- Location: Queensland, Australia
Re: Creating on-the-fly reverse TOC?
Not that I can think of within Flare. The only option I can think of is to write an external script to do this.
I could imagine a bit of Python that reads TOCA, converts it to TOCB, which is then used by the target to build the document. You could then call the script as a pre-build event from a batch file.
Or perhaps you could build a simpler sub-TOC that is based on a list of files in your blog directory, sorted in date order. This sub-TOC is then embedded as an entry in your main print TOC.
I do similar sorts of things with my documents. I include the schematics for a product in my print output. They change regularly so I have a script that builds a simple list of the files in a directory into a sub-TOC. This way I can guarantee I've always got the most up to date files in my document.
Rob
I could imagine a bit of Python that reads TOCA, converts it to TOCB, which is then used by the target to build the document. You could then call the script as a pre-build event from a batch file.
Or perhaps you could build a simpler sub-TOC that is based on a list of files in your blog directory, sorted in date order. This sub-TOC is then embedded as an entry in your main print TOC.
I do similar sorts of things with my documents. I include the schematics for a product in my print output. They change regularly so I have a script that builds a simple list of the files in a directory into a sub-TOC. This way I can guarantee I've always got the most up to date files in my document.
Rob