From ee5c85c76ac9e08a71ae09b42d11f60bd04aefca Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 4 Jul 2021 17:27:55 +0200 Subject: compiler: register distinct markdown item type --- compiler/src/ItemProcessors.hs | 6 ++++-- compiler/src/Resource.hs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/src') diff --git a/compiler/src/ItemProcessors.hs b/compiler/src/ItemProcessors.hs index 476b7d7..fa99316 100644 --- a/compiler/src/ItemProcessors.hs +++ b/compiler/src/ItemProcessors.hs @@ -1,7 +1,7 @@ -- ldgallery - A static generator which turns a collection of tagged -- pictures into a searchable web gallery. -- --- Copyright (C) 2019-2020 Pacien TRAN-GIRARD +-- Copyright (C) 2019-2021 Pacien TRAN-GIRARD -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as @@ -36,6 +36,7 @@ import Files data Format = PictureFormat | PlainTextFormat + | MarkdownFormat | PortableDocumentFormat | VideoFormat | AudioFormat @@ -56,7 +57,7 @@ formatFromPath = ".gif" -> PictureFormat ".webp" -> PictureFormat ".txt" -> PlainTextFormat - ".md" -> PlainTextFormat -- TODO: handle markdown separately + ".md" -> MarkdownFormat ".pdf" -> PortableDocumentFormat ".wav" -> AudioFormat ".oga" -> AudioFormat @@ -100,6 +101,7 @@ itemFileProcessor maxResolution = processorFor PictureFormat Nothing = transformThenDescribe copyFileProcessor getPictureProps processorFor PlainTextFormat _ = copyResource PlainText + processorFor MarkdownFormat _ = copyResource Markdown processorFor PortableDocumentFormat _ = copyResource PDF processorFor VideoFormat _ = copyResource Video processorFor AudioFormat _ = copyResource Audio diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs index f59eed6..804c9a1 100644 --- a/compiler/src/Resource.hs +++ b/compiler/src/Resource.hs @@ -1,7 +1,7 @@ -- ldgallery - A static generator which turns a collection of tagged -- pictures into a searchable web gallery. -- --- Copyright (C) 2019-2020 Pacien TRAN-GIRARD +-- Copyright (C) 2019-2021 Pacien TRAN-GIRARD -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as @@ -90,6 +90,7 @@ data GalleryItemProps = { resource :: Resource , resolution :: Resolution } | PlainText { resource :: Resource } + | Markdown { resource :: Resource } | PDF { resource :: Resource } | Video { resource :: Resource } | Audio { resource :: Resource } -- cgit v1.2.3