Added footer command line option to ScalaDoc so ScalaDoc users aren't forced to have the EPFL/Typesafe copyright notice in their API docs. Now comes with the ability for users to add their own footer. Review by ureche.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25616 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
heathermiller 2011-09-07 05:18:37 +00:00
parent 7b5f6777d0
commit 895a5b1808
4 changed files with 29 additions and 2 deletions

View File

@ -1409,6 +1409,7 @@ DOCUMENTATION
destdir="${build-docs.dir}/library"
doctitle="Scala Standard Library"
docversion="${version.number}"
docfooter="epfl"
docsourceurl="https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/€{FILE_PATH}.scala#L1"
docUncompilable="${src.dir}/library-aux"
sourcepath="${src.dir}"

View File

@ -106,6 +106,9 @@ class Scaladoc extends ScalaMatchingTask {
/** The document title of the generated HTML documentation. */
private var doctitle: Option[String] = None
/** The document footer of the generated HTML documentation. */
private var docfooter: Option[String] = None
/** The document version, to be added to the title. */
private var docversion: Option[String] = None
@ -304,6 +307,14 @@ class Scaladoc extends ScalaMatchingTask {
doctitle = Some(input)
}
/** Sets the <code>docfooter</code> attribute.
*
* @param input The value of <code>docfooter</code>.
*/
def setDocfooter(input: String) {
docfooter = Some(input)
}
/** Set the <code>addparams</code> info attribute.
*
* @param input The value for <code>addparams</code>.
@ -523,6 +534,7 @@ class Scaladoc extends ScalaMatchingTask {
if (!extdirs.isEmpty) docSettings.extdirs.value = asString(getExtdirs)
if (!encoding.isEmpty) docSettings.encoding.value = encoding.get
if (!doctitle.isEmpty) docSettings.doctitle.value = decodeEscapes(doctitle.get)
if (!docfooter.isEmpty) docSettings.docfooter.value = decodeEscapes(docfooter.get)
if (!docversion.isEmpty) docSettings.docversion.value = decodeEscapes(docversion.get)
if (!docsourceurl.isEmpty) docSettings.docsourceurl.value =decodeEscapes(docsourceurl.get)
if (!docUncompilable.isEmpty) docSettings.docUncompilable.value = decodeEscapes(docUncompilable.get)

View File

@ -41,6 +41,13 @@ class Settings(error: String => Unit) extends scala.tools.nsc.Settings(error) {
""
)
val docfooter = StringSetting (
"-doc-footer",
"footer",
"A footer on every ScalaDoc page, by default the EPFL/Typesafe copyright notice. Can be overridden with a custom footer.",
""
)
val docUncompilable = StringSetting (
"-doc-no-compile",
"path",
@ -81,7 +88,7 @@ class Settings(error: String => Unit) extends scala.tools.nsc.Settings(error) {
// For improved help output.
def scaladocSpecific = Set[Settings#Setting](
docformat, doctitle, docversion, docUncompilable, docsourceurl, docgenerator
docformat, doctitle, docfooter, docversion, docUncompilable, docsourceurl, docgenerator
)
val isScaladocSpecific: String => Boolean = scaladocSpecific map (_.name)
}

View File

@ -168,7 +168,14 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
</div>
<div id="tooltip" ></div>
<div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div>
{
if (Set("epfl", "EPFL").contains(tpl.universe.settings.docfooter.value))
<div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div>
else
<div id="footer"> { tpl.universe.settings.docfooter.value } </div>
}
</body>
}