doc module: style h[1-6], table and code

Headers have different sizes
Tables have borders
Table headers are left-aligned
Codes are displayed inline (except inside pre) and have scrollbars if necessary

refs #6484
fixes #6632
This commit is contained in:
Alexander Klimov 2014-07-23 11:28:45 +02:00
parent e005333806
commit 9af89e6ccf
3 changed files with 34 additions and 6 deletions

View File

@ -2,6 +2,7 @@
$urlHelper = $this->getHelper('Url'); $urlHelper = $this->getHelper('Url');
$view = $this; $view = $this;
?> ?>
<div class="chapter">
<?= preg_replace_callback( <?= preg_replace_callback(
'/<a\s+(?P<attribs>[^>]*?\s+)?href="#(?P<fragment>[^"]+)"/im', '/<a\s+(?P<attribs>[^>]*?\s+)?href="#(?P<fragment>[^"]+)"/im',
function($match) use ($toc, $urlHelper, $view) { function($match) use ($toc, $urlHelper, $view) {
@ -36,3 +37,4 @@ $view = $this;
}, },
$chapterHtml $chapterHtml
); ?> ); ?>
</div>

View File

@ -2,6 +2,7 @@
$urlHelper = $this->getHelper('Url'); $urlHelper = $this->getHelper('Url');
$view = $this; $view = $this;
?> ?>
<div class="chapter">
<?= preg_replace_callback( <?= preg_replace_callback(
'/<a\s+(?P<attribs>[^>]*?\s+)?href="#(?P<fragment>[^"]+)"/im', '/<a\s+(?P<attribs>[^>]*?\s+)?href="#(?P<fragment>[^"]+)"/im',
function($match) use ($toc, $moduleName, $urlHelper, $view) { function($match) use ($toc, $moduleName, $urlHelper, $view) {
@ -36,3 +37,4 @@ $view = $this;
}, },
$chapterHtml $chapterHtml
); ?> ); ?>
</div>

View File

@ -1,9 +1,33 @@
.toc { // W3C Recommendation <http://www.w3.org/TR/CSS21/sample.html> (except h4)
float: left; h1 { font-size: 2em !important; }
width: 33.333% h2 { font-size: 1.5em !important; }
h3 { font-size: 1.17em !important; }
h4 { font-size: 1em !important; }
h5 { font-size: .83em !important; }
h6 { font-size: .75em !important; }
div.chapter {
padding-left: 5px;
} }
.doc { table th {
float: left; text-align: left;
width: 66.667% }
table th,
table td {
border: solid 1px lightgray;
padding-left: 5px;
padding-right: 5px;
}
code {
width: 100%;
overflow-x: auto;
padding: 0.2em;
display: inline;
}
pre > code {
display: inline-block;
} }