Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> exporting notes to date based sub-directories
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1221358162

Message started by Dave Woodward on Sep 13th, 2008, 10:09pm

Title: exporting notes to date based sub-directories
Post by Dave Woodward on Sep 13th, 2008, 10:09pm

I'm slowly building a blog using Tinderbox, and I'd like to keep all of the notes that are published inside of folders based on the year and month once they're exported.  However I don't want to have to keep the notes inside of nested containers in the Tinderbox document itself.

It would be nice to be able to add directory names to the HTMLExportFileName attribute so that when the notes are exported, they can end up at a URL like "/archives/2008/september/name_of_note.html", but only be in a container called "archives" in the Tinderbox document itself.

Is there a way to do this without making containers inside of containers in the TB document?

Title: Re: exporting notes to date based sub-directories
Post by Mark Bernstein on Sep 14th, 2008, 3:16am

Nope; the Tinderbox export tree is based on the Tinderbox document tree.  There's a good reason for this; if you could, as you propose, have specify the HTML Export path for each note, it would be easy for conflicts arise.  These conflicts would be very hard to diagnose, because they'd be of the form

Quote:
My unique (and very complicated) document loses my exported note! What am I doing wrong?


What you can do, though, may well be sufficiently powerful.  You can either
  • use a container of agents to recreate the export tree you have in mind, leaving your original post in place

or
  • move your notes into the monthly containers, and use an agent or set of agents to recreate your current export hierarchy



Title: Re: exporting notes to date based sub-directories
Post by Paul Walters on Sep 14th, 2008, 9:10am

Along the lines of Mark B's suggestions, see if this helps.

In my blog, I use agents to chose the published materials.  The original notes are in their own container, and the agents look inside that container ("Notes").  The agents are exported; "Notes" is not exported.

I have "current", "recent", and "archived" agents.  These could just as well be "September", "last month", "last year", or any other scheme that TB searches can support.  The output from the agent is directed to whatever folder is set as Export Folder in HTML view.  

(I don't believe Export Folder can be set in an agent or rule - so keeping folders for each month would entail a small manual task when that month's agent is created.  A script and/or runCommand, with appropriate tests, could be used to handle that housekeeping.)


Title: Re: exporting notes to date based sub-directories
Post by Mark Bernstein on Sep 14th, 2008, 12:54pm

Don't forget that an agent can ExportChildren; in this case, the agent exports a (copy of) the notes it finds inside its own folder.

Title: Re: exporting notes to date based sub-directories
Post by Dave Woodward on Sep 14th, 2008, 2:54pm

Yeah, right now I have an agent called "archives" that exports its children.  I think my final solution here is just going to be an agent for each year, and maybe I'll have to keep those inside of a container.

Or maybe I'll find a sneaky way to have agents inside of agents...

Thanks for your replies!

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.