1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-10-30 23:37:45 +02:00

Improve section source feature to not require a title or content.

The title will be pulled from the source document.
This commit is contained in:
David Steele
2018-02-16 14:39:42 -05:00
parent 1f62237684
commit 2dc0737e95
3 changed files with 17 additions and 1 deletions

View File

@@ -444,6 +444,15 @@ sub build
{
my $oSource = ${$self->{oManifest}->sourceGet($oNode->paramGet('source'))}{doc};
# Section should not already have title defined, it should come from the source doc
if ($oNode->nodeTest('title'))
{
confess &log(ERROR, "cannot specify title in section that sources another document");
}
# Set title from source doc's title
$oNode->nodeAdd('title')->textSet($oSource->paramGet('title'));
foreach my $oSection ($oSource->nodeList('section'))
{
push(@{${$oNode->{oDoc}}{children}}, $oSection->{oDoc});
@@ -451,6 +460,9 @@ sub build
# Set path prefix to modify all section paths further down
$strPathPrefix = $strPath;
# Remove source so it is not included again later
$oNode->paramSet('source', undef);
}
}
# Build link