fixed function links and use correct package format

This commit is contained in:
James Strachan
2012-03-01 15:51:34 +00:00
parent fb0e1a04be
commit 374e734168
3 changed files with 8 additions and 7 deletions
@@ -54,12 +54,13 @@ abstract class KDocTemplate() : TextTemplate() {
}
open fun sourceHref(f: KFunction): String {
return if (f.owner is KClass) {
"${rootHref(f.owner.pkg)}src-html/${f.owner.simpleName}.html#line.${f.sourceLine}"
} else {
val owner = f.owner
return if (owner is KClass) {
"${rootHref(owner.pkg)}src-html/${owner.simpleName}.html#line.${f.sourceLine}"
} else if (owner is KPackage) {
// TODO how to find the function in a package???
""
}
"${rootHref(owner)}src-html/namespace.html#line.${f.sourceLine}"
} else href(f)
}
open fun link(c: KClass, fullName: Boolean = false): String {
@@ -104,7 +104,7 @@ ${model.title}
</TR>""")
for (p in model.packages) {
println("""<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="20%"><B><A HREF="${p.nameAsPath}/package-summary.html">${p.nameAsPath}</A></B></TD>
<TD WIDTH="20%"><B><A HREF="${p.nameAsPath}/package-summary.html">${p.name}</A></B></TD>
<TD>${p.description}</TD>
</TR>""")
}
@@ -91,7 +91,7 @@ abstract class PackageTemplateSupport(open val pkg: KPackage) : KDocTemplate() {
}
fun printFunctionDetail(function: KFunction): Unit {
println("""<A NAME="${function.name}{${function.parameterTypeText}})"><!-- --></A><A NAME="${function.name}(${function.typeParametersText})"><!-- --></A><H3>""")
println("""<A NAME="${function.name}{${function.parameterTypeText}}"><!-- --></A><A NAME="${function.link}"><!-- --></A><H3>""")
println("""${function.name}</H3>""")
println("""<PRE>""")
println("""<FONT SIZE="-1">""")