diff options
author | michelou <michelou@epfl.ch> | 2007-10-18 16:07:06 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-10-18 16:07:06 +0000 |
commit | 7a8dc411ac7c04dc17d9e37b045868f5ed9d2dd6 (patch) | |
tree | d6684c6d083549e750e3a9bf824d6f2c0dd21cc6 /src/compiler | |
parent | 853e53f1176fe7b49b12f4656fe86826d4094a96 (diff) | |
download | scala-7a8dc411ac7c04dc17d9e37b045868f5ed9d2dd6.tar.gz scala-7a8dc411ac7c04dc17d9e37b045868f5ed9d2dd6.tar.bz2 scala-7a8dc411ac7c04dc17d9e37b045868f5ed9d2dd6.zip |
partially reenabled external links in generated...
partially reenabled external links in generated HTML doc
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/ModelToXML.scala | 17 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/script.js | 6 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/ModelToXML.scala b/src/compiler/scala/tools/nsc/doc/ModelToXML.scala index ea47cbab0f..6275552352 100644 --- a/src/compiler/scala/tools/nsc/doc/ModelToXML.scala +++ b/src/compiler/scala/tools/nsc/doc/ModelToXML.scala @@ -22,7 +22,7 @@ trait ModelToXML extends ModelExtractor { protected def anchor(sym: Symbol)(implicit frame: Frame): NodeSeq def aref(href: String, label: String)(implicit frame: Frame): NodeSeq - +/* def link(entity: Symbol)(implicit frame: Frame): NodeSeq = { val url = urlFor(entity) // nothing to do but be verbose. @@ -31,6 +31,21 @@ trait ModelToXML extends ModelExtractor { else aref(url, entity.nameString) } +*/ + def link(entity: Symbol)(implicit frame: Frame): NodeSeq = { + val url = urlFor(entity) + if (url == null) { // external link (handled by script.js) + val (href, attr) = + if (entity.isClass) + ("", entity.owner.fullNameString('/') + '/' + entity.nameString) + else + ("#" + entity.nameString, entity.owner.fullNameString('/')) + val name = entity.owner.fullNameString('.') + '.' + entity.nameString + <a href={Utility.escape(href)} class={attr} target="contentFrame">{name}</a>; + } + else + aref(url, entity.nameString) + } def link(tpe: Type)(implicit frame: Frame): NodeSeq = { if (!tpe.typeArgs.isEmpty) { diff --git a/src/compiler/scala/tools/nsc/doc/script.js b/src/compiler/scala/tools/nsc/doc/script.js index dc4e994470..5bd5f6f8e3 100644 --- a/src/compiler/scala/tools/nsc/doc/script.js +++ b/src/compiler/scala/tools/nsc/doc/script.js @@ -23,6 +23,8 @@ var eclipse_api_root = 'http://help.eclipse.org/help32/topic/org.eclipse.platfor var fjbg_api_root = 'http://lamp.epfl.ch/~linuxsoft/fjbg/api/'; +var liftweb_api_root = 'http://lamp.epfl.ch/~linuxsoft/liftweb/apidocs/'; + function get_api_root(key) { root = null; if (key.indexOf("ch/epfl/lamp/fjbg/") == 0) { root = fjbg_api_root; } @@ -30,6 +32,7 @@ function get_api_root(key) { else if (key.indexOf("scala/" ) == 0) { root = scala_api_root; } else if (key.indexOf("org/apache/tools/" ) == 0) { root = ant_api_root; } else if (key.indexOf("org/eclipse/" ) == 0) { root = eclipse_api_root; } + else if (key.indexOf("net/liftweb/" ) == 0) { root = liftweb_api_root; } return root; } @@ -39,12 +42,15 @@ var comp_src_root = scala_src_root + 'src/compiler/'; var actors_src_root = scala_src_root + 'src/actors/'; var dbc_src_root = scala_src_root + 'src/dbc/'; +//var liftweb_src_root = 'http://liftweb.googlecode.com/svn/trunk/liftweb/lift/src/main/scala/'; + function get_src_root(key) { root = null; if (key.indexOf("scala/actors/") == 0) { root = actors_src_root; } else if (key.indexOf("scala/dbc/" ) == 0) { root = dbc_src_root; } else if (key.indexOf("scala/tools/" ) == 0) { root = comp_src_root; } else if (key.indexOf("scala/" ) == 0) { root = lib_src_root; } + //else if (key.indexOf("net/liftweb/" ) == 0) { root = liftweb_src_root; } return root; } |