^indent( [data][, N] )^

Tinderbox Icon


Code Type:   Export Mark-up
Code Scope of Action:   item

^indent( [data][, N] )^

Exports the data as a string, repeated once for each ancestor of the currently exported note (i.e. the equivalent of $OutlineDepth-1 times), or N times if the latter is specified.

^indent^

Exports a tab character for each ancestor of the currently exported note except root level, i.e. a tab is the default indent if no data parameter is supplied.

data. The number of times data or a tab is emitted is ($OutlineDepth-1); from v5.6.0, for aliases this is the alias' value and not that of the original.

N. From v5.5.0 this default can be superseded by supplying an optional second parameter N. N is evaluated so may either be a number or an expression, e.g. $OutlineDepth+3. This kind of thing is useful if trying to correctly indent source code and when the export 'base' is at a level other than the root of the TBX.

If the N parameter is used, the data parameter must also be supplied. To specify a tab - as in the normal default - use "\t", e.g. ^indent("\t",6)^.

For web use, tabs are ignored for white space so consider using one or more " " space HTML entities as the data value.

Examples

In the source TBX document this note is at Outline Depth 5, so ^indent(data)^ will emit the data value 4 times. Thus, if we use a hyphen as the indent's data value, you see:

----Text indented with ^indent(-)^

In the next example the on-screen text should be visibly indented three (non-proportional) spaces:

    Text indented with ^indent( )^ 

Note how the visual HTML output of the next two examples isn't indented as tabs aren't interpreted as white space mark-up in HTML:

Text indented with ^indent^ (i.e. a tab)

Text indented with tabs to outline level plus 4 (i.e. 9 tabs)

However, if you view the HTML source for the page, you'll see first of the two examples immediately above has output 5 tabs non-breaking space HTML entities. For the example following it, you'll see 9 tabs have been output; depending on the program viewing the source you may be able to 'see' these as tabs by moving the cursor through the source code with the arrow keys - you'll see it jump from tab to tab.

Root level notes are not indented.


Possible relevant notes (via "Similar Notes" feature):

Up: Export Mark-up

A Tinderbox Reference File : Export Codes : Export Code Types : Export Mark-up : ^indent( [data][, N] )^

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox