pgbackrest.git / summary / log / commit / refs

commit    2dc0737e95efc858bcc7e4318b3003b3bd57f5ee
Author:   David Steele <david@pgmasters.net>
Date:     Fri Feb 16 19:39:42 2018 +0000

    Improve section source feature to not require a title or content.
    
    The title will be pulled from the source document.


doc/lib/BackRestDoc/Common/DocRender.pm | 12 ++++++++++++ doc/xml/dtd/doc.dtd | 2 +- doc/xml/release.xml | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/lib/BackRestDoc/Common/DocRender.pm b/doc/lib/BackRestDoc/Common/DocRender.pm index 5e05f2eda..0d940b7d6 100644 --- a/doc/lib/BackRestDoc/Common/DocRender.pm +++ b/doc/lib/BackRestDoc/Common/DocRender.pm @@ -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 diff --git a/doc/xml/dtd/doc.dtd b/doc/xml/dtd/doc.dtd index 9f075dcc4..49ac31d13 100644 --- a/doc/xml/dtd/doc.dtd +++ b/doc/xml/dtd/doc.dtd @@ -113,7 +113,7 @@ <!ELEMENT section (title?, ((p|list|table|host-add|execute-list|backrest-config|postgres-config|cmd-description| - option-description|code-block|block|section)+))> + option-description|code-block|block|section)*))> <!ATTLIST section id CDATA #REQUIRED> <!ATTLIST section keyword CDATA ""> <!ATTLIST section depend CDATA ""> diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 4fc7c06a6..7dcc56351 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -145,6 +145,10 @@ <p>Add coding standards document.</p> </release-item> + <release-item> + <p>Improve section source feature to not require a title or content. The title will be pulled from the source document.</p> + </release-item> + <release-item> <p>Deploy historical documentation to <path>prior</path> rather than the root directory.</p> </release-item> [parent: 1f62237684f7]