Project | WXT | Basics | Download | Documentation | Samples

PI: expandable

The purpose of an expandable PI is to allow an expansion/unexpansion of parts of a module.

<?_wxt expandable location="" expanded=""?>

The parameters are:

location (mandatory if no fragmentid) The URI of the file we want to expand.
fragmentid (mandatory if no location) The fragment we want to expand.
title (optional) Deprecated, use text
text (optional) The text appearing in the header.
expanded (optional) If you want the fragment to be initially expanded, expanded is set to yes. no is default.
NOTE that global option expand-all will override this parameter if it is set to yes.
transformation (optional) A transformation identifier (see: Transformation ). This transformation may have parameters: T(name='ole' address='halden'). This transformation is applied before we attempt to extract text. The transformation used here will normally produce text.
leftpar (optional) A string that serves as left parenthesis of the text we want to extract
rightpar (optional) A string that serves as right parenthesis of the text we want to extract
select (optional) Will select which of the occurances of the marked (leftpar, rightpar) textpieces we want to use. Default is all. Possible values are: _all, _random, commaseparated list of integers or "slice":
[a:b]-> [a..b>
[a:]-> [a..limit>
[:b]-> [0..b>
[:-b] [limit-b..limit>
replace (optional) Replaces text. We may have any number of replaces: replace, replace1, replace2, etc. The form is replace="out|in".
encoding (optional) The encoding of the text we import.
lang (optional) The text will be colorcoded. Mainly used for programming languages. The value of lang may be any value supported by the stylesheet and the involved javascript. The basic encoding is based on Google's prettyprint. The module Code describes the setup and values supported..
When WXT prepares material with option preformat-language=yes, WXT's own colorencoding is used. This is mainly to prepare for PDF. WXT's encoding supports the following codetypes:
  • lang-j (java)
  • lang-js (javascript)
  • lang-c (c)
  • lang-cpp (c++)
  • lang-csh (c#)
  • lang-css (Cascading Style Sheets)
  • lang-xml (XML)
  • lang-sql (SQL)
  • lang-aspx (ASPX)
  • lang-cs3 (actionscript)
  • lang-mal (matlab)
  • lang-py (python)
  • lang (generic without colorencoding. All encoding defaults to this on failure on others)
parse (optional) If set to yes the extracted text is supposed to be a XML-fragment and an attempt is done to parse it and return it as a documentfragment. parse is ignored if lang is set.

Styleclass(es) describing this PI is: wxtexpandable. See distributed std styles.

Examples:

This:

<div>
<?_wxt expandable location="myfile.js" lang="lang-js" expanded="no" ?>
</div>