Contents Previous Next

## %%infile

The `%%infile` macro expands to the source file location on the system. It is useful to make those "see the source of this file" links on HTML pages. Providing such link is a friendly attitude with beginners, so they can use your source as a sample for their own page.

This macro accepts the following formatting directives:

%<char> | Description | Output for this User Guide source
--- | --- | ---
%f | File name | userguide.t2t
%F | File name (without extension) | userguide
%e | File extension | t2t
%p | Absolute file path | /a/txt2tags/svn/doc/English/userguide/userguide.t2t
%d | File path (directories only) | /a/txt2tags/svn/doc/English/userguide
%D | File path (parent dir only) | userguide
%% | Literal percent char | %

Examples:

Source | --> | Expanded
--- | --- | ---
This Guide parent dir is %%infile(%D). | --> | This Guide parent dir is userguide.
I do use the %%infile(%e) file extension. | --> | I do use the t2t file extension.
[See the source %%infile] | --> | See the source
Converted to XHTML, I'll be %%infile(%F).xhtml | --> | Converted to XHTML, I'll be userguide.xhtml

> Note: The macro is expanded to "-" if the source file is STDIN.

Contents Previous Next