I am totally befuddled by the way TB handles file naming when exporting
to HTML. Following Mark Bernstein's advice I have gone back to basics
and taken very small steps in an attempt to work out what is going on.
My conclusion is that the output of filenames is inconsistent, but that
can't be right. Someone enlighten me, please.
Here are my observations. With nothing else set, TB strips some
characters from a note's title when naming the export file. Spaces, for
example, and the & character, and the underline _ are all simply
removed from the output filename. This is nothing to do with
truncation. I have not tried all non alphanumeric characters.
But, if you use the variable ^title^ at any point in a note or
template, then those same characters are not stripped.
What this means is that if I use, say, ^childlinks or ^linkto(parent)
then the text of the link will have spaces, while the target of the
link, the HTML file, will not.
Here are some examples:
> Childlinks=<UL>
> <LI><a
> href="file:///Volumes/Photoblog/Photo%20Blog/Exported%20Files/
> AlbumTwo/Lemons.html">Lemons</a> </LI>
> <LI><a
> href="file:///Volumes/Photoblog/Photo%20Blog/Exported%20Files/
> AlbumTwo/MeandBobbieone.html">Me and Bobbie one</a> </LI>
> </UL>
Note that the parent note is actually called "Album Two" although TB
has renamed its output to AlbumTwo. Likewise, the second child note is
called "Me and Bobbie one" although TB renames the output file to
MeandBobbieone.html
And what that means is that I don't think I can use the name of a note
as a variable to set links.
All this is for a photoblog I am trying to develop. Ideally, there
would be one note for an album. That would display the thumbnails. The
children of that note are the individual photographs. clicking on the
thumbnail takes you to the photograph. Clicking on the photograph takes
you back to the album. I thought I could do this with reasonably simple
macros. But because of the inconsistency of filename output that does
not work when using ^title.
I also investigated setting the HTMLExportFilename variable. This, when
set, does not strip spaces, underlines or __AT__ characters. So maybe I can
automatically set HTMLExportFileName to the Name or Title of a note?
No, I don't think so. It seems that you can set an attribute to a
value, but not, as far as I can see, to the value of another attribute.
So I'm stuck. I want a way to programatically use the name of a note --
as written, nothing added, nothing taken away -- as its export
filename. But I can't. Of course I could edit the links by hand and
shift the location of the various files by hand. But that's hardly the
point of using software.
Any and all suggestions gratefully received. And apologies for cross
posting to the Forum and the mailing list, but I'd like to see what
everybody thinks. Next stop, the wiki.
Thanks all, and apologies for a long posting.
Jeremy
Received on Mon Mar 15 16:50:37 2004
This archive was generated by hypermail 2.1.8 : Wed Dec 14 2005 - 10:45:20 EST