Skip to content

Commit

Permalink
HF 0.1.1: Fix css/js still imported from cdnjs, now coming from local…
Browse files Browse the repository at this point in the history
… resources.
  • Loading branch information
Gregory Lureau committed Mar 15, 2022
1 parent fa239e3 commit 2ad5cff
Show file tree
Hide file tree
Showing 5 changed files with 59,088 additions and 284 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import java.net.URI

plugins {
kotlin("jvm") version "1.5.0"
id("org.jetbrains.dokka") version "1.5.0" // Used to create a javadoc jar
id("org.jetbrains.dokka") version "1.6.0" // Used to create a javadoc jar
`maven-publish`
signing
}

group = "com.glureau"
version = "0.1.0"
version = "0.1.1"

repositories {
mavenCentral()
Expand All @@ -21,7 +21,7 @@ dependencies {
implementation(kotlin("stdlib"))
compileOnly("org.jetbrains.dokka:dokka-core:$dokkaVersion")
implementation("org.jetbrains.dokka:dokka-base:$dokkaVersion")
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2")
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.3")

testImplementation(kotlin("test-junit"))
testImplementation("org.jetbrains.dokka:dokka-test-api:$dokkaVersion")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dokkaVersion=1.5.0
dokkaVersion=1.6.0
11 changes: 0 additions & 11 deletions src/main/kotlin/com/glureau/MermaidHtmlRenderer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,7 @@ open class MermaidHtmlRenderer(
"graph LR",
).map { Regex(it) }

override fun buildHtml(page: PageNode, resources: List<String>, content: FlowContent.() -> Unit): String {
// TODO: Define a "Style"/script installer like here https://github.com/Kotlin/dokka/blob/c1efae49d5595c79ccbf004ceb6aabd7367ed9de/plugins/versioning/src/main/kotlin/versioning/htmlPreprocessors.kt
val addedRes: List<String> = listOf(
*resources.toTypedArray(),
"https://cdnjs.cloudflare.com/ajax/libs/mermaid/6.0.0/mermaid.css",
"https://cdnjs.cloudflare.com/ajax/libs/mermaid/6.0.0/mermaid.js"
)
return super.buildHtml(page, addedRes, content)
}

override fun FlowContent.buildCodeBlock(code: ContentCodeBlock, pageContext: ContentPage) {
// TODO: Understand why language is not filled with "mermaid" in the unit test
var isMermaidGraph = code.language == "mermaid"
if (!isMermaidGraph && code.language == "") { // Trying to guess if it's actually a Mermaid graph
val firstLine = (code.children.firstOrNull() as? ContentText)?.text?.trim()
Expand Down
Loading

0 comments on commit 2ad5cff

Please sign in to comment.