Mark Anderson
YaBB Administrator
Offline
User - not staff!
Posts: 5689
Southsea, UK
|
I think I've found the breaks. These aren't a fault of the original author, TB has moved on meaning some code renders differently or not at all.
Problem #1. In export template "prefix-suffix.html", v4.6.2 doesn't like this line:
^if(#linkedFrom(Prefix/Suffix))^
...as it treats the slash in the prototype note's title as a division, to no useful result (no HTML ouptput). However, the code works if you re-write the line as:
^if(#linkedFrom("Prefix/Suffix"))^
...or, as #codes are now depreacted, as...
^if(linkedFrom("Prefix/Suffix"))^
FWIW, a clearer way to write the above - as it show the actual evaluation being made - is:
^if($Prototype=="Prefix/Suffix")^
...noting that the '==' equality operator is syntax new to v4.6+. The 'margin-notes', 'prefix-suffix', and 'subheading' templates all make this slightly oblique use of #linkedFrom to test for the current note's prototype.
Problem #2. Unless you publish to the supplied export folder - thus overwriting the supplied example, your output will lack an 'elements' sub-folder holding at JS and CSS files needed. For now, simply copy paste the 'elements' folder to your output folder.
Personally, I've moved away from external templates unless many different TBXs will share the same templates; of course editing one template to fix an issue will affect all ouptput using it which may - or may not - be desirable depending on your needs and style of work.
I also prefer to keep the CSS as exportable notes so I can quickly find and check code. However, with the JS files as above if you are sharing the code across many TBXs' output then there may be more sense in manually placing the code in the export location; you're unlikely to be editing the JS code as much/often. If you are using a modern JS framework (Prototype, jQuery, MooTools, etc.) then the size if the JS libraries may outweigh your TBX HTML output so internal storage in the TBX would bulk your document unnecessarily. All of which goes to show there's no single 'right' way to to things with TB export!
Problem #3. Image export. When I first tried the export in v4.6.2, the image used in the exported 'Writing Tinderbox Stretchtext' note export edit's image to a different name/location than the HTML page expected. I did wonder if it was some side effect of the alias of 'including images' confusing TB. Aliases now export as separate files and I'm not sure if that was true when Nathan wrote his example. I can't repeat the problem, so may be if you export a second time this issue will go away! Tip: when writing a doc like this it can be handy to explicitly note the TB version used - though I'm as guilty as anyone of forgetting to do this in my examples.
Problem #4. Less a problem than a puzzle. I can see no apparent need for the alias of the 'Prefix/Suffix' prototype in the 'System Prototypes' container. I don't think it does any harm, but nor do I think it should be there.
|