From 6c3aeff227a7a5fdffcfabe76b72ad155b763423 Mon Sep 17 00:00:00 2001 From: William DURAND Date: Fri, 13 Jul 2012 15:53:24 +0200 Subject: [PATCH] Fix presentation of documentation --- Extractor/ApiDocExtractor.php | 7 ++++--- Resources/public/css/screen.css | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Extractor/ApiDocExtractor.php b/Extractor/ApiDocExtractor.php index cddfe40..e542790 100644 --- a/Extractor/ApiDocExtractor.php +++ b/Extractor/ApiDocExtractor.php @@ -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); diff --git a/Resources/public/css/screen.css b/Resources/public/css/screen.css index 27afa17..d43d65e 100644 --- a/Resources/public/css/screen.css +++ b/Resources/public/css/screen.css @@ -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;