diff options
author | Błażej Kardyś <bkardys@virtuslab.com> | 2020-05-27 01:16:48 +0200 |
---|---|---|
committer | Błażej Kardyś <bkardys@virtuslab.com> | 2020-06-04 11:26:05 +0200 |
commit | 6dc9498ca849645ecb4ec923bb7116b245dca706 (patch) | |
tree | 23022e6d6f3aea18b9e8efaaa482cafae9bee989 /core/src/main/kotlin/parsers/MarkdownParser.kt | |
parent | b614604effda51ca7c76c8901be78ced62b642b2 (diff) | |
download | dokka-6dc9498ca849645ecb4ec923bb7116b245dca706.tar.gz dokka-6dc9498ca849645ecb4ec923bb7116b245dca706.tar.bz2 dokka-6dc9498ca849645ecb4ec923bb7116b245dca706.zip |
All modules page generation
Diffstat (limited to 'core/src/main/kotlin/parsers/MarkdownParser.kt')
-rw-r--r-- | core/src/main/kotlin/parsers/MarkdownParser.kt | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/core/src/main/kotlin/parsers/MarkdownParser.kt b/core/src/main/kotlin/parsers/MarkdownParser.kt index 145e085c..308a8fb6 100644 --- a/core/src/main/kotlin/parsers/MarkdownParser.kt +++ b/core/src/main/kotlin/parsers/MarkdownParser.kt @@ -25,8 +25,8 @@ import java.net.MalformedURLException import org.intellij.markdown.parser.MarkdownParser as IntellijMarkdownParser class MarkdownParser( - private val resolutionFacade: DokkaResolutionFacade, - private val declarationDescriptor: DeclarationDescriptor, + private val resolutionFacade: DokkaResolutionFacade? = null, + private val declarationDescriptor: DeclarationDescriptor? = null, private val logger: DokkaLogger ) : Parser() { @@ -110,13 +110,15 @@ class MarkdownParser( null } catch (e: MalformedURLException) { try { - resolveKDocLink( - resolutionFacade.resolveSession.bindingContext, - resolutionFacade, - declarationDescriptor, - null, - link.split('.') - ).minBy { it is ClassDescriptor }?.let { DRI.from(it) } + if (resolutionFacade != null && declarationDescriptor != null) { + resolveKDocLink( + resolutionFacade.resolveSession.bindingContext, + resolutionFacade, + declarationDescriptor, + null, + link.split('.') + ).minBy { it is ClassDescriptor }?.let { DRI.from(it) } + } else null } catch (e1: IllegalArgumentException) { null } @@ -394,7 +396,7 @@ class MarkdownParser( parseStringToDocNode("[${it.getSubjectName()}]") .let { val link = it.children[0] - if(link is DocumentationLink) link.dri + if (link is DocumentationLink) link.dri else null } ) |