aboutsummaryrefslogtreecommitdiff
path: root/src/Java/JavaDocumentationBuilder.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-16 12:00:07 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-16 12:05:17 +0100
commitc11ae71c3fdad03f1ba0624ca693b34782f1e6e9 (patch)
tree0e1e8bf34e45fe2c332f05c766f4b15a194a2c87 /src/Java/JavaDocumentationBuilder.kt
parent902aeb158001473aa2d8d011c1e8e584163c5edd (diff)
downloaddokka-c11ae71c3fdad03f1ba0624ca693b34782f1e6e9.tar.gz
dokka-c11ae71c3fdad03f1ba0624ca693b34782f1e6e9.tar.bz2
dokka-c11ae71c3fdad03f1ba0624ca693b34782f1e6e9.zip
convert doc tags to sections
Diffstat (limited to 'src/Java/JavaDocumentationBuilder.kt')
-rw-r--r--src/Java/JavaDocumentationBuilder.kt18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt
index 0737e504..660ffafb 100644
--- a/src/Java/JavaDocumentationBuilder.kt
+++ b/src/Java/JavaDocumentationBuilder.kt
@@ -15,6 +15,8 @@ import com.intellij.psi.PsiModifierListOwner
import com.intellij.psi.PsiModifier
import com.intellij.psi.PsiArrayType
import com.intellij.psi.PsiTypeParameter
+import com.intellij.psi.javadoc.PsiDocTag
+import com.intellij.psi.javadoc.PsiDocTagValue
public class JavaDocumentationBuilder() {
fun appendFile(file: PsiJavaFile, module: DocumentationModule) {
@@ -29,9 +31,25 @@ public class JavaDocumentationBuilder() {
val text = if (result.isEmpty()) it.getText().trimLeading() else it.getText()
result.append(ContentText(text))
}
+ docComment.getTags().forEach {
+ val subjectName = it.getSubjectName()
+ val section = result.addSection(javadocSectionDisplayName(it.getName()), subjectName)
+ it.getDataElements().forEach {
+ if (it !is PsiDocTagValue) {
+ section.append(ContentText(it.getText()))
+ }
+ }
+ }
return result
}
+ fun PsiDocTag.getSubjectName(): String? {
+ if (getName() == "param") {
+ return getValueElement()?.getText()
+ }
+ return null
+ }
+
fun DocumentationNode(element: PsiNamedElement,
kind: Kind,
name: String = element.getName() ?: "<anonymous>"): DocumentationNode {