Skip to content

Commit

Permalink
Item13105: ease performance impact of content
Browse files Browse the repository at this point in the history
... when crawled by a bot
  • Loading branch information
MichaelDaum committed Nov 21, 2014
1 parent f7b7c27 commit 10ab896
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
23 changes: 14 additions & 9 deletions core/data/System/Macros.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1394718135" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1416593166" format="1.1" version="1"}%
%META:TOPICPARENT{name="WebHome"}%
%STARTINCLUDE%
---+ Macros
Expand Down Expand Up @@ -36,9 +36,9 @@ To use a macro type its name. For example,
The following describes only these types of macros:
* [[PreferenceSettings][Preference settings]]
* Most macros provided by plugins (those that use [[PerlDoc?module=Foswiki::Func#registerTagHandler][registerTagHandler()]])
<blockquote class="foswikiHelp">%X% *Not* those that use [[PerlDoc?module=Foswiki::Func#commonTagsHandler][commonTagsHandler()]]</blockquote>
<div class="foswikiHelp">%X% *Not* those that use [[PerlDoc?module=Foswiki::Func#commonTagsHandler][commonTagsHandler()]]</div>
* Most built-in Foswiki macros
<blockquote class="foswikiHelp">%X% Notable exceptions include: [[VarCALC][CALC]], [[VarSTARTSECTION][STARTSECTION]]/ENDSECTION, [[VarSTARTINCLUDE][STARTINCLUDE]]/STOPINCLUDE</blockquote>
<div class="foswikiHelp">%X% Notable exceptions include: [[VarCALC][CALC]], [[VarSTARTSECTION][STARTSECTION]]/ENDSECTION, [[VarSTARTINCLUDE][STARTINCLUDE]]/STOPINCLUDE</div>

%STARTSECTION{"insideoutlefttoright"}%
#StandardForm
Expand All @@ -57,7 +57,8 @@ The macros are expanded in this order: MACRO3, MACRO4, MACRO2, MACRO1.

#AnimatedExample
---+++++ Animated Example
%JQREQUIRE{"CYCLE,EASING,CHILI"}%<!-- ids are appended with %INCLUDINGTOPIC%

%JQREQUIRE{"cycle,easing,chili"}%<!-- ids are appended with %INCLUDINGTOPIC%
to avoid duplicates in %SYSTEMWEB%.CompleteDocumentation -->%ADDTOZONE{"script"
id="NestedSlideshow%INCLUDINGTOPIC%"
text="<script type='text/javascript'>
Expand All @@ -81,6 +82,7 @@ jQuery(document).ready(function($) {
#NestedSlideshowNav%INCLUDINGTOPIC% a.activeSlide,
#NestedSlideshowNav%INCLUDINGTOPIC% a:hover { background: #cff }
#NestedSlideshowNav%INCLUDINGTOPIC% a:focus { outline: none; }
#NestedSlideshow%INCLUDINGTOPIC% pre { overflow:visible }
</style>"
}%<div id="NestedSlideshowNav%INCLUDINGTOPIC%"></div>
<div id="NestedSlideshow%INCLUDINGTOPIC%">
Expand Down Expand Up @@ -160,9 +162,9 @@ jQuery(document).ready(function($) {
---++++ Delayed form
[[#StandardForm][Standard form]] macros can nearly always be used to build the parameter string of another macro; however, sometimes it is desirable to bypass the [[#InsideOutLeftToRight][inside-out]] expansion order and delay the inner macro until after the outer macro has finished expansion. This is accomplished by using the [[FormatTokens][$percent]] format token instead of =%=, and escaping any ="= character it uses (becomes =\"=)

%STARTSECTION{"tokensupport"}%<blockquote class="foswikiHelp">
%STARTSECTION{"tokensupport"}%<div class="foswikiHelp">
%T% When working with a given [[Macros][macro]], consult its documentation to determine which parameters support the =$percent/$percnt= [[FormatTokens][format tokens]]. Generally only _output parameters_ like =header=, =format= and =footer= support [[FormatTokens][format tokens]].
</blockquote>%ENDSECTION{"tokensupport"}%
</div>%ENDSECTION{"tokensupport"}%
*Example:*
<verbatim class="tml">
%MACRO1{
Expand All @@ -172,11 +174,13 @@ jQuery(document).ready(function($) {
}%
</verbatim>
The macros are expanded in this order: MACRO3, MACRO4, MACRO1, *MACRO2*.

#AnimatedDelayedExample
---+++++ Animated Example

From the [[FormattedSearch#ConditionalOutputExample][conditional output example]]:

%JQREQUIRE{"CYCLE,EASING,CHILI"}%<!-- ids are appended with %INCLUDINGTOPIC%
%JQREQUIRE{"cycle,easing,chili"}%<!-- ids are appended with %INCLUDINGTOPIC%
to avoid duplicates in %SYSTEMWEB%.CompleteDocumentation -->%ADDTOZONE{"script"
id="DelayedSlideshow%INCLUDINGTOPIC%"
text="<script type='text/javascript'>
Expand All @@ -200,6 +204,7 @@ jQuery(document).ready(function($) {
#DelayedSlideshowNav%INCLUDINGTOPIC% a.activeSlide,
#DelayedSlideshowNav%INCLUDINGTOPIC% a:hover { background: #cff }
#DelayedSlideshowNav%INCLUDINGTOPIC% a:focus { outline: none; }
#DelayedSlideshow%INCLUDINGTOPIC% pre { overflow:visible }
</style>"
}%<div id="DelayedSlideshowNav%INCLUDINGTOPIC%"></div>
<div id="DelayedSlideshow%INCLUDINGTOPIC%">
Expand Down Expand Up @@ -303,13 +308,13 @@ By convention all settings, predefined macros and macros registered by plugins a

Most predefined macros return values that were either set in the configuration when Foswiki was installed, or taken from server info (such as current username, or date and time). Some, like =%<nop>SEARCH%=, are powerful and general tools.

<blockquote class="foswikiHelp">
<div class="foswikiHelp">
%X% Predefined macros can be overridden by [[%SYSTEMWEB%.PreferenceSettings][preference settings]] (except TOPIC and WEB)

%X% Plugins may extend the set of predefined macros (see individual Plugins topics for details)

%T% *Take the time to thoroughly read through ALL preference macros.* If you actively configure your site, review macros periodically. They cover a wide range of functions, and it can be easy to miss the one perfect macro for something you have in mind. For example, see =%<nop>BASETOPIC%=, =%<nop>INCLUDE%=, and the mighty =%<nop>SEARCH%=.
</blockquote>
</div>

Your installation of Foswiki %WIKIVERSION% has the following registered macros:

Expand Down
35 changes: 18 additions & 17 deletions core/data/System/SearchPatternCookbook.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1394718136" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1416593166" format="1.1" version="1"}%
%META:TOPICPARENT{name="FormattedSearch"}%
---+!! Search Pattern Cookbook

Expand Down Expand Up @@ -45,7 +45,7 @@ The following search pattern can be employed:
%ENDSECTION{"solution1"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution1"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution1"}%

---+++ Solution 2
If your table has this format:
Expand Down Expand Up @@ -76,7 +76,7 @@ You need to skip the header row. Use this search:
%ENDSECTION{"solution2"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution2"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution2"}%

---+++ Solution 3
If you want to grab the complete row for each occurrence of a string in a table, for instance the word "Marketing":
Expand All @@ -102,7 +102,7 @@ use this query:
%ENDSECTION{"solution3"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution3"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution3"}%

<!-- ============================== -->
#SearchFormClassification
Expand Down Expand Up @@ -139,7 +139,7 @@ We will:
%ENDSECTION{"solution4"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution4"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution4"}%

The filtering select dialogue is created as in Pattern 1:

Expand All @@ -164,7 +164,7 @@ The filtering select dialogue is created as in Pattern 1:

This will create similar functionality as Foswiki:Extensions.TopicClassificationAddOn

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution5"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution5"}%


<!-- ============================== -->
Expand All @@ -185,7 +185,7 @@ Parent of [[%TOPIC%]] is [[%QUERY{ "parent.name" }%]]
%ENDSECTION{"solution6"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution6"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution6"}%


<!-- ============================== -->
Expand Down Expand Up @@ -213,7 +213,7 @@ The parent information is stored in the topic meta data. Do a SEARCH to find all
%ENDSECTION{"solution7"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution7"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution7"}%

See also [[HierarchicalNavigation]] for an elaborate example.

Expand Down Expand Up @@ -248,7 +248,7 @@ How to find and display public webs in a drop down list box.

Public webs can be found with the %<nop>WEBLIST% macro.

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution8"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution8"}%

<!-- ============================== -->
#SearchBulletList
Expand Down Expand Up @@ -285,7 +285,7 @@ The following search pattern can be employed:
%ENDSECTION{"solution9"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution9"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution9"}%

To render the bullet list as a comma-separated list, use the =separator= parameter:
<verbatim class="tml">
Expand All @@ -303,7 +303,7 @@ To render the bullet list as a comma-separated list, use the =separator= paramet
%ENDSECTION{"solution10"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution10"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution10"}%

<!-- ============================== -->
#MovedTopics
Expand All @@ -330,7 +330,7 @@ Search for the 'moved' meta data.
%ENDSECTION{"solution11"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution11"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution11"}%

---++ Pattern 8: Extract level-1 headings

Expand All @@ -354,17 +354,18 @@ Use the =$pattern()= token.
%ENDSECTION{"solution12"}%
</verbatim>

%INCLUDE{"%WEB%.%TOPIC%" section="click2execute" id="solution12"}%
%INCLUDE{"%WEB%.%TOPIC%" section="click2exec" id="solution12"}%
%ENDSECTION{"Headings"}%

---
*Related Topics:* UserDocumentationCategory, SearchHelp, [[Macros]], FormattedSearch, RegularExpression

<verbatim class="foswikiHidden">
%STARTSECTION{"click2execute"}%
%STARTSECTION{"click2exec"}%
%BUTTON{"Click to execute" onclick="jQuery('#%id%').trigger('refresh')"}%

<div class="jqLoader {mode:'manual', web:'%WEB%', topic:'%TOPIC%', section:'%id%'}" id="%id%"></div>
%ENDSECTION{"click2execute"}%
<div class="jqLoader {mode:'manual', web:'%INCLUDINGWEB%', topic:'%INCLUDINGTOPIC%', section:'%id%'}" id="%id%"></div>
%JQREQUIRE{"loader"}%
%ENDSECTION{"click2exec"}%
</verbatim>
%JQREQUIRE{"chili,loader"}%
%JQREQUIRE{"chili"}%

0 comments on commit 10ab896

Please sign in to comment.