Skip to content
Permalink
Browse files

[Doctools] Fix //rotate description quoting

  • Loading branch information...
kenzierocks committed Aug 26, 2019
1 parent 0620478 commit 7af397bd56291b579f2c29d8cbde84ec001e6058
@@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.3.41"
application
}

applyCommonConfiguration()
@@ -10,6 +11,11 @@ tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}

application.mainClassName = "com.sk89q.worldedit.internal.util.DocumentationPrinter"
tasks.named<JavaExec>("run") {
workingDir = rootProject.projectDir
}

dependencies {
"implementation"(project(":worldedit-libs:core:ap"))
"implementation"(project(":worldedit-core"))
@@ -60,7 +60,9 @@ class DocumentationPrinter private constructor() {

private suspend inline fun <reified T> SequenceScope<String>.yieldAllCommandsIn() {
val sourceFile = Paths.get("worldedit-core/src/main/java/" + T::class.qualifiedName!!.replace('.', '/') + ".java")
require(Files.exists(sourceFile)) { "Source not found for ${T::class.qualifiedName}"}
require(Files.exists(sourceFile)) {
"Source not found for ${T::class.qualifiedName}, looked at ${sourceFile.toAbsolutePath()}"
}
Files.newBufferedReader(sourceFile).useLines { lines ->
var inCommand = false
for (line in lines) {
@@ -267,7 +269,7 @@ Other Permissions
""".trimMargin())
cmdOutput.appendln()
for ((k, v) in entries) {
val rstSafe = v.replace("\"", "\\\"").replace("\n", "\n" + " ".repeat(2))
val rstSafe = v.trim().replace("\"", "\\\"").replace("\n", "\n" + " ".repeat(2))
.lineSequence().map { line -> line.ifBlank { "" } }.joinToString(separator = "\n")
cmdOutput.append(" ".repeat(2))
.append(k)

0 comments on commit 7af397b

Please sign in to comment.
You can’t perform that action at this time.