aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/App.kt
diff options
context:
space:
mode:
authorMarvin Borner2019-04-07 15:49:26 +0200
committerMarvin Borner2019-04-07 15:49:26 +0200
commit4e2024432ee680f98d91d07b050ac60151ebec4c (patch)
tree8f388c3349d9081625846d00770e5b44ef38bf3c /src/main/kotlin/App.kt
parent92807cfb7249eff1d96b70aa33a46c9eb6c0e733 (diff)
Added prettifying and previews of html/markdown
Diffstat (limited to 'src/main/kotlin/App.kt')
-rw-r--r--src/main/kotlin/App.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/kotlin/App.kt b/src/main/kotlin/App.kt
index 44f60bb..d79e25e 100644
--- a/src/main/kotlin/App.kt
+++ b/src/main/kotlin/App.kt
@@ -80,14 +80,14 @@ fun crawlFiles(ctx: Context) {
ctx.render("files.rocker.html", model("files", files))
}
} else
- // TODO: Fix square brackets at fileview content
ctx.render(
"fileview.rocker.html", model(
"content", Files.readAllLines(
Paths.get("$fileHome/${ctx.splats()[0]}"),
Charsets.UTF_8
- ).toString(),
- "filename", File("$fileHome/${ctx.splats()[0]}").name
+ ).joinToString(separator = "\n"),
+ "filename", File("$fileHome/${ctx.splats()[0]}").name,
+ "extension", File("$fileHome/${ctx.splats()[0]}").extension
)
)
} catch (_: java.nio.file.NoSuchFileException) {