1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Suppress TOC for unsupported versions of pgBackRest.

The intent is to tidy the releases page and nobody should care much about the old, unsupported releases,
This commit is contained in:
David Steele 2016-09-04 09:27:56 -04:00
parent 8f61473955
commit 56ee666e69
3 changed files with 18 additions and 4 deletions

View File

@ -282,6 +282,9 @@ sub docGet
# Get the release version # Get the release version
my $strVersion = $oRelease->paramGet('version'); my $strVersion = $oRelease->paramGet('version');
# Display versions in TOC?
my $bTOC = true;
# Create a release section # Create a release section
if ($strVersion =~ /dev$/) if ($strVersion =~ /dev$/)
{ {
@ -320,6 +323,7 @@ sub docGet
} }
$iUnsupportedReleaseTotal++; $iUnsupportedReleaseTotal++;
$bTOC = false;
} }
# Format the date # Format the date
@ -345,7 +349,7 @@ sub docGet
} }
# Add section and titles # Add section and titles
my $oReleaseSection = $oSection->nodeAdd('section', undef, {id => $strVersion}); my $oReleaseSection = $oSection->nodeAdd('section', undef, {id => $strVersion, toc => !$bTOC ? 'n' : undef});
$oReleaseSection->paramSet(XML_SECTION_PARAM_ANCHOR, XML_SECTION_PARAM_ANCHOR_VALUE_NOINHERIT); $oReleaseSection->paramSet(XML_SECTION_PARAM_ANCHOR, XML_SECTION_PARAM_ANCHOR_VALUE_NOINHERIT);
$oReleaseSection->nodeAdd('title')->textSet( $oReleaseSection->nodeAdd('title')->textSet(

View File

@ -161,7 +161,7 @@ sub process
$oPageBody->add($oChildSectionElement); $oPageBody->add($oChildSectionElement);
if (defined($oPageTocBody)) if (defined($oPageTocBody) && defined($oChildSectionTocElement))
{ {
$oPageTocBody->add($oChildSectionTocElement); $oPageTocBody->add($oChildSectionTocElement);
} }
@ -456,8 +456,12 @@ sub sectionProcess
$self->sectionProcess($oChild, $strAnchor, $iDepth + 1); $self->sectionProcess($oChild, $strAnchor, $iDepth + 1);
$oSectionBodyElement->add($oChildSectionElement); $oSectionBodyElement->add($oChildSectionElement);
if (defined($oChildSectionTocElement))
{
$oSectionTocElement->add($oChildSectionTocElement); $oSectionTocElement->add($oChildSectionTocElement);
} }
}
# Check if the child can be processed by a parent # Check if the child can be processed by a parent
else else
{ {
@ -470,7 +474,7 @@ sub sectionProcess
( (
$strOperation, $strOperation,
{name => 'oSectionElement', value => $oSectionElement, trace => true}, {name => 'oSectionElement', value => $oSectionElement, trace => true},
{name => 'oSectionTocElement', value => $oSectionTocElement, trace => true} {name => 'oSectionTocElement', value => $oSection->paramTest('toc', 'n') ? undef : $oSectionTocElement, trace => true}
); );
} }

View File

@ -161,6 +161,12 @@
<p>Fixed minor documentation reproducibility issues related to binary paths.</p> <p>Fixed minor documentation reproducibility issues related to binary paths.</p>
</release-item> </release-item>
</release-bug-list> </release-bug-list>
<release-refactor-list>
<release-item>
<p>Suppress TOC for unsupported versions of <backrest/>.</p>
</release-item>
</release-refactor-list>
</release-doc-list> </release-doc-list>
</release> </release>