From 4e2024432ee680f98d91d07b050ac60151ebec4c Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 7 Apr 2019 15:49:26 +0200 Subject: Added prettifying and previews of html/markdown --- src/main/kotlin/App.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/kotlin/App.kt') 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) { -- cgit v1.2.3