From 20720553ef52f375e4fa2fe45d12dc03d623b943 Mon Sep 17 00:00:00 2001 From: PeterThoeny Date: Tue, 26 Jun 2001 00:44:57 +0000 Subject: [PATCH] none --- TWiki/IncludeTopicsAndWebPages.mdwn | 63 +++++++++++++++++++++++++++++++++++++ TWiki/TWikiPreferences.mdwn | 16 +++++++--- TWiki/TWikiVariables.mdwn | 24 +++++++++++--- 3 files changed, 93 insertions(+), 10 deletions(-) create mode 100644 TWiki/IncludeTopicsAndWebPages.mdwn diff --git a/TWiki/IncludeTopicsAndWebPages.mdwn b/TWiki/IncludeTopicsAndWebPages.mdwn new file mode 100644 index 0000000..d84f5fe --- /dev/null +++ b/TWiki/IncludeTopicsAndWebPages.mdwn @@ -0,0 +1,63 @@ +**Include Topics and Web Pages Using **%INCLUDE\{...\}%** Variable** + +Use the **%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. + +
+ +
+ +## Syntax + +**%INCLUDE\{"page" pattern="reg-exp"\}%** + +- **"page"**:
The nameless parameter specifies the page to include. It is + - The name of a topic located in the current web, i.e. **%INCLUDE\{"WebNotify"\}%** + - A `Web.Topic` name specifying a topic in another web, i.e. **%INCLUDE\{"TWiki.TWikiWebsTable"\}%** + - A full qualified URL with **http** protocol, domain name and optional port number, i.e. **%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. + +- **pattern="reg-exp"**:
The **pattern** parameter is optional and allows you to extract some parts of a web page. Specify a [[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. + +**_Note:_** All text of a topic is included unless you specify **%STARTINCLUDE%**, **%STOPINCLUDE%** and/or a **pattern** parameter. + +## Usage Examples + +### 1. Display regression test results in a TWiki page + +
+      %INCLUDEURL{"http://domain/~qa/v1.1/REDTest.log.txt"}%
+      
+ +### 2. Display Yahoo's robot.txt file + +- You type: + - **%INCLUDE\{"http://www.yahoo.com/robots.txt"\}%**
+- You get: + + %INCLUDE{"http://www.yahoo.com/robots.txt"}% + +### 3. Display the SUNW stock quote in a TWiki page + +- You type: + - **SUNW: %INCLUDE\{"http://finance.yahoo.com/q?s=SUNW&d=v1&o=t" pattern="^.\*?>SUNW</a>[^<]+(.\*?)\\s+\\S+\\s+<small.\*"\}%**
+- You get: + - SUNW: + +### 4. Display the temperature in San Francisco + +- You type: + - **San Francisco: %INCLUDE\{"http://weather.yahoo.com/forecast/San\_Francisco\_CA\_US\_f.html" pattern="^.\*?([0-9]+\\&ordm\\;F).\*"\}%**
+- You get: + - San Francisco: + +See also other [[TWikiVariables]]. + +-- [[PeterThoeny]] - 25 Jun 2001
diff --git a/TWiki/TWikiPreferences.mdwn b/TWiki/TWikiPreferences.mdwn index 1da1d90..ed69dbf 100644 --- a/TWiki/TWikiPreferences.mdwn +++ b/TWiki/TWikiPreferences.mdwn @@ -35,23 +35,29 @@ The following settings are **_site-level preferences_** , e.g. affecting all use - Vertical size of text edit box: (can be overwritten by user preferences) - Set EDITBOXHEIGHT = 15 -- Default state of the **_link_** check box in the attach file page. Check box is initially checked if _Set ATTACHLINKBOX = CHECKED_ , unchecked if empty ( _Set ATTACHLINKBOX =_ ). If checked, a link is created to the attached file at the end of the topic: (can be overwritten by user preferences) +- Default state of the **_Release edit lock_** check box in preview. Checkbox is initially checked if `Set RELEASEEDITLOCKCHECKBOX = checked="checked"`, or unchecked if empty. If checked, make sure to click on Edit to do more changes; do **not** go back in your browser to the edit page, or you risk that someone else will edit the topic at the same time: (can be overwritten by user preferences) + - Set RELEASEEDITLOCKCHECKBOX = + +- Default state of the **_link_** check box in the attach file page. Checkbox is initially checked if `Set ATTACHLINKBOX = checked="checked"`, or unchecked if empty (`Set ATTACHLINKBOX =`). If checked, a link is created to the attached file at the end of the topic: (can be overwritten by user preferences) - Set ATTACHLINKBOX = - Wiki webmaster email address: - Set WIKIWEBMASTER = -- Mail host for outgoing mail. This is used for [[TWikiNotificationOfChanges]] if Perl module **Net::SMTP** is installed. If not, sendmail is used instead (defined by **$mailProgram** in **TWiki.cfg**). Examples: mail.your.company, localhost +- Mail host for outgoing mail. This is used for [[TWikiNotificationOfChanges]] if Perl module **Net::SMTP** is installed. If not, sendmail is used instead (defined by **$mailProgram** in **TWiki.cfg**). Examples: `mail.your.company` or `localhost` - Set SMTPMAILHOST = mail - http-equiv meta tags for **_view_**, **_rdiff_**, **_attach_**, **_search\*_** scripts: - - Set HTTP\_EQUIV\_ON\_VIEW = + + * Set HTTP_EQUIV_ON_VIEW = - http-equiv meta tags for **_edit_** script. Example to expire immediately:
`Set HTTP_EQUIV_ON_EDIT = ` - - Set HTTP\_EQUIV\_ON\_EDIT = + + * Set HTTP_EQUIV_ON_EDIT = - http-equiv meta tags for **_preview_** script: - - Set HTTP\_EQUIV\_ON\_PREVIEW = + + * Set HTTP_EQUIV_ON_PREVIEW = - Users or groups allowed to change this %TOPIC% topic: (I.e. [[TWikiAdminGroup]]) - Set ALLOWTOPICCHANGE = diff --git a/TWiki/TWikiVariables.mdwn b/TWiki/TWikiVariables.mdwn index 4107e35..9eb8ecc 100644 --- a/TWiki/TWikiVariables.mdwn +++ b/TWiki/TWikiVariables.mdwn @@ -149,7 +149,7 @@ 2 digit year 99 - Variables can be shortened to 3 characters. Example:
%GMTIME{"$day $month, $year - $hour:$min:$sec"}% is
29 Jun, 2010 - 15:26:32 + Variables can be shortened to 3 characters. Example:
%GMTIME{"$day $month, $year - $hour:$min:$sec"}% is
29 Jun, 2010 - 15:26:37 %SERVERTIME% @@ -176,8 +176,22 @@ REMOTE_USER environment variable, is - %INCLUDE{"SomeTopic"}% - Server side include, includes another topic. The current Wiki web is searched by default. Example: %INCLUDE{"TWiki.TWikiWebsTable"}% + %INCLUDE{"page" ...}% + Server side include to [[Main/IncludeTopicsAndWebPages]]. The parameter is composed of the page name, followed by an optional pattern="(reg-exp)" pair. The page name is: + + + + + + + + + + + + +
"SomeTopic" The name of a topic located in the current web, i.e. %INCLUDE{"WebNotify"}%
"Web.Topic" A topic in another web, i.e. %INCLUDE{"TWiki.TWikiWebsTable"}%
"http://..." A full qualified URL, i.e. %INCLUDE{"http://twiki.org/"}%
+ %STARTINCLUDE% @@ -226,7 +240,7 @@ web="Name"
web="Main Know"
web="all" - Wiki web to search: A web, a list of webs separated by whitespace, or all webs [2] + Wiki web to search: A web, a list of webs separated by whitespace, or all webs. [2] Current web @@ -414,4 +428,4 @@ Additional variables are defined in the preferences ( site-level ( **_SL_** ) in - Additional preferences variables can be defined on all three level as needed. Example: - `Set MYLOGO = %PUBURLPATH%/%MAINWEB%/LogoTopic/logo.gif` --- [[PeterThoeny]] - 24 Mar 2001
+-- [[PeterThoeny]] - 25 Jun 2001
-- 1.9.4