Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Template name handling.
Synopsis
- data TemplateName
- data RepoTemplatePath = RepoTemplatePath {
- rtpService :: RepoService
- rtpUser :: Text
- rtpTemplate :: Text
- data RepoService
- data TemplatePath
- templateName :: TemplateName -> Text
- templatePath :: TemplateName -> TemplatePath
- parseTemplateNameFromString :: String -> Either String TemplateName
- parseRepoPathWithService :: RepoService -> Text -> Maybe RepoTemplatePath
- templateNameArgument :: Mod ArgumentFields TemplateName -> Parser TemplateName
- templateParamArgument :: Mod OptionFields (Text, Text) -> Parser (Text, Text)
- defaultTemplateName :: TemplateName
Documentation
data TemplateName Source #
A template name.
Instances
FromJSON TemplateName Source # | |
Defined in Stack.Types.TemplateName parseJSON :: Value -> Parser TemplateName # parseJSONList :: Value -> Parser [TemplateName] # | |
Show TemplateName Source # | |
Defined in Stack.Types.TemplateName showsPrec :: Int -> TemplateName -> ShowS # show :: TemplateName -> String # showList :: [TemplateName] -> ShowS # | |
Eq TemplateName Source # | |
Defined in Stack.Types.TemplateName (==) :: TemplateName -> TemplateName -> Bool # (/=) :: TemplateName -> TemplateName -> Bool # | |
Ord TemplateName Source # | |
Defined in Stack.Types.TemplateName compare :: TemplateName -> TemplateName -> Ordering # (<) :: TemplateName -> TemplateName -> Bool # (<=) :: TemplateName -> TemplateName -> Bool # (>) :: TemplateName -> TemplateName -> Bool # (>=) :: TemplateName -> TemplateName -> Bool # max :: TemplateName -> TemplateName -> TemplateName # min :: TemplateName -> TemplateName -> TemplateName # |
data RepoTemplatePath Source #
Details for how to access a template from a remote repo.
Instances
Show RepoTemplatePath Source # | |
Defined in Stack.Types.TemplateName showsPrec :: Int -> RepoTemplatePath -> ShowS # show :: RepoTemplatePath -> String # showList :: [RepoTemplatePath] -> ShowS # | |
Eq RepoTemplatePath Source # | |
Defined in Stack.Types.TemplateName (==) :: RepoTemplatePath -> RepoTemplatePath -> Bool # (/=) :: RepoTemplatePath -> RepoTemplatePath -> Bool # | |
Ord RepoTemplatePath Source # | |
Defined in Stack.Types.TemplateName compare :: RepoTemplatePath -> RepoTemplatePath -> Ordering # (<) :: RepoTemplatePath -> RepoTemplatePath -> Bool # (<=) :: RepoTemplatePath -> RepoTemplatePath -> Bool # (>) :: RepoTemplatePath -> RepoTemplatePath -> Bool # (>=) :: RepoTemplatePath -> RepoTemplatePath -> Bool # max :: RepoTemplatePath -> RepoTemplatePath -> RepoTemplatePath # min :: RepoTemplatePath -> RepoTemplatePath -> RepoTemplatePath # |
data RepoService Source #
Services from which templates can be retrieved from a repository.
Instances
Show RepoService Source # | |
Defined in Stack.Types.TemplateName showsPrec :: Int -> RepoService -> ShowS # show :: RepoService -> String # showList :: [RepoService] -> ShowS # | |
Eq RepoService Source # | |
Defined in Stack.Types.TemplateName (==) :: RepoService -> RepoService -> Bool # (/=) :: RepoService -> RepoService -> Bool # | |
Ord RepoService Source # | |
Defined in Stack.Types.TemplateName compare :: RepoService -> RepoService -> Ordering # (<) :: RepoService -> RepoService -> Bool # (<=) :: RepoService -> RepoService -> Bool # (>) :: RepoService -> RepoService -> Bool # (>=) :: RepoService -> RepoService -> Bool # max :: RepoService -> RepoService -> RepoService # min :: RepoService -> RepoService -> RepoService # |
data TemplatePath Source #
AbsPath (Path Abs File) | an absolute path on the filesystem |
RelPath String (Path Rel File) | a relative path on the filesystem, or relative to the template
repository. To avoid path separator conversion on Windows, the raw
command-line parameter passed is also given as the first field (possibly
with |
UrlPath String | a full URL |
RepoPath RepoTemplatePath |
Instances
Show TemplatePath Source # | |
Defined in Stack.Types.TemplateName showsPrec :: Int -> TemplatePath -> ShowS # show :: TemplatePath -> String # showList :: [TemplatePath] -> ShowS # | |
Eq TemplatePath Source # | |
Defined in Stack.Types.TemplateName (==) :: TemplatePath -> TemplatePath -> Bool # (/=) :: TemplatePath -> TemplatePath -> Bool # | |
Ord TemplatePath Source # | |
Defined in Stack.Types.TemplateName compare :: TemplatePath -> TemplatePath -> Ordering # (<) :: TemplatePath -> TemplatePath -> Bool # (<=) :: TemplatePath -> TemplatePath -> Bool # (>) :: TemplatePath -> TemplatePath -> Bool # (>=) :: TemplatePath -> TemplatePath -> Bool # max :: TemplatePath -> TemplatePath -> TemplatePath # min :: TemplatePath -> TemplatePath -> TemplatePath # |
templateName :: TemplateName -> Text Source #
Get a text representation of the template name.
templatePath :: TemplateName -> TemplatePath Source #
Get the path of the template.
parseTemplateNameFromString :: String -> Either String TemplateName Source #
Parse a template name from a string.
parseRepoPathWithService :: RepoService -> Text -> Maybe RepoTemplatePath Source #
Parses a template path of the form user/template
, given a service
templateNameArgument :: Mod ArgumentFields TemplateName -> Parser TemplateName Source #
An argument which accepts a template name of the format foo.hsfiles
or
foo
, ultimately normalized to foo
.
templateParamArgument :: Mod OptionFields (Text, Text) -> Parser (Text, Text) Source #
An argument which accepts a key:value
pair for specifying parameters.
defaultTemplateName :: TemplateName Source #
The default template name you can use if you don't have one.