Fix presentation of documentation

This commit is contained in:
William DURAND 2012-07-13 15:53:24 +02:00
parent fce0f5d5a6
commit 6c3aeff227
2 changed files with 17 additions and 9 deletions

View File

@ -182,11 +182,12 @@ class ApiDocExtractor
$docblock = $this->getDocComment($method); $docblock = $this->getDocComment($method);
if (null === $annotation->getDescription()) { if (null === $annotation->getDescription()) {
$comments = explode("\n @", $docblock); $comments = explode("\n", $this->getDocCommentText($method));
// just set the first line // just set the first line
$comment = trim($comments[0]); $comment = trim($comments[0]);
$comment = preg_replace("#[\n]+#", ' ', $comment); $comment = preg_replace("#\n+#", ' ', $comment);
$comment = preg_replace('#[ ]+#', ' ', $comment); $comment = preg_replace('#\s+#', ' ', $comment);
$comment = preg_replace('#[_`*]+#', '', $comment);
if ('@' !== substr($comment, 0, 1)) { if ('@' !== substr($comment, 0, 1)) {
$annotation->setDescription($comment); $annotation->setDescription($comment);

View File

@ -204,17 +204,24 @@ strong {
font-weight: bold; font-weight: bold;
} }
.code { em {
font-style: italic;
}
code, pre {
font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
background-color: #fcf6db;
}
p code {
padding: 1px 4px 1px 4px;
border: 1px solid #e5e0c6;
} }
pre { pre {
font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
background-color: #fcf6db;
border: 1px solid black;
border-color: #e5e0c6;
padding: 10px; padding: 10px;
/* white-space: pre-line */ border: 1px solid #e5e0c6;
margin-bottom: 15px;
} }
pre code { pre code {
line-height: 1.6em; line-height: 1.6em;