Little Girl's Mostly Linux Blog

txt2tagsIncludes

txt2tags Includes

This page was last updated on March 25, 2010.

Introduction

Includes are text, HTML or txt2tags files that you can insert by using a txt2tags include statement at the beginning of a line anywhere in the body section of your document. There are four kinds of include statements:

  • Plain include statement
  • Raw include statement
  • Tagged include statement
  • Verbatim include statement

Each of these behaves differently depending on the type of file you are including. This page demonstrates the behavior of each type of file using each kind of include statement. These are the contents of the source files that were used:

Text file HTML file txt2tags file

PLAIN INCLUDE STATEMENT

Useful for including a txt2tags file within your document. Place the file name into the include rule without any markup.

FILE TYPE RULE TO USE
Text
%!include: filename.txt
HTML
%!include: filename.html
txt2tags
%!include: filename.t2t

Text file:
* Presents the contents of the file beginning at line 4.
* Since the example has only 3 lines, in this case it presents nothing.

HTML file:
* Presents the contents of the file beginning at line 4.
* Does not preserve the layout.

<body> <p>1. LINE ONE.<br> 2.<br> 3. LINE THREE.</p> </body> </html>

txt2tags file:
* Presents the contents of the file.
* Preserves the layout.

1. LINE ONE.
2.
3. LINE THREE.

""RAW"" INCLUDE STATEMENT

Useful for including completely raw text of any kind with absolutely no layout within your document. Place 2 double quotes before and 2 double quotes after the file name in the include rule.

FILE TYPE RULE TO USE
Text
%!include: ""filename.txt""
HTML
%!include: ""filename.html""
txt2tags
%!include: ""filename.t2t""

Text file:
* Presents the contents of the file.
* Does not preserve the layout.

1. LINE ONE. 2. 3. LINE THREE.

HTML file:
* Presents the contents of the file.
* Does not preserve the layout.

<html> <head> </head> <body> <p>1. LINE ONE.<br> 2.<br> 3. LINE THREE.</p> </body> </html>

txt2tags file:
* Presents the file improperly.
%!postproc(html):
<BR>
1. LINE ONE.
2.
3. LINE THREE.

''TAGGED'' INCLUDE STATEMENT

Useful for including a web page within your document. Place 2 single quotes before and 2 single quotes after the file name in the include rule. Note that 2 single quotes together can look like 1 double quote.

FILE TYPE RULE TO USE
Text
%!include: ''filename.txt''
HTML
%!include: ''filename.html''
txt2tags
%!include: ''filename.t2t''

Text file:
* Presents the contents of the file.
* Does not preserve the layout.

1. LINE ONE. 2. 3. LINE THREE.

HTML file:
* Presents the contents of the file as HTML.
* Preserves the layout.

1. LINE ONE.
2.
3. LINE THREE.

txt2tags file:
* Presents the file improperly.
%!postproc(html):

1. LINE ONE.
2.
3. LINE THREE.

``VERBATIM`` INCLUDE STATEMENT

Useful for including a text file or the source code of an HTML file within your document. Place 2 backticks before and 2 backticks after the file name in the include rule.

FILE TYPE RULE TO USE
Text
%!include: ``filename.txt``
HTML
%!include: ``filename.html``
txt2tags
%!include: ``filename.t2t``

Text file:
* Presents the contents of the file.
* Preserves the layout.

1. LINE ONE.
2.
3. LINE THREE.

HTML file:
* Presents the contents of the file.
* Preserves the layout.

<html>
<head>
</head>
<body>
<p>1. LINE ONE.<br>
2.<br>
3. LINE THREE.</p>
</body>
</html>

txt2tags file:
* Presents the file improperly.

  
  
  
%!postproc(html): 
1. LINE ONE.
<BR>

2.
3. LINE THREE.



Obligatory Happy Ending

And they all lived happily ever after. The end.

Back to top

Creative Commons License The txt2tags Includes page from http://mostlylinux.wordpress.com is Copyright © 2007 – 2011 by Little Girl, licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License, and offered free of charge without warranty of any kind, either expressed or implied.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: WordPress Classic. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.