{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}

{-|
Module      : Headroom.Meta
Description : Application metadata (name, vendor, etc.)
Copyright   : (c) 2019-2020 Vaclav Svejcar
License     : BSD-3-Clause
Maintainer  : vaclav.svejcar@gmail.com
Stability   : experimental
Portability : POSIX

Module providing application metadata, such as application name, vendor,
version, etc.
-}

module Headroom.Meta
  ( TemplateType
  , buildVersion
  , productDesc
  , productInfo
  , productName
  , website
  )
where

import           Data.Version                   ( showVersion )
import           Headroom.Template.Mustache     ( Mustache )
import           Paths_headroom                 ( version )
import           RIO
import qualified RIO.Text                      as T



-- | Type of the template format used for license headers.
type TemplateType = Mustache


-- | Application version, as specified in @headroom.cabal@ file.
buildVersion :: Text
buildVersion :: Text
buildVersion = String -> Text
T.pack (String -> Text) -> (Version -> String) -> Version -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Version -> String
showVersion (Version -> Text) -> Version -> Text
forall a b. (a -> b) -> a -> b
$ Version
version


-- | Full product description.
productDesc :: Text
productDesc :: Text
productDesc = "manage your source code license headers"


-- | Product info.
productInfo :: Text
productInfo :: Text
productInfo = [Text] -> Text
forall a. Monoid a => [a] -> a
mconcat [Text
productName, ", v", Text
buildVersion, " :: ", Text
website]


-- | Product name.
productName :: Text
productName :: Text
productName = "headroom"


-- | Homepage website of the product.
website :: Text
website :: Text
website = "https://github.com/vaclavsvejcar/headroom"