diff --git a/doc/lib/BackRestDoc/Common/DocExecute.pm b/doc/lib/BackRestDoc/Common/DocExecute.pm index 5f5416f48..86680a73b 100644 --- a/doc/lib/BackRestDoc/Common/DocExecute.pm +++ b/doc/lib/BackRestDoc/Common/DocExecute.pm @@ -67,6 +67,8 @@ sub new $self->{bExe} = $bExe; + $self->{iCmdLineLen} = $self->{oDoc}->paramGet('cmd-line-len', false, 80); + # Return from function and log return values if any return logDebugReturn ( @@ -105,6 +107,7 @@ sub executeKey # Format and split command $strCommand =~ s/[ ]*\n[ ]*/ \\\n /smg; + $strCommand =~ s/ \\\@ \\//smg; my @stryCommand = split("\n", $strCommand); my $hCacheKey = @@ -186,16 +189,17 @@ sub execute # Make sure that no lines are greater than 80 chars foreach my $strLine (split("\n", $strCommand)) { - if (length(trim($strLine)) > 80) + if (length(trim($strLine)) > $self->{iCmdLineLen}) { - confess &log(ERROR, "command has a line > 80 characters:\n${strCommand}\noffending line: ${strLine}"); + confess &log(ERROR, + "command has a line > $self->{iCmdLineLen} characters:\n${strCommand}\noffending line: ${strLine}"); } } } &log(DEBUG, (' ' x $iIndent) . "execute: $strCommand"); - if (!$oCommand->paramTest('skip', 'y')) + if ($self->{oManifest}->variableReplace($oCommand->paramGet('skip', false, 'n')) ne 'y') { if ($self->{bExe} && $self->isRequired($oSection)) { @@ -503,8 +507,8 @@ sub backrestConfig foreach my $oOption ($oConfig->nodeList('backrest-config-option')) { - my $strSection = $oOption->paramGet('section'); - my $strKey = $oOption->paramGet('key'); + my $strSection = $self->{oManifest}->variableReplace($oOption->paramGet('section')); + my $strKey = $self->{oManifest}->variableReplace($oOption->paramGet('key')); my $strValue; if (!$oOption->paramTest('remove', 'y')) @@ -568,7 +572,7 @@ sub backrestConfig } } - my $strLocalFile = "/home/vagrant/data/db-master/etc/pgbackrest.conf"; + my $strLocalFile = "/home/vagrant/data/pgbackrest.conf"; # Save the ini file iniSave($strLocalFile, $self->{config}{$strHostName}{$$hCacheKey{file}}, true); @@ -663,7 +667,7 @@ sub postgresConfig confess &log(ERROR, "cannot configure postgres on host ${strHostName} because the host does not exist"); } - my $strLocalFile = '/home/vagrant/data/db-master/etc/postgresql.conf'; + my $strLocalFile = '/home/vagrant/data/postgresql.conf'; $oHost->copyFrom($$hCacheKey{file}, $strLocalFile); if (!defined(${$self->{'pg-config'}}{$strHostName}{$$hCacheKey{file}}{base}) && $self->{bExe}) @@ -972,14 +976,14 @@ sub sectionChildProcess my $oHost = new pgBackRestTest::Common::HostTest( $$hCacheKey{name}, "doc-$$hCacheKey{name}", $$hCacheKey{image}, $$hCacheKey{user}, $$hCacheKey{os}, - [$$hCacheKey{mount}]); + defined($$hCacheKey{mount}) ? [$$hCacheKey{mount}] : undef); $self->{host}{$$hCacheKey{name}} = $oHost; $self->{oManifest}->variableSet("host-$$hCacheKey{name}-ip", $oHost->{strIP}, true); $$hCacheValue{ip} = $oHost->{strIP}; # Execute cleanup commands - foreach my $oExecute ($oChild->nodeList('execute')) + foreach my $oExecute ($oChild->nodeList('execute', false)) { $self->execute($oSection, $$hCacheKey{name}, $oExecute, $iDepth + 1, false); } diff --git a/doc/lib/BackRestDoc/Common/DocManifest.pm b/doc/lib/BackRestDoc/Common/DocManifest.pm index 64d7aab72..709a6e86d 100644 --- a/doc/lib/BackRestDoc/Common/DocManifest.pm +++ b/doc/lib/BackRestDoc/Common/DocManifest.pm @@ -26,7 +26,13 @@ use constant FILE_MANIFEST => 'manifest # Render constants #################################################################################################################################### use constant RENDER => 'render'; +use constant RENDER_COMPACT => 'compact'; + push @EXPORT, qw(RENDER_COMPACT); use constant RENDER_FILE => 'file'; +use constant RENDER_MENU => 'menu'; + push @EXPORT, qw(RENDER_MENU); +use constant RENDER_PRETTY => 'pretty'; + push @EXPORT, qw(RENDER_PRETTY); use constant RENDER_TYPE => 'type'; use constant RENDER_TYPE_HTML => 'html'; @@ -128,6 +134,9 @@ sub new # Get the file param $${oRenderHash}{file} = $oRender->paramGet(RENDER_FILE, false); + $${oRenderHash}{&RENDER_COMPACT} = $oRender->paramGet(RENDER_COMPACT, false, 'n') eq 'y' ? true : false; + $${oRenderHash}{&RENDER_PRETTY} = $oRender->paramGet(RENDER_PRETTY, false, 'n') eq 'y' ? true : false; + $${oRenderHash}{&RENDER_MENU} = false; logDebugMisc ( @@ -157,12 +166,6 @@ sub new $$oRenderOutHash{source} = $strSource; - # Get the menu caption - if (defined($oRenderOut->paramGet('menu', false)) && $strType ne RENDER_TYPE_HTML) - { - confess &log(ERROR, "menu is only valid with html render type"); - } - # Get the filename if (defined($oRenderOut->paramGet('file', false))) { @@ -176,8 +179,16 @@ sub new } } + # Get the menu caption + if (defined($oRenderOut->paramGet('menu', false)) && $strType ne RENDER_TYPE_HTML) + { + confess &log(ERROR, "menu is only valid with html render type"); + } + if (defined($oRenderOut->paramGet('menu', false))) { + $${oRenderHash}{&RENDER_MENU} = true; + if ($strType eq RENDER_TYPE_HTML) { $$oRenderOutHash{menu} = $oRenderOut->paramGet('menu', false); diff --git a/doc/lib/BackRestDoc/Common/DocRender.pm b/doc/lib/BackRestDoc/Common/DocRender.pm index ccfcbf213..4c54fec78 100644 --- a/doc/lib/BackRestDoc/Common/DocRender.pm +++ b/doc/lib/BackRestDoc/Common/DocRender.pm @@ -236,6 +236,14 @@ sub new } } + if (defined($self->{oDoc})) + { + $self->{bToc} = !defined($self->{oDoc}->paramGet('toc', false)) || $self->{oDoc}->paramGet('toc') eq 'y' ? true : false; + $self->{bTocNumber} = + $self->{bToc} && + (!defined($self->{oDoc}->paramGet('toc-number', false)) || $self->{oDoc}->paramGet('toc-number') eq 'y') ? true : false; + } + # Return from function and log return values if any return logDebugReturn ( diff --git a/doc/lib/BackRestDoc/Custom/DocCustomRelease.pm b/doc/lib/BackRestDoc/Custom/DocCustomRelease.pm index c59a7a9a1..b4537b176 100644 --- a/doc/lib/BackRestDoc/Custom/DocCustomRelease.pm +++ b/doc/lib/BackRestDoc/Custom/DocCustomRelease.pm @@ -259,6 +259,7 @@ sub docGet # Create the doc my $oDoc = new BackRestDoc::Common::Doc(); $oDoc->paramSet('title', $self->{oDoc}->paramGet('title')); + $oDoc->paramSet('toc-number', $self->{oDoc}->paramGet('toc-number')); # Set the description for use as a meta tag $oDoc->fieldSet('description', $self->{oDoc}->fieldGet('description')); diff --git a/doc/lib/BackRestDoc/Html/DocHtmlBuilder.pm b/doc/lib/BackRestDoc/Html/DocHtmlBuilder.pm index 4b08a2df7..562ccc507 100644 --- a/doc/lib/BackRestDoc/Html/DocHtmlBuilder.pm +++ b/doc/lib/BackRestDoc/Html/DocHtmlBuilder.pm @@ -36,7 +36,9 @@ sub new $self->{strFavicon}, $self->{strLogo}, $self->{strDescription}, - $self->{bPretty} + $self->{bPretty}, + $self->{bCompact}, + $self->{strCss}, ) = logDebugParam ( @@ -46,7 +48,9 @@ sub new {name => 'strFavicon', required => false}, {name => 'strLogo', required => false}, {name => 'strDescription', required => false}, - {name => 'bPretty', default => false} + {name => 'bPretty', default => false}, + {name => 'bCompact', default => false}, + {name => 'strCss', required => false}, ); $self->{oBody} = new BackRestDoc::Html::DocHtmlElement(HTML_BODY); @@ -133,6 +137,10 @@ sub htmlRender $oElement->{strContent} = trim($oElement->{strContent}); $strHtml .= $self->lf(); } + else + { + $oElement->{strContent} =~ s/\&/\&\;/g; + } $strHtml .= $oElement->{strContent}; @@ -169,6 +177,22 @@ sub htmlRender ); } +#################################################################################################################################### +# escape +# +# Generate the HTML. +#################################################################################################################################### +sub escape +{ + my $self = shift; + my $strBuffer = shift; + + $strBuffer =~ s/\&/\&\;/g; + $strBuffer =~ s/\" . $self->lf() . $self->indent(0) . "" . $self->lf() . $self->indent(0) . "" . $self->lf() . - $self->indent(1) . "$self->{strTitle}" . $self->lf() . - $self->indent(1) . "" . $self->lf() . + $self->indent(1) . '' . $self->escape($self->{strTitle}) . '' . $self->lf() . + $self->indent(1) . "" . $self->lf(); + + if (!$self->{bCompact}) + { + $strHtml .= # $self->indent(1) . "" . $self->lf() . - $self->indent(1) . "" . $self->lf() . - $self->indent(1) . "{strName}\">" . $self->lf() . - $self->indent(1) . "{strTitle}\">" . $self->lf() . - $self->indent(1) . "" . $self->lf(); + $self->indent(1) . + '' . $self->lf() . + $self->indent(1) . + '' . $self->lf() . + $self->indent(1) . '' . $self->lf(); - if (defined($self->{strFavicon})) - { - $strHtml .= - $self->indent(1) . "{strFavicon}\" type=\"image/png\">" . $self->lf(); - } + if (defined($self->{strFavicon})) + { + $strHtml .= + $self->indent(1) . "{strFavicon}\" type=\"image/png\">" . $self->lf(); + } - if (defined($self->{strLogo})) - { - $strHtml .= - $self->indent(1) . "" . $self->lf() . - $self->indent(1) . "{strLogo}\">" . $self->lf(); - } + if (defined($self->{strLogo})) + { + $strHtml .= + $self->indent(1) . "" . $self->lf() . + $self->indent(1) . "{strLogo}\">" . + $self->lf(); + } - if (defined($self->{strDescription})) - { - $strHtml .= - $self->indent(1) . "{strDescription}\">" . $self->lf() . - $self->indent(1) . "{strDescription}\">" . $self->lf(); - } + if (defined($self->{strDescription})) + { + $strHtml .= + $self->indent(1) . + '' . $self->lf() . + $self->indent(1) . + '' . $self->lf(); + } + } - $self->indent(0) . "" . $self->lf(); + if (defined($self->{strCss})) + { + my $strCss = $self->{strCss}; - $strHtml .= $self->htmlRender($self->bodyGet(), 0); + if (!$self->{bPretty}) + { + $strCss =~ s/^\s+//mg; + $strCss =~ s/\n//g; + $strCss =~ s/\/\*.*?\*\///g; + } + + $strHtml .= + $self->indent(1) . '' . $self->lf(); + } + else + { + $strHtml .= + $self->indent(1) . "" . $self->lf(); + } + + $strHtml .= + $self->indent(0) . "" . $self->lf() . + $self->htmlRender($self->bodyGet(), 0); # Complete the html $strHtml .= diff --git a/doc/lib/BackRestDoc/Html/DocHtmlPage.pm b/doc/lib/BackRestDoc/Html/DocHtmlPage.pm index c30a5330f..848a2ee11 100644 --- a/doc/lib/BackRestDoc/Html/DocHtmlPage.pm +++ b/doc/lib/BackRestDoc/Html/DocHtmlPage.pm @@ -34,20 +34,33 @@ sub new $strOperation, $oManifest, $strRenderOutKey, - $bExe + $bMenu, + $bExe, + $bCompact, + $strCss, + $bPretty, ) = logDebugParam ( __PACKAGE__ . '->new', \@_, {name => 'oManifest'}, {name => 'strRenderOutKey'}, - {name => 'bExe'} + {name => 'bMenu'}, + {name => 'bExe'}, + {name => 'bCompact'}, + {name => 'strCss'}, + {name => 'bPretty'}, ); # Create the class hash my $self = $class->SUPER::new(RENDER_TYPE_HTML, $oManifest, $strRenderOutKey, $bExe); bless $self, $class; + $self->{bMenu} = $bMenu; + $self->{bCompact} = $bCompact; + $self->{strCss} = $strCss; + $self->{bPretty} = $bPretty; + # Return from function and log return values if any return logDebugReturn ( @@ -77,12 +90,15 @@ sub process my $strSubTitle = $oPage->paramGet('subtitle', false); my $oHtmlBuilder = new BackRestDoc::Html::DocHtmlBuilder( - "{[project]} - Reliable PostgreSQL Backup & Restore", - $strTitle . (defined($strSubTitle) ? " - ${strSubTitle}" : ''), - $self->{oManifest}->variableGet('project-favicon'), - $self->{oManifest}->variableGet('project-logo'), - trim($self->{oDoc}->fieldGet('description')), - $self->{bPretty}); + $self->{oManifest}->variableReplace('{[project]}' . (defined($self->{oManifest}->variableGet('project-tagline')) ? + $self->{oManifest}->variableGet('project-tagline') : '')), + $self->{oManifest}->variableReplace($strTitle . (defined($strSubTitle) ? " - ${strSubTitle}" : '')), + $self->{oManifest}->variableGet('project-favicon'), + $self->{oManifest}->variableGet('project-logo'), + $self->{oManifest}->variableReplace(trim($self->{oDoc}->fieldGet('description'))), + $self->{bPretty}, + $self->{bCompact}, + $self->{bCompact} ? $self->{strCss} : undef); # Generate header my $oPageHeader = $oHtmlBuilder->bodyGet()->addNew(HTML_DIV, 'page-header'); @@ -107,40 +123,41 @@ sub process } # Generate menu - my $oMenuBody = $oHtmlBuilder->bodyGet()->addNew(HTML_DIV, 'page-menu')->addNew(HTML_DIV, 'menu-body'); - - if ($self->{strRenderOutKey} ne 'index') + if ($self->{bMenu}) { - my $oRenderOut = $self->{oManifest}->renderOutGet(RENDER_TYPE_HTML, 'index'); + my $oMenuBody = $oHtmlBuilder->bodyGet()->addNew(HTML_DIV, 'page-menu')->addNew(HTML_DIV, 'menu-body'); - $oMenuBody-> - addNew(HTML_DIV, 'menu')-> - addNew(HTML_A, 'menu-link', {strContent => $$oRenderOut{menu}, strRef => '{[project-url-root]}'}); - } - - # ??? The sort order here is hokey and only works for backrest - will need to be changed - foreach my $strRenderOutKey (sort {$b cmp $a} $self->{oManifest}->renderOutList(RENDER_TYPE_HTML)) - { - if ($strRenderOutKey ne $self->{strRenderOutKey} && $strRenderOutKey ne 'index') + if ($self->{strRenderOutKey} ne 'index') { - my $oRenderOut = $self->{oManifest}->renderOutGet(RENDER_TYPE_HTML, $strRenderOutKey); + my $oRenderOut = $self->{oManifest}->renderOutGet(RENDER_TYPE_HTML, 'index'); $oMenuBody-> addNew(HTML_DIV, 'menu')-> - addNew(HTML_A, 'menu-link', {strContent => $$oRenderOut{menu}, strRef => "${strRenderOutKey}.html"}); + addNew(HTML_A, 'menu-link', {strContent => $$oRenderOut{menu}, strRef => '{[project-url-root]}'}); + } + + # ??? The sort order here is hokey and only works for backrest - will need to be changed + foreach my $strRenderOutKey (sort {$b cmp $a} $self->{oManifest}->renderOutList(RENDER_TYPE_HTML)) + { + if ($strRenderOutKey ne $self->{strRenderOutKey} && $strRenderOutKey ne 'index') + { + my $oRenderOut = $self->{oManifest}->renderOutGet(RENDER_TYPE_HTML, $strRenderOutKey); + + $oMenuBody-> + addNew(HTML_DIV, 'menu')-> + addNew(HTML_A, 'menu-link', {strContent => $$oRenderOut{menu}, strRef => "${strRenderOutKey}.html"}); + } } } # Generate table of contents my $oPageTocBody; - if (!defined($oPage->paramGet('toc', false)) || $oPage->paramGet('toc') eq 'y') + if ($self->{bToc}) { my $oPageToc = $oHtmlBuilder->bodyGet()->addNew(HTML_DIV, 'page-toc'); - $oPageToc-> - addNew(HTML_DIV, 'page-toc-title', - {strContent => "Table of Contents"}); + $oPageToc->addNew(HTML_DIV, 'page-toc-header')->addNew(HTML_DIV, 'page-toc-title', {strContent => "Table of Contents"}); $oPageTocBody = $oPageToc-> addNew(HTML_DIV, 'page-toc-body'); @@ -148,12 +165,13 @@ sub process # Generate body my $oPageBody = $oHtmlBuilder->bodyGet()->addNew(HTML_DIV, 'page-body'); + my $iSectionNo = 1; # Render sections foreach my $oSection ($oPage->nodeList('section')) { my ($oChildSectionElement, $oChildSectionTocElement) = - $self->sectionProcess($oSection, undef, 1); + $self->sectionProcess($oSection, undef, "${iSectionNo}", 1); $oPageBody->add($oChildSectionElement); @@ -161,6 +179,8 @@ sub process { $oPageTocBody->add($oChildSectionTocElement); } + + $iSectionNo++; } my $oPageFooter = $oHtmlBuilder->bodyGet()-> @@ -188,6 +208,7 @@ sub sectionProcess $strOperation, $oSection, $strAnchor, + $strSectionNo, $iDepth ) = logDebugParam @@ -195,6 +216,7 @@ sub sectionProcess __PACKAGE__ . '->sectionProcess', \@_, {name => 'oSection'}, {name => 'strAnchor', required => false}, + {name => 'strSectionNo'}, {name => 'iDepth'} ); @@ -208,7 +230,7 @@ sub sectionProcess # Working variables $strAnchor = ($oSection->paramTest(XML_SECTION_PARAM_ANCHOR, XML_SECTION_PARAM_ANCHOR_VALUE_NOINHERIT) ? '' : - (defined($strAnchor) ? "${strAnchor}/" : '')) . + (defined($strAnchor) ? "${strAnchor}." : '')) . $oSection->paramGet('id'); # Create the section toc element @@ -221,18 +243,26 @@ sub sectionProcess $oSectionElement->addNew(HTML_A, undef, {strId => $strAnchor}); # Add the section title to section and toc + my $oSectionHeaderElement = $oSectionElement->addNew(HTML_DIV, "section${iDepth}-header"); my $strSectionTitle = $self->processText($oSection->nodeGet('title')->textGet()); - $oSectionElement-> - addNew(HTML_DIV, "section${iDepth}-title", - {strContent => $strSectionTitle}); + if ($self->{bTocNumber}) + { + $oSectionHeaderElement->addNew(HTML_DIV, "section${iDepth}-number", {strContent => $strSectionNo}); + } - my $oTocSectionTitleElement = $oSectionTocElement-> - addNew(HTML_DIV, "section${iDepth}-toc-title"); + $oSectionHeaderElement->addNew(HTML_DIV, "section${iDepth}-title", {strContent => $strSectionTitle}); - $oTocSectionTitleElement-> - addNew(HTML_A, undef, - {strContent => $strSectionTitle, strRef => "#${strAnchor}"}); + if ($self->{bTocNumber}) + { + $oSectionTocElement->addNew(HTML_DIV, "section${iDepth}-toc-number", {strContent => $strSectionNo}); + } + + my $oTocSectionTitleElement = $oSectionTocElement->addNew(HTML_DIV, "section${iDepth}-toc-title"); + + $oTocSectionTitleElement->addNew( + HTML_A, undef, + {strContent => $strSectionTitle, strRef => "#${strAnchor}"}); # Add the section intro if it exists if (defined($oSection->textGet(false))) @@ -247,6 +277,7 @@ sub sectionProcess # Process each child my $oSectionBodyExe; + my $iSectionNo = 1; foreach my $oChild ($oSection->nodeList()) { @@ -449,7 +480,7 @@ sub sectionProcess elsif ($oChild->nameGet() eq 'section') { my ($oChildSectionElement, $oChildSectionTocElement) = - $self->sectionProcess($oChild, $strAnchor, $iDepth + 1); + $self->sectionProcess($oChild, $strAnchor, "${strSectionNo}.${iSectionNo}", $iDepth + 1); $oSectionBodyElement->add($oChildSectionElement); @@ -457,6 +488,8 @@ sub sectionProcess { $oSectionTocElement->add($oChildSectionTocElement); } + + $iSectionNo++; } # Check if the child can be processed by a parent else diff --git a/doc/lib/BackRestDoc/Html/DocHtmlSite.pm b/doc/lib/BackRestDoc/Html/DocHtmlSite.pm index a5e8d0b81..1fd275f48 100644 --- a/doc/lib/BackRestDoc/Html/DocHtmlSite.pm +++ b/doc/lib/BackRestDoc/Html/DocHtmlSite.pm @@ -96,25 +96,35 @@ sub process # Assign function parameters, defaults, and log debug info my $strOperation = logDebugParam(__PACKAGE__ . '->process'); - # Copy the css file - my $strCssFileDestination = "$self->{strHtmlPath}/default.css"; - copy($self->{strCssFile}, $strCssFileDestination) - or confess &log(ERROR, "unable to copy $self->{strCssFile} to ${strCssFileDestination}"); + # Get render options + my $oRender = $self->{oManifest}->renderGet(RENDER_TYPE_HTML); - # Copy the favicon file - if (defined($self->{strFaviconFile})) - { - my $strFaviconFileDestination = "$self->{strHtmlPath}/" . $self->{oManifest}->variableGet('project-favicon'); - copy($self->{strFaviconFile}, $strFaviconFileDestination) - or confess &log(ERROR, "unable to copy $self->{strFaviconFile} to ${strFaviconFileDestination}"); - } + my $bMenu = $$oRender{&RENDER_MENU}; + my $bPretty = $$oRender{&RENDER_PRETTY}; + my $bCompact = $$oRender{&RENDER_COMPACT}; - # Copy the project logo file - if (defined($self->{strProjectLogoFile})) + if (!$bCompact) { - my $strProjectLogoFileDestination = "$self->{strHtmlPath}/" . $self->{oManifest}->variableGet('project-logo'); - copy($self->{strProjectLogoFile}, $strProjectLogoFileDestination) - or confess &log(ERROR, "unable to copy $self->{strProjectLogoFile} to ${strProjectLogoFileDestination}"); + # Copy the css file + my $strCssFileDestination = "$self->{strHtmlPath}/default.css"; + copy($self->{strCssFile}, $strCssFileDestination) + or confess &log(ERROR, "unable to copy $self->{strCssFile} to ${strCssFileDestination}"); + + # Copy the favicon file + if (defined($self->{strFaviconFile})) + { + my $strFaviconFileDestination = "$self->{strHtmlPath}/" . $self->{oManifest}->variableGet('project-favicon'); + copy($self->{strFaviconFile}, $strFaviconFileDestination) + or confess &log(ERROR, "unable to copy $self->{strFaviconFile} to ${strFaviconFileDestination}"); + } + + # Copy the project logo file + if (defined($self->{strProjectLogoFile})) + { + my $strProjectLogoFileDestination = "$self->{strHtmlPath}/" . $self->{oManifest}->variableGet('project-logo'); + copy($self->{strProjectLogoFile}, $strProjectLogoFileDestination) + or confess &log(ERROR, "unable to copy $self->{strProjectLogoFile} to ${strProjectLogoFileDestination}"); + } } foreach my $strPageId ($self->{oManifest}->renderOutList(RENDER_TYPE_HTML)) @@ -122,12 +132,14 @@ sub process &log(INFO, " render out: ${strPageId}"); my $strHtml; + my $oRenderOut = $self->{oManifest}->renderOutGet(RENDER_TYPE_HTML, $strPageId); eval { - $strHtml = - $self->{oManifest}->variableReplace( - (new BackRestDoc::Html::DocHtmlPage($self->{oManifest}, $strPageId, $self->{bExe}))->process()); + $strHtml = $self->{oManifest}->variableReplace( + new BackRestDoc::Html::DocHtmlPage( + $self->{oManifest}, $strPageId, $bMenu, $self->{bExe}, $bCompact, fileStringRead($self->{strCssFile}), + $bPretty)->process()); return true; } @@ -140,9 +152,10 @@ sub process my $oRenderOut = $self->{oManifest}->renderOutGet(RENDER_TYPE_HTML, $strPageId); $self->{oManifest}->cacheReset($$oRenderOut{source}); - $strHtml = - $self->{oManifest}->variableReplace( - (new BackRestDoc::Html::DocHtmlPage($self->{oManifest}, $strPageId, $self->{bExe}))->process()); + $strHtml = $self->{oManifest}->variableReplace( + new BackRestDoc::Html::DocHtmlPage( + $self->{oManifest}, $strPageId, $bMenu, $self->{bExe}, $bCompact, fileStringRead($self->{strCssFile}), + $bPretty)->process()); } else { @@ -151,7 +164,8 @@ sub process }; # Save the html page - fileStringWrite("$self->{strHtmlPath}/${strPageId}.html", $strHtml, false); + my $strFile = "$self->{strHtmlPath}/" . (defined($$oRenderOut{file}) ? $$oRenderOut{file} : "${strPageId}.html"); + fileStringWrite($strFile, $strHtml, false); } # Return from function and log return values if any diff --git a/doc/manifest.xml b/doc/manifest.xml index 26041f5af..f53ee212a 100644 --- a/doc/manifest.xml +++ b/doc/manifest.xml @@ -4,6 +4,7 @@ pgBackRest + Reliable PostgreSQL Backup & Restore use pgBackRest::Version; BACKREST_VERSION use BackRestDoc::Custom::DocCustomRelease; diff --git a/doc/resource/html/default.css b/doc/resource/html/default.css index 39520fca8..e39d085db 100644 --- a/doc/resource/html/default.css +++ b/doc/resource/html/default.css @@ -136,21 +136,49 @@ Table of Contents margin-top: .5em; } +.section1-toc-number +{ + display: inline; + font-size: 14pt; + margin-right: .5em; +} + .section1-toc-title { - /*margin-top: .25em;*/ + display: inline; font-size: 14pt; } +.section2-toc +{ + margin-left: 1.8em; +} + +.section2-toc-number +{ + display: inline; + margin-right: .5em; +} + .section2-toc-title { - font-size: 12pt; - margin-left: 2em; + display: inline; +} + +.section3-toc +{ + margin-left: 2.3em; +} + +.section3-toc-number +{ + display: inline; + margin-right: .5em; } .section3-toc-title { - margin-left: 4em; + display: inline; } /******************************************************************************* @@ -171,13 +199,13 @@ Section margin-top: 1em; } -.section1-title, .section2-title, .section3-title, .page-toc-title +.section1-header, .section2-header, .section3-header, .page-toc-header { margin-top: .5em; font-weight: 500; } -.section1-title, .page-toc-title +.section1-header, .page-toc-header { border-radius: 3px; background-color: #396a93; @@ -187,6 +215,17 @@ Section margin-bottom: .5em; } +.section1-number, .section2-number, .section3-number +{ + display: inline; + margin-right: .5em; +} + +.section1-title, .section2-title, .section3-title +{ + display: inline; +} + .section1-subtitle, .section2-subtitle, .section3-subtitle { font-weight: bold; @@ -216,7 +255,7 @@ Section margin-top: 1em; } -.section2-title +.section2-header { border-bottom: 2px #396a93 solid; color: #396a93; @@ -244,7 +283,7 @@ Section border-top: none; } -.section3-title +.section3-header { display: inline; font-size: 14pt; diff --git a/doc/xml/dtd/doc.dtd b/doc/xml/dtd/doc.dtd index 3ee00f98a..672e95fe5 100644 --- a/doc/xml/dtd/doc.dtd +++ b/doc/xml/dtd/doc.dtd @@ -3,6 +3,8 @@ + + @@ -116,7 +118,7 @@ - diff --git a/doc/xml/dtd/manifest.dtd b/doc/xml/dtd/manifest.dtd index 0c1041604..5a34af8b0 100644 --- a/doc/xml/dtd/manifest.dtd +++ b/doc/xml/dtd/manifest.dtd @@ -14,6 +14,8 @@ + + diff --git a/doc/xml/release.xml b/doc/xml/release.xml index c807c4116..95b1e8602 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -1,6 +1,6 @@ - + The {[project]} Releases detail each version of the software and lists the changes made in each version. @@ -169,6 +169,44 @@ + + + + +

Fixed missing variable replacements.

+
+ + +

Removed hard-coded host names from configuration file paths.

+
+
+ + + +

Allow command-line length to be configured using cmd-line-len param.

+
+ + +

Added compact param to allow CSS to be embedded in HTML file.

+
+ + +

Added pretty param to produce HTML with proper indenting.

+
+ + +

Only generate HTML menu when required and don't require index page.

+
+ + +

Assign numbers to sections by default.

+
+ + +

VM mount points are now optional.

+
+
+
diff --git a/test/lib/pgBackRestTest/Common/HostTest.pm b/test/lib/pgBackRestTest/Common/HostTest.pm index 001ba2eff..215eee9c8 100644 --- a/test/lib/pgBackRestTest/Common/HostTest.pm +++ b/test/lib/pgBackRestTest/Common/HostTest.pm @@ -49,7 +49,7 @@ sub new {name => 'strImage', trace => true}, {name => 'strUser', trace => true}, {name => 'strOS', trace => true}, - {name => 'stryMount', trace => true} + {name => 'stryMount', required => false, trace => true} ); executeTest("docker rm -f $self->{strContainer}", {bSuppressError => true});