Skip to content

Commit

Permalink
Item12837: Implement ENDINCLUDE and STOPSECTION
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@17466 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Apr 2, 2014
1 parent 693b30b commit ea39af3
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 56 deletions.
2 changes: 1 addition & 1 deletion EditRowPlugin/lib/Foswiki/Plugins/EditRowPlugin/Table.pm
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ sub generateHelp {
$attrs->{helptopic} );
my ( $meta, $text ) = Foswiki::Func::readTopic( $web, $topic );
$text =~ s/.*?%STARTINCLUDE%//s;
$text =~ s/%STOPINCLUDE%.*//s;
$text =~ s/%(?:STOP|END)INCLUDE%.*//s;
$text =~ s/^\s*//s;
$text =~ s/\s*$//s;
$help = Foswiki::Func::renderText($text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sub parse {

# them from processing as tables by converting them to verbatim.
$text =~ s/<!-- (STARTINCLUDE .*?) -->/<verbatim \001="$1">/g;
$text =~ s/<!-- (STOPINCLUDE .*?) -->/<\/verbatim \001="$1">/g;
$text =~ s/<!-- ((?:END|STOP)INCLUDE .*?) -->/<\/verbatim \001="$1">/g;

$this->SUPER::parse( $text, $meta );

Expand Down Expand Up @@ -82,7 +82,7 @@ sub parse {
}
else {

# STARTINCLUDE/STOPINCLUDE support
# STARTINCLUDE/STOP/ENDINCLUDE support
$t =~ s/<\/?verbatim \001="(.*?)">/<!-- $1 -->/gs;
}
push( @result, $t );
Expand Down
2 changes: 1 addition & 1 deletion EditRowPlugin/lib/Foswiki/Plugins/EditRowPlugin/View.pm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ sub process {
)
{
$precruft = "<!-- STARTINCLUDE $_[2].$_[1] -->\n";
$postcruft = "\n<!-- STOPINCLUDE $_[2].$_[1] -->";
$postcruft = "\n<!-- (?:END|STOP)INCLUDE $_[2].$_[1] -->";
}
$_ = $precruft . $line . $postcruft;
$hasTables = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,20 @@ sub renderSlideToc {
sub readSlideTemplate {
my $this = shift;

my ( $web, $topic ) = Foswiki::Func::normalizeWebTopicName( $this->{web},
my ( $web, $topic ) =
Foswiki::Func::normalizeWebTopicName( $this->{web},
$this->{params}{template} || $this->{defaultTemplateTopic} );

my ( $meta, $text ) = Foswiki::Func::readTopic( $web, $topic );

# remove everything before %STARTINCLUDE% and after %STOPINCLUDE%
# remove everything before %STARTINCLUDE% and after %STOP/ENDINCLUDE%
unless ($text) {
return _htmlAlert( "%SYSTEMWEB%.SlideShowPlugin Error:",
"Slide template topic <nop>$web.$topic not found or empty!" );
}

$text =~ s/.*?%STARTINCLUDE%//s;
$text =~ s/%STOPINCLUDE%.*//s;
$text =~ s/%(?:END|STOP)INCLUDE%.*//s;

unless ( $text =~ /%SLIDETITLE%/ && $text =~ /%SLIDETEXT%/ ) {
return _htmlAlert(
Expand Down
34 changes: 17 additions & 17 deletions UnitTestContrib/test/unit/Fn_INCLUDE.pm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ sub run_test_simple {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTINCLUDE%2%STOPINCLUDE% 3' );
'1 %STARTINCLUDE%2%ENDINCLUDE% 3' );
$this->assert_str_equals(
$includeError ? "A $includeError B" : 'A 2 B',
Foswiki::Func::expandCommonVariables(
Expand All @@ -90,7 +90,7 @@ sub run_test_simple {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION{type="include"}%2%ENDSECTION{type="include"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
'1 %STARTSECTION{type="include"}%2%STOPSECTION{type="include"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
);
$this->assert_str_equals(
$includeError ? "A $includeError B" : 'A 24 B',
Expand All @@ -101,7 +101,7 @@ sub run_test_simple {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION%2%ENDSECTION% 3' );
'1 %STARTSECTION%2%STOPSECTION% 3' );
$this->assert_str_equals(
$includeError ? "A $includeError B" : 'A 1 2 3 B',
Foswiki::Func::expandCommonVariables(
Expand All @@ -121,7 +121,7 @@ sub run_test_simple {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
'1 %STARTSECTION{"_default"}%2%STOPSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
);
$this->assert_str_equals(
$includeError ? "A $includeError B" : 'A 2 B',
Expand All @@ -132,7 +132,7 @@ sub run_test_simple {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%STOPSECTION{type="include"}% 5'
);
$this->assert_str_equals(
$noSectionError ? "A $noSectionError B" : 'A 2 B',
Expand All @@ -143,7 +143,7 @@ sub run_test_simple {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%STOPSECTION{type="include"}% 5'
);
$this->assert_str_equals(
$includeError ? "A B" : 'A 2 B',
Expand All @@ -157,7 +157,7 @@ sub run_test_simple {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
'1 %STARTSECTION{"_default"}%2%STOPSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
);
$this->assert_str_equals(
$noSectionError ? "A B" : 'A 2 B',
Expand Down Expand Up @@ -325,7 +325,7 @@ sub test_simple_section {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION{type="include"}%2%ENDSECTION{type="include"}% 3' );
'1 %STARTSECTION{type="include"}%2%STOPSECTION{type="include"}% 3' );
$this->assert_str_equals(
$noSectionError ? "A $noSectionError B" : 'A 2 B',
Foswiki::Func::expandCommonVariables(
Expand All @@ -339,7 +339,7 @@ sub test_simple_section {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION{type="include"}%2%ENDSECTION{type="include"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
'1 %STARTSECTION{type="include"}%2%ENDSECTION{type="include"}% 3 %STARTSECTION{type="include"}%4%STOPSECTION{type="include"}% 5'
);
$this->assert_str_equals(
$noSectionError ? "A $noSectionError B" : 'A 24 B',
Expand Down Expand Up @@ -368,7 +368,7 @@ sub test_simple_section {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3' );
'1 %STARTSECTION{"_default"}%2%STOPSECTION{"_default"}% 3' );
$this->assert_str_equals(
$noSectionError ? "A $noSectionError B" : 'A 1 2 3 B',
Foswiki::Func::expandCommonVariables(
Expand All @@ -382,7 +382,7 @@ sub test_simple_section {
);

Foswiki::Func::saveTopic( $this->{test_web}, 'FirstTopic', undef,
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%STOPSECTION{type="include"}% 5'
);
$this->assert_str_equals(
$includeError ? "A $includeError B" : 'A 2 B',
Expand Down Expand Up @@ -451,7 +451,7 @@ sub test_select_first_that_defines_section {
}

Foswiki::Func::saveTopic( $this->{test_web}, 'NoSection', undef,
'1 %STARTSECTION{"_default"}%2%ENDSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
'1 %STARTSECTION{"_default"}%2%STOPSECTION{"_default"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
);
$this->test_simple_section(
'section_name',
Expand All @@ -469,7 +469,7 @@ sub test_select_first_that_defines_section {

if ( !$this->check_dependency('Foswiki,<,1.2') ) {
Foswiki::Func::saveTopic( $this->{test_web}, 'TheSection', undef,
'1 %STARTSECTION{"section_name"}%::%ENDSECTION{"section_name"}% 3 %STARTSECTION{type="include"}%4%ENDSECTION{type="include"}% 5'
'1 %STARTSECTION{"section_name"}%::%ENDSECTION{"section_name"}% 3 %STARTSECTION{type="include"}%4%STOPSECTION{type="include"}% 5'
);
$this->assert_str_equals(
'A :: B',
Expand Down Expand Up @@ -607,7 +607,7 @@ sub test_3158 {
Snurfle
%STARTSECTION{"suction"}%
Such a section!
%ENDSECTION{"suction"}%
%STOPSECTION{"suction"}%
Out of scope
THIS
$inkyDink->save();
Expand Down Expand Up @@ -657,11 +657,11 @@ sub test_5649 {
Snurfle
%STARTSECTION{"suction"}%
Such a section!
%ENDSECTION{"suction"}%
%STOPSECTION{"suction"}%
Out of scope
THIS
my $handledTopicText = $topicText;
$handledTopicText =~ s/%(START|END)SECTION{"suction"}%//g;
$handledTopicText =~ s/%(START|STOP|END)SECTION{"suction"}%//g;

my ($inkyDink) =
Foswiki::Func::readTopic( $this->{other_web}, $includedTopic );
Expand Down Expand Up @@ -953,7 +953,7 @@ HERE

Foswiki::Func::saveTopic( $this->{test_web}, $includeTopic . 'Next',
undef, <<'HERE' );
%STARTSECTION{"one" one="_"}% %one% %two% - %INCLUDE{"%nest%" section="one" one="%one%"}% - %three% %last% %ENDSECTION{"one" last="999"}%
%STARTSECTION{"one" one="_"}% %one% %two% - %INCLUDE{"%nest%" section="one" one="%one%"}% - %three% %last% %STOPSECTION{"one" last="999"}%
HERE

$this->assert_str_equals(
Expand Down
92 changes: 73 additions & 19 deletions UnitTestContrib/test/unit/Fn_SECTION.pm
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ sub test_sections8 {
);
}

sub test_sections8S {
my $this = shift;

# Unnamed sections of different types overlap
my $text =
'0%STARTSECTION{type="include"}%1%STARTSECTION{type="templateonly"}%2%STOPSECTION{type="include"}%3%STOPSECTION{type="templateonly"}%4';
my ( $nt, $s ) = Foswiki::parseSections($text);
$this->assert_str_equals( "01234", $nt );
$this->assert_str_equals(
'end="3" name="_SECTION0" start="1" type="include";end="4" name="_SECTION1" start="2" type="templateonly"',
dumpsec($s)
);
}

sub test_sections9 {
my $this = shift;

Expand All @@ -133,6 +147,20 @@ sub test_sections9 {
);
}

sub test_sections9S {
my $this = shift;

# Named sections of same type overlap
my $text =
'0%STARTSECTION{"one"}%1%STARTSECTION{"two"}%2%STOPSECTION{"one"}%3%STOPSECTION{"two"}%4';
my ( $nt, $s ) = Foswiki::parseSections($text);
$this->assert_str_equals( "01234", $nt );
$this->assert_str_equals(
'end="3" name="one" start="1" type="section";end="4" name="two" start="2" type="section"',
dumpsec($s)
);
}

sub test_sections10 {
my $this = shift;

Expand All @@ -147,6 +175,20 @@ sub test_sections10 {
);
}

sub test_sections10S {
my $this = shift;

# Named sections nested
my $text =
'0%STARTSECTION{name="one"}%1%STARTSECTION{name="two"}%2%STOPSECTION{name="two"}%3%STOPSECTION{name="one"}%4';
my ( $nt, $s ) = Foswiki::parseSections($text);
$this->assert_str_equals( "01234", $nt );
$this->assert_str_equals(
'end="4" name="one" start="1" type="section";end="3" name="two" start="2" type="section"',
dumpsec($s)
);
}

# For test_manysections, Item10316
sub _manysections_inc {
my ( $this, $section ) = @_;
Expand All @@ -160,27 +202,27 @@ HERE
}

sub _manysections_setup {
my ($this) = @_;
my $junk = "I am a fish.\n" x 100;
my $text = <<"HERE";
my ( $this, $end ) = @_;
my $junk = "I am a fish.\n" x 100;
my $text = <<"HERE";
Pre-INCLUDEable %STARTINCLUDE% In-the-INCLUDEable bit $junk
%STARTSECTION{"1"}% 1 content $junk%ENDSECTION{"1"}%
%STARTSECTION{"1"}% 1 content $junk%${end}SECTION{"1"}%
%STARTSECTION{"2"}% 2 content
%STARTSECTION{"21"}% 2.1 content $junk%ENDSECTION{"21"}%
%STARTSECTION{"21"}% 2.1 content $junk%${end}SECTION{"21"}%
%STARTSECTION{"22"}% 2.2 content
%STARTSECTION{"221"}% 2.2.1 content $junk%ENDSECTION{"221"}%
%STARTSECTION{"222" ignored="asd"}% 2.2.2 content $junk%ENDSECTION{"222"}%
%STARTSECTION{"223"}% 2.2.3 content $junk%ENDSECTION{"223" ignoreend="oooooo"}%
%STARTSECTION{"224"}% 2.2.4 start continued content $junk%ENDSECTION{"224"}%
%STARTSECTION{"224"}% 2.2.4b continue continued content $junk%ENDSECTION{"224"}%$junk%ENDSECTION{"22"}%
%STARTSECTION{"23"}% 2.3 content %STARTSECTION{"224"}% 2.2.4c continue again continued content $junk%ENDSECTION{"224"}%$junk%ENDSECTION{"23"}%
%STARTSECTION{"224"}% 2.2.4d continue yet again continued content $junk%ENDSECTION{"224"}%
%STARTSECTION{"221"}% 2.2.1 content $junk%${end}SECTION{"221"}%
%STARTSECTION{"222" ignored="asd"}% 2.2.2 content $junk%${end}SECTION{"222"}%
%STARTSECTION{"223"}% 2.2.3 content $junk%${end}SECTION{"223" ignoreend="oooooo"}%
%STARTSECTION{"224"}% 2.2.4 start continued content $junk%${end}SECTION{"224"}%
%STARTSECTION{"224"}% 2.2.4b continue continued content $junk%${end}SECTION{"224"}%$junk%${end}SECTION{"22"}%
%STARTSECTION{"23"}% 2.3 content %STARTSECTION{"224"}% 2.2.4c continue again continued content $junk%${end}SECTION{"224"}%$junk%${end}SECTION{"23"}%
%STARTSECTION{"224"}% 2.2.4d continue yet again continued content $junk%${end}SECTION{"224"}%
$junk
%ENDSECTION{"2"}%
%${end}SECTION{"2"}%
Still-in-the-INCLUDEable bit
%STARTSECTION{"224"}% 2.2.4e continue yet again more continued content $junk%ENDSECTION{"224"}%
$junk%STOPINCLUDE% Post-INCLUDEable
%STARTSECTION{"3"}% 3 content %STARTSECTION{"224"}% 2.2.4f continue yet again even more continued content $junk%ENDSECTION{"224"}%$junk%ENDSECTION{"3"}%
%STARTSECTION{"224"}% 2.2.4e continue yet again more continued content $junk%${end}SECTION{"224"}%
$junk%${end}INCLUDE% Post-INCLUDEable
%STARTSECTION{"3"}% 3 content %STARTSECTION{"224"}% 2.2.4f continue yet again even more continued content $junk%${end}SECTION{"224"}%$junk%${end}SECTION{"3"}%
HERE
my ($topicObj) =
Foswiki::Func::readTopic( $this->{test_web}, $this->{test_topic} );
Expand Down Expand Up @@ -232,9 +274,21 @@ HERE
);
}

sub test_manysections {
sub test_manysections_END {
my ($this) = @_;
my %sections = $this->_manysections_setup('END');

foreach my $section ( keys %sections ) {
$this->assert_str_equals( $sections{$section},
$this->_manysections_inc($section) );
}

return;
}

sub test_manysections_STOP {
my ($this) = @_;
my %sections = $this->_manysections_setup();
my %sections = $this->_manysections_setup('STOP');

foreach my $section ( keys %sections ) {
$this->assert_str_equals( $sections{$section},
Expand All @@ -246,7 +300,7 @@ sub test_manysections {

sub test_manysections_timing {
my ($this) = @_;
my %sections = $this->_manysections_setup();
my %sections = $this->_manysections_setup('STOP');
my $numsections = scalar( keys %sections );
my $numcycles = 50;
my $benchmark = timeit(
Expand Down
8 changes: 8 additions & 0 deletions core/data/System/VarENDINCLUDE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%META:TOPICINFO{author="ProjectContributor" date="1396410293" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
#VarENDINCLUDE
---+++ ENDINCLUDE -- end position of topic text if included
* If present in included topic, stop to include text at this location and ignore the remaining text. A normal view of the topic shows everyting exept the =%<nop>STOPINCLUDE%= macro itself.
* Syntax: =%<nop>ENDINCLUDE%=
* Related: [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarINCLUDE][INCLUDE]], [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarSTARTINCLUDE][STARTINCLUDE]]

4 changes: 2 additions & 2 deletions core/data/System/VarINCLUDE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1394718137" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1396410293" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
#VarINCLUDE
---+++ INCLUDE{"topic"} -- include other topic.
Expand All @@ -15,7 +15,7 @@
| =section="name"= | Includes only the specified named section, as defined in the included topic by the [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarSTARTSECTION][STARTSECTION{"name" type="section"} ]] and [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarENDSECTION][ENDSECTION{"name" type="section"}]] macros. Nothing is shown if the named section does not exists. =section=""= is equivalent to not specifying a section | |
| =PARONE="val 1"%BR% PARTWO="val 2"= | Any other parameter will be defined as a macro within the scope of the included topic. The example parameters on the left will result in =%<nop>PARONE%= and =%<nop>PARTWO%= being defined within the included topic. | |
* Examples: See IncludeTopicsAndWebPages
* Related: [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarBASETOPIC][BASETOPIC]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarBASEWEB][BASEWEB]], [[#VarINCLUDEURL][INCLUDE("URL")]], [[#VarINCLUDEdoc][INCLUDE("doc:")]] ,[[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarINCLUDINGTOPIC][INCLUDINGTOPIC]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarINCLUDINGWEB][INCLUDINGWEB]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarSTARTINCLUDE][STARTINCLUDE]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarSTOPINCLUDE][STOPINCLUDE]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarSTARTSECTION][STARTSECTION]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarENDSECTION][ENDSECTION]]
* Related: [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarBASETOPIC][BASETOPIC]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarBASEWEB][BASEWEB]], [[#VarINCLUDEURL][INCLUDE("URL")]], [[#VarINCLUDEdoc][INCLUDE("doc:")]] ,[[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarINCLUDINGTOPIC][INCLUDINGTOPIC]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarINCLUDINGWEB][INCLUDINGWEB]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarSTARTINCLUDE][STARTINCLUDE]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarENDINCLUDE][ENDINCLUDE]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarSTOPINCLUDE][STOPINCLUDE]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarSTARTSECTION][STARTSECTION]], [[%IF{"'%BASETOPIC%'='Macros'" then="#"}%VarENDSECTION][ENDSECTION]]
#VarINCLUDEURL
---+++ INCLUDE{"url"} -- include a web page
* Syntax: =%<nop>INCLUDE{"http://..." ...}%= (See also the topic form of =%<nop>INCLUDE%=)
Expand Down
6 changes: 3 additions & 3 deletions core/data/System/VarSTARTINCLUDE.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
%META:TOPICINFO{author="ProjectContributor" date="1394718138" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1396410293" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
#VarSTARTINCLUDE
---+++ STARTINCLUDE -- start position of topic text if included
* If present in included topic, start to include text from this location up to the end, or up to the location of the =%<nop>STOPINCLUDE%= macro. A normal view of the topic shows everything exept the =%<nop>STARTINCLUDE%= macro itself.
* If present in included topic, start to include text from this location up to the end, or up to the location of the =%<nop>ENDINCLUDE%= macro. A normal view of the topic shows everything except the =%<nop>STARTINCLUDE%= macro itself.
* Syntax: =%<nop>STARTINCLUDE%=
<blockquote class="foswikiHelp">%T% If you want more than one part of the topic included, use =%<nop>STARTSECTION{type="include"}%= instead</blockquote>
* Related: [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarINCLUDE][INCLUDE]], [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarSTARTSECTION][STARTSECTION]], [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarSTOPINCLUDE][STOPINCLUDE]]
* Related: [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarINCLUDE][INCLUDE]], [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarSTARTSECTION][STARTSECTION]], [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarENDINCLUDE][ENDINCLUDE]]

6 changes: 2 additions & 4 deletions core/data/System/VarSTOPINCLUDE.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
%META:TOPICINFO{author="ProjectContributor" date="1394718138" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1396410293" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
#VarSTOPINCLUDE
---+++ STOPINCLUDE -- end position of topic text if included
* If present in included topic, stop to include text at this location and ignore the remaining text. A normal view of the topic shows everyting exept the =%<nop>STOPINCLUDE%= macro itself.
* Syntax: =%<nop>STOPINCLUDE%=
---+++ STOPINCLUDE -- Alias for [[VarENDINCLUDE][ENDINCLUDE]]
* Related: [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarINCLUDE][INCLUDE]], [[%IF{"'%INCLUDINGTOPIC%'='Macros'" then="#"}%VarSTARTINCLUDE][STARTINCLUDE]]

0 comments on commit ea39af3

Please sign in to comment.