mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 07:41:43 +03:00
Fix presentation of documentation
This commit is contained in:
parent
fce0f5d5a6
commit
6c3aeff227
@ -182,11 +182,12 @@ class ApiDocExtractor
|
||||
$docblock = $this->getDocComment($method);
|
||||
|
||||
if (null === $annotation->getDescription()) {
|
||||
$comments = explode("\n @", $docblock);
|
||||
$comments = explode("\n", $this->getDocCommentText($method));
|
||||
// just set the first line
|
||||
$comment = trim($comments[0]);
|
||||
$comment = preg_replace("#[\n]+#", ' ', $comment);
|
||||
$comment = preg_replace('#[ ]+#', ' ', $comment);
|
||||
$comment = preg_replace("#\n+#", ' ', $comment);
|
||||
$comment = preg_replace('#\s+#', ' ', $comment);
|
||||
$comment = preg_replace('#[_`*]+#', '', $comment);
|
||||
|
||||
if ('@' !== substr($comment, 0, 1)) {
|
||||
$annotation->setDescription($comment);
|
||||
|
@ -204,17 +204,24 @@ strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.code {
|
||||
em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
code, pre {
|
||||
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 {
|
||||
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;
|
||||
/* white-space: pre-line */
|
||||
border: 1px solid #e5e0c6;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
pre code {
|
||||
line-height: 1.6em;
|
||||
|
Loading…
x
Reference in New Issue
Block a user