diff options
-rw-r--r-- | build.xml | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala | 12 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/page/Template.scala | 12 |
4 files changed, 23 insertions, 5 deletions
@@ -1607,7 +1607,7 @@ DOCUMENTATION <mkdir dir="${build-docs.dir}/library"/> <scaladoc destdir="${build-docs.dir}/library" - doctitle="Scala Standard Library" + doctitle="Scala Standard Library API (Scaladoc)" docversion="${version.number}" docfooter="epfl" docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1" diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala index 4f05678d85..0116e02e0e 100644 --- a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala @@ -119,7 +119,7 @@ class HtmlFactory(val universe: doc.Universe, index: doc.Index) { def writeTemplate(tpl: DocTemplateEntity) { if (!(written contains tpl)) { - writeForThis(new page.Template(tpl)) + writeForThis(new page.Template(universe, tpl)) written += tpl tpl.templates map writeTemplate } diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala index b58c71eaa9..1544dafc69 100644 --- a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala +++ b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala @@ -22,6 +22,16 @@ abstract class HtmlPage extends Page { thisPage => /** The title of this page. */ protected def title: String + /** The page description */ + protected def description: String = + // unless overwritten, will display the title in a spaced format, keeping - and . + title.replaceAll("[^a-zA-Z0-9\\.\\-]+", " ").replaceAll("\\-+", " - ").replaceAll(" +", " ") + + /** The page keywords */ + protected def keywords: String = + // unless overwritten, same as description, minus the " - " + description.replaceAll(" - ", " ") + /** Additional header elements (links, scripts, meta tags, etc.) required for this page. */ protected def headers: NodeSeq @@ -35,6 +45,8 @@ abstract class HtmlPage extends Page { thisPage => <html> <head> <title>{ title }</title> + <meta name="description" content={ description }/> + <meta name="keywords" content={ keywords }/> <meta http-equiv="content-type" content={ "text/html; charset=" + site.encoding }/> { headers } </head> diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala index e35286b281..bd5f98bab7 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala @@ -11,13 +11,19 @@ package page import model._ import scala.xml.{ NodeSeq, Text, UnprefixedAttribute } -class Template(tpl: DocTemplateEntity) extends HtmlPage { +class Template(universe: doc.Universe, tpl: DocTemplateEntity) extends HtmlPage { val path = templateToPath(tpl) - val title = - tpl.qualifiedName + def title = { + val s = universe.settings + + tpl.name + + ( if (!s.doctitle.isDefault) " - " + s.doctitle.value else "" ) + + ( if (!s.docversion.isDefault) (" " + s.docversion.value) else "" ) + + " - " + tpl.qualifiedName + } val headers = <xml:group> |