include a target and css style for external source links in the doc
This commit is contained in:
@@ -761,6 +761,10 @@ abstract class KAnnotated(val model: KModel, val declarationDescriptor: Declarat
|
||||
return model.config.sourceRootHref != null
|
||||
}
|
||||
|
||||
fun sourceTargetAttribute(): String {
|
||||
return if (isLinkToSourceRepo()) " target=\"_top\" class=\"repoSourceCode\"" else ""
|
||||
}
|
||||
|
||||
fun sourceLink(): String {
|
||||
val file = model.filePath(declarationDescriptor)
|
||||
if (file != null) {
|
||||
|
||||
Vendored
+1
-1
@@ -29,7 +29,7 @@ ${pkg.name}</FONT>
|
||||
Extensions on ${klass.name}</H2>
|
||||
<DL>
|
||||
<DT>
|
||||
extension functions on class <A HREF="${sourceHref(klass)}"><B>${klass.name}</B></A><DT>
|
||||
extension functions on class <A HREF="${sourceHref(klass)}"${klass.sourceTargetAttribute()}><B>${klass.name}</B></A><DT>
|
||||
from package ${link(pkg)}
|
||||
</DL>
|
||||
</PRE>
|
||||
|
||||
+1
-1
@@ -184,7 +184,7 @@ Class ${klass.simpleName}</H2>
|
||||
<DL>
|
||||
<DT><PRE><FONT SIZE="-1">""")
|
||||
printAnnotations(klass.annotations)
|
||||
print("""</FONT>${klass.visibility} ${klass.kindCode} <A HREF="${sourceHref(klass)}"><B>${klass.simpleName}</B></A><DT>""")
|
||||
print("""</FONT>${klass.visibility} ${klass.kindCode} <A HREF="${sourceHref(klass)}"${klass.sourceTargetAttribute()}><B>${klass.simpleName}</B></A><DT>""")
|
||||
if (!klass.baseClasses.isEmpty()) {
|
||||
print("""extends """)
|
||||
for (bc in klass.baseClasses) {
|
||||
|
||||
Vendored
+2
-2
@@ -128,7 +128,7 @@ abstract class PackageTemplateSupport(open val pkg: KPackage) : KDocTemplate() {
|
||||
|
||||
printTypeParameters(function, " ")
|
||||
printReceiverType(function, " ", ".", " ")
|
||||
print("""<A HREF="${sourceHref(function)}"><B>${function.name}</B></A>""")
|
||||
print("""<A HREF="${sourceHref(function)}"${function.sourceTargetAttribute()}><B>${function.name}</B></A>""")
|
||||
printParameters(function)
|
||||
print(": ")
|
||||
print(link(function.returnType))
|
||||
@@ -207,7 +207,7 @@ abstract class PackageTemplateSupport(open val pkg: KPackage) : KDocTemplate() {
|
||||
}
|
||||
*/
|
||||
println("""</CODE></FONT></TD>""")
|
||||
print("""<TD><CODE><B><A HREF="${sourceHref(property)}">${property.name}</A></B>: """)
|
||||
print("""<TD><CODE><B><A HREF="${sourceHref(property)}"${property.sourceTargetAttribute()}>${property.name}</A></B>: """)
|
||||
print(link(property.returnType))
|
||||
//printParameters(property)
|
||||
println("""</CODE>""")
|
||||
|
||||
Reference in New Issue
Block a user