data/TWiki/IncludeTopicsAndWebPages.txt,v
changeset 0 414e01d06fd5
equal deleted inserted replaced
-1:000000000000 0:414e01d06fd5
       
     1 head	1.10;
       
     2 access;
       
     3 symbols;
       
     4 locks; strict;
       
     5 comment	@# @;
       
     6 
       
     7 
       
     8 1.10
       
     9 date	2008.01.22.03.21.31;	author TWikiContributor;	state Exp;
       
    10 branches;
       
    11 next	1.9;
       
    12 
       
    13 1.9
       
    14 date	2006.04.01.05.55.07;	author TWikiContributor;	state Exp;
       
    15 branches;
       
    16 next	1.8;
       
    17 
       
    18 1.8
       
    19 date	2006.02.01.12.01.17;	author TWikiContributor;	state Exp;
       
    20 branches;
       
    21 next	1.7;
       
    22 
       
    23 1.7
       
    24 date	2004.08.15.07.36.37;	author PeterThoeny;	state Exp;
       
    25 branches;
       
    26 next	1.6;
       
    27 
       
    28 1.6
       
    29 date	2003.02.01.12.26.52;	author PeterThoeny;	state Exp;
       
    30 branches;
       
    31 next	1.5;
       
    32 
       
    33 1.5
       
    34 date	2003.01.16.07.35.00;	author PeterThoeny;	state Exp;
       
    35 branches;
       
    36 next	1.4;
       
    37 
       
    38 1.4
       
    39 date	2002.12.11.08.18.06;	author PeterThoeny;	state Exp;
       
    40 branches;
       
    41 next	1.3;
       
    42 
       
    43 1.3
       
    44 date	2002.11.14.03.12.00;	author PeterThoeny;	state Exp;
       
    45 branches;
       
    46 next	1.2;
       
    47 
       
    48 1.2
       
    49 date	2002.04.07.10.26.00;	author PeterThoeny;	state Exp;
       
    50 branches;
       
    51 next	1.1;
       
    52 
       
    53 1.1
       
    54 date	2001.06.26.00.44.57;	author PeterThoeny;	state Exp;
       
    55 branches;
       
    56 next	;
       
    57 
       
    58 
       
    59 desc
       
    60 @none
       
    61 @
       
    62 
       
    63 
       
    64 1.10
       
    65 log
       
    66 @buildrelease
       
    67 @
       
    68 text
       
    69 @%META:TOPICINFO{author="TWikiContributor" date="1111929255" format="1.0" version="10"}%
       
    70 ---+!! Include Topics and Web Pages Using =%<nop>INCLUDE{...}%= Variable
       
    71 
       
    72 Use the =%<nop>INCLUDE{...}%= variable to embed the content of another topic or web page inside a TWiki topic. The whole content or only parts of a page can be included. If needed, set a proxy server in %WIKIPREFSTOPIC%.
       
    73 
       
    74 %TOC%
       
    75 
       
    76 ---++ Syntax Example
       
    77 
       
    78 =%<nop>INCLUDE{ "page" pattern="reg-exp" rev="2" warn="off" section="clients" PARAMETER1="value" PARAMETER2="Some value"}%=
       
    79 
       
    80 The =pattern= parameter is optional and allows you to extract some parts of a web page. Specify a %SYSTEMWEB%.RegularExpression that scans from start (='^'=) to end and contains the text you want to keep in parenthesis, e.g., =pattern="^.*?(from here.*?to here).*"=. You need to make sure that the integrity of a web page is not compromised; for example, if you include a table, make sure to include everything including the table end tag.
       
    81 
       
    82 The example parameters PARAMETER1 and PARAMETER2 will be defined as a variable within the scope of the included topic. The example parameters shown will result in %PARAMETER1% and %PARAMETER2% being defined within the included topic.
       
    83 
       
    84 VarINCLUDE explains the other parameters.
       
    85 
       
    86 __Note:__ All text of a topic is included unless it contains a =%<nop>STARTINCLUDE%= and =%<nop>STOPINCLUDE%=, or you specify a =section= parameter and/or a =pattern= parameter. A pattern will only search between =%<nop>STARTINCLUDE%= and =%<nop>STOPINCLUDE%=.
       
    87 
       
    88 ---++ Usage Examples
       
    89 
       
    90 ---+++ 1. Display regression test results in a TWiki page
       
    91 <pre>
       
    92   &lt;pre&gt;
       
    93   %<nop>INCLUDE{"http://domain/~qa/v1.1/REDTest.log.txt"}%
       
    94   &lt;/pre&gt;
       
    95 </pre>
       
    96 
       
    97 ---+++ 2. Display Google's robot.txt file
       
    98 
       
    99 <pre>
       
   100   %<nop>INCLUDE{"http://www.google.com/robots.txt"}%
       
   101 </pre>
       
   102 
       
   103 ---+++ 3. Display the current time in Tokyo in a TWiki page
       
   104 
       
   105    * You type:
       
   106       * ==Tokyo: %<nop>INCLUDE{"http://TWiki.org/cgi-bin/xtra/tzdate?tz=Asia/Tokyo" pattern="^.*&lt;\!--tzdate:date--&gt;(.*?)&lt;\!--/tzdate:date--&gt;.*"}%==
       
   107    * You get:
       
   108       * Tokyo: %INCLUDE{"http://TWiki.org/cgi-bin/xtra/tzdate?tz=Asia/Tokyo" pattern="^.*<\!--tzdate:date-->(.*?)<\!--/tzdate:date-->.*"}%
       
   109 
       
   110 ---+++ 4. Include a topic !MyTopic with two parameters
       
   111 
       
   112 You include the topic with this line
       
   113 <verbatim>
       
   114   %INCLUDE{ "MyTopic" BETTER="apples" WORSE="Oranges"}%
       
   115 </verbatim>
       
   116 
       
   117 An example of a very simple !MyTopic could contain
       
   118 
       
   119 <verbatim>
       
   120    * I like %BETTER% better than %WORSE%.
       
   121 </verbatim> 
       
   122 
       
   123 The result would be
       
   124 
       
   125    * I like apples better than oranges.
       
   126 
       
   127 __Related Topics:__ VarINCLUDE, UserDocumentationCategory
       
   128 
       
   129 @
       
   130 
       
   131 
       
   132 1.9
       
   133 log
       
   134 @buildrelease
       
   135 @
       
   136 text
       
   137 @d1 1
       
   138 a1 1
       
   139 %META:TOPICINFO{author="TWikiContributor" date="1111929255" format="1.0" version="9"}%
       
   140 d10 1
       
   141 a10 1
       
   142 =%<nop>INCLUDE{ "page" pattern="reg-exp" rev="2" warn="off" section="clients" }%=
       
   143 d12 3
       
   144 a14 1
       
   145 The =pattern= parameter is optional and allows you to extract some parts of a web page. Specify a %TWIKIWEB%.RegularExpression that scans from start (='^'=) to end and contains the text you want to keep in parenthesis, e.g., =pattern="^.*?(from here.*?to here).*"=. You need to make sure that the integrity of a web page is not compromised; for example, if you include a table, make sure to include everything including the table end tag.
       
   146 d42 17
       
   147 @
       
   148 
       
   149 
       
   150 1.8
       
   151 log
       
   152 @buildrelease
       
   153 @
       
   154 text
       
   155 @d1 1
       
   156 a1 1
       
   157 %META:TOPICINFO{author="TWikiContributor" date="1111929255" format="1.0" version="8"}%
       
   158 d14 1
       
   159 a14 1
       
   160 TWikiVariables#VarINCLUDE explains the other parameters.
       
   161 d35 4
       
   162 a38 4
       
   163 	* You type:
       
   164 		* ==Tokyo: %<nop>INCLUDE{"http://TWiki.org/cgi-bin/xtra/tzdate?tz=Asia/Tokyo" pattern="^.*&lt;\!--tzdate:date--&gt;(.*?)&lt;\!--/tzdate:date--&gt;.*"}%==
       
   165 	* You get:
       
   166 		* Tokyo: %INCLUDE{"http://TWiki.org/cgi-bin/xtra/tzdate?tz=Asia/Tokyo" pattern="^.*<\!--tzdate:date-->(.*?)<\!--/tzdate:date-->.*"}%
       
   167 d40 1
       
   168 a40 1
       
   169 __Related Topics:__ TWikiVariables#VarINCLUDE, UserDocumentationCategory
       
   170 @
       
   171 
       
   172 
       
   173 1.7
       
   174 log
       
   175 @none
       
   176 @
       
   177 text
       
   178 @d1 2
       
   179 a2 2
       
   180 %META:TOPICINFO{author="PeterThoeny" date="1092555397" format="1.0" version="1.7"}%
       
   181 ---+!! Include Topics and Web Pages Using ==%<nop>INCLUDE{...}%== Variable
       
   182 d4 1
       
   183 a4 1
       
   184 Use the ==%<nop>INCLUDE{...}%== variable to embed the content of another topic or web page inside a %WIKITOOLNAME% topic. The whole content or only parts of a page can be included. If needed, set a proxy server in %WIKIPREFSTOPIC%.
       
   185 d8 1
       
   186 d10 1
       
   187 a10 1
       
   188 ---++ Syntax
       
   189 d12 1
       
   190 a12 1
       
   191 ==%<nop>INCLUDE{ "page" pattern="reg-exp" rev="1.2" }%==
       
   192 d14 1
       
   193 a14 5
       
   194 	* =="page"==: %BR%
       
   195 	  The nameless parameter specifies the page to include. It is
       
   196 		* The name of a topic located in the current web, e.g., ==%<nop>INCLUDE{"WebNotify"}%==
       
   197 		* A =Web.Topic= name specifying a topic in another web, e.g., ==%<nop>INCLUDE{"%TWIKIWEB%.SiteMap"}%==
       
   198 		* A full qualified URL with ==http== protocol, domain name and optional port number, e.g., ==%<nop>INCLUDE{"http://twiki.org:80/index.html"}%==. Supported content types are ==text/html== and ==text/plain==. The full page is included by default, but the HTML header and scripts are stripped in case it is a web page.
       
   199 d16 1
       
   200 a16 7
       
   201 	* ==pattern="reg-exp"==: %BR%
       
   202 	  The *pattern* parameter is optional and allows you to extract some parts of a web page. Specify a %TWIKIWEB%.RegularExpression that scans from start (='^'=) to end and contains the text you want to keep in parenthesis, e.g., ==pattern="^.*?(from here.*?to here).*"==. You need to make sure that the integrity of a web page is not compromised; for example, if you include a table, make sure to include everything including the table end tag.
       
   203 
       
   204 	* ==rev="1.x"==: %BR%
       
   205 	  The *rev* parameter is optional and allows you to include an earlier revision of a topic. This can be used to include an official version of a topic, e.g. one that has been signed of by management. This parameter does not apply to URLs.
       
   206 
       
   207 __Note:__ All text of a topic is included unless you specify ==%<nop>STARTINCLUDE%==, ==%<nop>STOPINCLUDE%== and/or a *pattern* parameter. A pattern will only search between ==%<nop>STARTINCLUDE%== and ==%<nop>STOPINCLUDE%==.
       
   208 d29 3
       
   209 a31 2
       
   210 	* You type:
       
   211 		* ==%<nop>INCLUDE{"http://www.google.com/robots.txt"}%==
       
   212 d36 1
       
   213 a36 1
       
   214 		* ==Tokyo: %<nop>INCLUDE{"http://TWiki.org/cgi-bin/xtra/tzdate?tz=Asia/Tokyo" pattern="^.*<\!--tzdate:date-->(.*?)<\!--/tzdate:date-->.*"}%==
       
   215 d40 1
       
   216 a40 3
       
   217 See also other TWikiVariables.
       
   218 
       
   219 -- TWiki:Main.PeterThoeny - 15 Aug 2004
       
   220 @
       
   221 
       
   222 
       
   223 1.6
       
   224 log
       
   225 @none
       
   226 @
       
   227 text
       
   228 @d1 51
       
   229 a51 58
       
   230 %META:TOPICINFO{author="PeterThoeny" date="1044102412" format="1.0" version="1.6"}%
       
   231 ---+!! Include Topics and Web Pages Using ==%<nop>INCLUDE{...}%== Variable
       
   232 
       
   233 Use the ==%<nop>INCLUDE{...}%== variable to embed the content of another topic or web page inside a %WIKITOOLNAME% topic. The whole content or only parts of a page can be included. If needed, set a proxy server in %WIKIPREFSTOPIC%.
       
   234 
       
   235 %TOC%
       
   236 
       
   237 
       
   238 ---++ Syntax
       
   239 
       
   240 ==%<nop>INCLUDE{ "page" pattern="reg-exp" rev="1.2" }%==
       
   241 
       
   242 	* =="page"==: %BR%
       
   243 	  The nameless parameter specifies the page to include. It is
       
   244 		* The name of a topic located in the current web, e.g., ==%<nop>INCLUDE{"WebNotify"}%==
       
   245 		* A =Web.Topic= name specifying a topic in another web, e.g., ==%<nop>INCLUDE{"%TWIKIWEB%.SiteMap"}%==
       
   246 		* A full qualified URL with ==http== protocol, domain name and optional port number, e.g., ==%<nop>INCLUDE{"http://twiki.org:80/index.html"}%==. Supported content types are ==text/html== and ==text/plain==. The full page is included by default, but the HTML header and scripts are stripped in case it is a web page.
       
   247 
       
   248 	* ==pattern="reg-exp"==: %BR%
       
   249 	  The *pattern* parameter is optional and allows you to extract some parts of a web page. Specify a %TWIKIWEB%.RegularExpression that scans from start (='^'=) to end and contains the text you want to keep in parenthesis, e.g., ==pattern="^.*?(from here.*?to here).*"==. You need to make sure that the integrity of a web page is not compromised; for example, if you include a table, make sure to include everything including the table end tag.
       
   250 
       
   251 	* ==rev="1.x"==: %BR%
       
   252 	  The *rev* parameter is optional and allows you to include an earlier revision of a topic. This can be used to include an official version of a topic, e.g. one that has been signed of by management. This parameter does not apply to URLs.
       
   253 
       
   254 __Note:__ All text of a topic is included unless you specify ==%<nop>STARTINCLUDE%==, ==%<nop>STOPINCLUDE%== and/or a *pattern* parameter.
       
   255 
       
   256 
       
   257 ---++ Usage Examples
       
   258 
       
   259 ---+++ 1. Display regression test results in a TWiki page
       
   260 <pre>
       
   261   &lt;pre&gt;
       
   262   %<nop>INCLUDE{"http://domain/~qa/v1.1/REDTest.log.txt"}%
       
   263   &lt;/pre&gt;
       
   264 </pre>
       
   265 
       
   266 ---+++ 2. Display Yahoo's robot.txt file
       
   267 
       
   268 	* You type:
       
   269 		* ==%<nop>INCLUDE{"http://www.yahoo.com/robots.txt"}%==
       
   270 
       
   271 ---+++ 3. Display the SUNW stock quote in a TWiki page
       
   272 
       
   273 	* You type:
       
   274 		* ==SUNW: %<nop>INCLUDE{"http://finance.yahoo.com/q?s=SUNW&d=v1&o=t" pattern="^.*?&gt;SUNW&lt;/a&gt;[^&lt;]+(.*?)\s+\S+\s+&lt;small.*"}%==
       
   275 	* You get:
       
   276 		* SUNW: %INCLUDE{"http://finance.yahoo.com/q?s=SUNW&d=v1&o=t" pattern="^.*?>SUNW</a>[^<]+(.*?)\s+\S+\s+<small.*"}%
       
   277 
       
   278 ---+++ 4. Display the temperature in San Francisco
       
   279 
       
   280 	* You type:
       
   281 		* ==San Francisco: %<nop>INCLUDE{"http://weather.yahoo.com/forecast/San_Francisco_CA_US_f.html" pattern="^.*?([0-9]+\&amp;ordm\;F).*"}%==
       
   282 	* You get:
       
   283 		* San Francisco: %INCLUDE{"http://weather.yahoo.com/forecast/San_Francisco_CA_US_f.html" pattern="^.*?([0-9]+\&ordm\;F).*"}%
       
   284 
       
   285 See also other TWikiVariables.
       
   286 
       
   287 -- Main.PeterThoeny - 15 Jan 2003
       
   288 @
       
   289 
       
   290 
       
   291 1.5
       
   292 log
       
   293 @none
       
   294 @
       
   295 text
       
   296 @d1 1
       
   297 a1 1
       
   298 %META:TOPICINFO{author="PeterThoeny" date="1042702500" format="1.0" version="1.5"}%
       
   299 d4 1
       
   300 a4 1
       
   301 Use the ==%<nop>INCLUDE{...}%== variable to embed the content of another topic or web page inside a %WIKITOOLNAME% topic. The whole content or only parts of a page can be included.
       
   302 @
       
   303 
       
   304 
       
   305 1.4
       
   306 log
       
   307 @none
       
   308 @
       
   309 text
       
   310 @d1 2
       
   311 a2 2
       
   312 %META:TOPICINFO{author="PeterThoeny" date="1039594686" format="1.0" version="1.4"}%
       
   313 *Include Topics and Web Pages Using ==%<nop>INCLUDE{...}%== Variable*
       
   314 d33 1
       
   315 a33 1
       
   316   %<nop>INCLUDEURL{"http://domain/~qa/v1.1/REDTest.log.txt"}%
       
   317 d40 1
       
   318 a40 5
       
   319 		* ==%<nop>INCLUDE{"http://www.yahoo.com/robots.txt"}%== <br>
       
   320 	* You get:
       
   321 <verbatim>
       
   322 %INCLUDE{"http://www.yahoo.com/robots.txt"}%
       
   323 </verbatim>
       
   324 d45 1
       
   325 a45 1
       
   326 		* ==SUNW: %<nop>INCLUDE{"http://finance.yahoo.com/q?s=SUNW&d=v1&o=t" pattern="^.*?&gt;SUNW&lt;/a&gt;[^&lt;]+(.*?)\s+\S+\s+&lt;small.*"}%== <br>
       
   327 d52 1
       
   328 a52 1
       
   329 		* ==San Francisco: %<nop>INCLUDE{"http://weather.yahoo.com/forecast/San_Francisco_CA_US_f.html" pattern="^.*?([0-9]+\&amp;ordm\;F).*"}%== <br>
       
   330 d58 1
       
   331 a58 1
       
   332 -- Main.PeterThoeny - 25 Jun 2001 <br>
       
   333 @
       
   334 
       
   335 
       
   336 1.3
       
   337 log
       
   338 @none
       
   339 @
       
   340 text
       
   341 @d1 1
       
   342 a1 1
       
   343 %META:TOPICINFO{author="PeterThoeny" date="1037243520" format="1.0" version="1.3"}%
       
   344 d15 3
       
   345 a17 3
       
   346 		* The name of a topic located in the current web, i.e. ==%<nop>INCLUDE{"WebNotify"}%==
       
   347 		* A =Web.Topic= name specifying a topic in another web, i.e. ==%<nop>INCLUDE{"%TWIKIWEB%.SiteMap"}%==
       
   348 		* A full qualified URL with ==http== protocol, domain name and optional port number, i.e. ==%<nop>INCLUDE{"http://twiki.org:80/index.html"}%==. Supported content types are ==text/html== and ==text/plain==. The full page is included by default, but the HTML header and scripts are stripped in case it is a web page.
       
   349 d20 1
       
   350 a20 1
       
   351 	  The *pattern* parameter is optional and allows you to extract some parts of a web page. Specify a %TWIKIWEB%.RegularExpression that scans from start (='^'=) to end and contains the text you want to keep in parenthesis, i.e. ==pattern="^.*?(from here.*?to here).*"==. You need to make sure that the integrity of a web page is not compromised, i.e. if you include a table make sure to include everything including the table end tag.
       
   352 d23 1
       
   353 a23 1
       
   354 	  The *rev* parameter is optional and allows you to include an earlier revision of a topic. This can be used to include an official version of a topic, e.g. one that has been signed of by management.
       
   355 @
       
   356 
       
   357 
       
   358 1.2
       
   359 log
       
   360 @none
       
   361 @
       
   362 text
       
   363 @d1 1
       
   364 a1 1
       
   365 %META:TOPICINFO{author="PeterThoeny" date="1018175160" format="1.0" version="1.2"}%
       
   366 d11 1
       
   367 a11 1
       
   368 ==%<nop>INCLUDE{"page" pattern="reg-exp"}%==
       
   369 d13 1
       
   370 a13 1
       
   371 	* =="page"==: <br>
       
   372 d19 1
       
   373 a19 1
       
   374 	* ==pattern="reg-exp"==: <br>
       
   375 d21 3
       
   376 @
       
   377 
       
   378 
       
   379 1.1
       
   380 log
       
   381 @none
       
   382 @
       
   383 text
       
   384 @d1 1
       
   385 d16 1
       
   386 a16 1
       
   387 		* A =Web.Topic= name specifying a topic in another web, i.e. ==%<nop>INCLUDE{"%TWIKIWEB%.TWikiWebsTable"}%==
       
   388 @