Tinderbox User's Manual : Appendix 4: HTML Export Codes

Appendix 4: HTML Export Codes

Tinderbox Icon

VALUES FOR "OBJECT"

the name of any note in the document

^text(this) the text of the current note

^title(parent) the title of the parent of the current note

^creator(soybean) the creator of the note named "soybean"

A number of keywords are available to refer to other notes by context rather than name. If the

keyword is omitted, the object is always this. Keywords include:

thisthe current note

currentthe note Tinderbox is currently exporting. Where a note is exported to its own page, current is the same as this. If a note includes children or other notes, however, current differs from this in the included notes. (When it appears outside of an export template, like in an agent or container action, current is always synonymous with this.)

next the note after the current note, in outline order

previous the note preceding the current note, in outline order

prevSibling the next older sibling of the current note

nextSibling the next younger sibling of the current note

firstSibling the first sibling of the current note, in outline order

lastSibling the final sibling of the current note, in outline order

parent the parent of the current note

grandparent the parent of the parent of this note

child the oldest child of the current note

lastChild the last child of this note

randomChild a randomly selected child of this note

cover the first note in the document

Some keywords refer to groups of notes; group codes include:

child all immediate children of this note

descendant all notes descended from this note

sibling all siblings of this note

ancestor all notes from which this note is descended

all all notes in the document

CONTENT

^title( object )^ the title of the note

^text^

^text( object )^ the body (text and graphics) of the note

^text( plain )^ the body without added HTML markup

^text(this, N )^ the first N words of the body of the note, without added HTML markup

^paragraphs( n )^ exports the first n paragraphs of the text.

^get( attribute_name )^ the value of that attribute for the note

^getFor( object,attribute_name )^ gets the value of an attribute for the note

ACTIONS AND EXPRESSIONS

^value( expression )^ evaluates an expression and exports the resulting string value. For example, ^value($Name)^ exports the note’s name, and ^value(log($TextLength(parent))^ exports the logarithm of the text length of the note’s parent.

^action( action )^ performs an action, with immediate effect. For example, ^action($Color="red")^ will change the color of the note as soon as it is exported. ^action does not export anything, but merely performs the action. Its effect is permanent.

LINKS

^url( object)^ the URL of the Web page for the note

^linkTo( object)^ a link to the Web page for that note.

^root^the relative path from the current file to the directory that contains the cover page. This is valuable for creating relative URLs from templates that may appear anywhere in the document. For example, ../stylesheets/screen.css will always refer to the file “screen.css” in the stylesheets directory at the top level of the site.

^basicLinks^ ^basicLinks( "start", "item-prefix", "item-suffix", "end" )^

^childLinks^ ^childLinks( "start", "item-prefix", "item-suffix", "end" )^

^ancestors^ ^ancestors( "start", "item-prefix", "item-suffix", "end" )^

^siblings^ ^siblings( "start", "item-prefix", "item-suffix", "end" )^

LOGICAL CONDITIONS

^if( condition )^ if the condition is true, then include everything from the ^if()^ statement to the ^else^ or the ^endif^

^else^

^endif^

^exists( object )^ true if that object (for example: parent, nextSibling) exists

^exists( attribute_name )^ true if the note has an attribute named "attribute_name", and the value of that attribute is not zero (if it's a number); not blank (if it's a string); not black (if it's a color).

^not( condition)^

^equal( thing 1, thing 2 )^ true if thing 1 is equal to thing 2

^contains( object, pattern )^ true if the regular expression pattern is found within the object’s text

^beginsWith( target,data )^ true if the target begins with the data

^endsWith( target, data )^ true if the target ends with the data

^days( date, N )^ true if date — ^today^, ^created^, ^lastModified,^ or ^get(LastFetched)^ — is within N days of today

INCLUDING OTHER NOTES

^justChildren( template-file)^ place the children of this note, exported with the HTML template named template-file, at this point in the current web page

^justChildren^place the children of this note, exported using their own export template, at this point in the current Web page

^children^

^children( template-file )^

^children( template-file, N )^ (deprecated) place the first N descendants of this note (where N is a number) into the current Web page, This code is seldom useful; use ^justChildren^ instead

^include( note_name, template_file )^ place the note named note_name, exported with the HTML template named template-file, at this point in the current Web page

^include( note_name )^ place the note named note_name, exported with its default HTML template, at this point in the current Web page

^randomChildOf( note_name, template_file)^ place a randomly selected child of the note named note_name, exported with the HTML template named template-file, at this point in the current Web page

^randomChildOf( note_name)^ place a randomly selected child of the note named note_name, exported with its default HTML template, at this point in the current Web page

MISCELLANEOUS CODES

^comment( stuff )^

^^ use two carets to put a caret into the text

^host^ the host of the site of this Web page

^file( object )^ the filename of the file for the Web page of that note

^path( object)^ relative path from the top-level export directory to the file for this Web page

^version^ version of Tinderbox used to create this Web page

^doctitle^ the name of the Tinderbox document

^randomLine( object )^ exports a random paragraph selected from the text of the object.

^indent^

^indent( object)^ emits a tab character for each ancestor the currently exported node has.

^encode ( what )^ translates special characters such as "<" and ">" into HTML entities before exporting them

^urlencode(what)^ translates characters that may not appear in URLs into encoded equivalents. For example, the space character becomes "%20"

^uppercase ( what )^ transforms its argument into all UPPERCASE LETTERS

^lowercase ( what )^ transforms its argument into all lowercase letters

^capitalize ( what )^ transforms its argument into Initial Capitals

^firstWord ( what )^ returns the first word of the argument

^lastWord ( what )^ returns the last word of the argument

^cloud ^ provides an HTML interface to the information displayed in the Common Words view (the 100 most common words in a note)

^sectionCloud^ builds a cloud based on a note and its descendants

^documentCloud^ builds a cloud based on the number of different notes that contain a word in the entire document.

^cloud (note_name, number)^ for all ^cloud codes, optional arguments allow you to specify a note and the number of common words displayed

^similarTo (note_name)^ exports a list of notes that are similar to a note

^similarTo (note_name, number)^ allows you to specify how many similar notes are returned

^sectionNumber( object)^ the hierarchical number of the note

^today( object )^ the date the note was exported to HTML

^created( object )^ the date the note was created in Tinderbox

^lastModified( object )^ the date the note was last modified in Tinderbox

^creator( object )^ the creator of the note

GROUP CODES

^every(group,attrib[,value])^ true if every member of the group (such as every child) is true, or if there are no examples of that group

^any(group,attrib[,value])^ true if any member of the group (such as every child) is true; false if there are no examples of that group

^count(group,attrib[,value])^ counts the number of elements in the group

^min(group,attrib[,value])^ the smallest element in the group

^max(group,attrib[,value])^ the largest element in the group

^sum(group,attrib[,value])^ computes the sum of all elements in the group

^mean(group,attrib[,value])^ computes the arithmetic average of the group


Up: Tinderbox User's Manual
Previous: Appendix 3: Actions and Rules  Next: Appendix 5: Date Formats 

[Last updated: 26 Jul 2009]

Google search TB Help for:  


Made with Tinderbox