| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Stack.Types.TemplateName
Description
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
| Eq TemplateName Source # | |
Defined in Stack.Types.TemplateName | |
| Ord TemplateName Source # | |
Defined in Stack.Types.TemplateName Methods compare :: TemplateName -> TemplateName -> Ordering # (<) :: TemplateName -> TemplateName -> Bool # (<=) :: TemplateName -> TemplateName -> Bool # (>) :: TemplateName -> TemplateName -> Bool # (>=) :: TemplateName -> TemplateName -> Bool # max :: TemplateName -> TemplateName -> TemplateName # min :: TemplateName -> TemplateName -> TemplateName # | |
| Show TemplateName Source # | |
Defined in Stack.Types.TemplateName Methods showsPrec :: Int -> TemplateName -> ShowS # show :: TemplateName -> String # showList :: [TemplateName] -> ShowS # | |
| FromJSON TemplateName Source # | |
Defined in Stack.Types.TemplateName | |
data RepoTemplatePath Source #
Details for how to access a template from a remote repo.
Constructors
| RepoTemplatePath | |
Fields
| |
Instances
| Eq RepoTemplatePath Source # | |
Defined in Stack.Types.TemplateName Methods (==) :: RepoTemplatePath -> RepoTemplatePath -> Bool # (/=) :: RepoTemplatePath -> RepoTemplatePath -> Bool # | |
| Ord RepoTemplatePath Source # | |
Defined in Stack.Types.TemplateName Methods compare :: RepoTemplatePath -> RepoTemplatePath -> Ordering # (<) :: RepoTemplatePath -> RepoTemplatePath -> Bool # (<=) :: RepoTemplatePath -> RepoTemplatePath -> Bool # (>) :: RepoTemplatePath -> RepoTemplatePath -> Bool # (>=) :: RepoTemplatePath -> RepoTemplatePath -> Bool # max :: RepoTemplatePath -> RepoTemplatePath -> RepoTemplatePath # min :: RepoTemplatePath -> RepoTemplatePath -> RepoTemplatePath # | |
| Show RepoTemplatePath Source # | |
Defined in Stack.Types.TemplateName Methods showsPrec :: Int -> RepoTemplatePath -> ShowS # show :: RepoTemplatePath -> String # showList :: [RepoTemplatePath] -> ShowS # | |
data RepoService Source #
Services from which templates can be retrieved from a repository.
Instances
| Eq RepoService Source # | |
Defined in Stack.Types.TemplateName | |
| Ord RepoService Source # | |
Defined in Stack.Types.TemplateName Methods compare :: RepoService -> RepoService -> Ordering # (<) :: RepoService -> RepoService -> Bool # (<=) :: RepoService -> RepoService -> Bool # (>) :: RepoService -> RepoService -> Bool # (>=) :: RepoService -> RepoService -> Bool # max :: RepoService -> RepoService -> RepoService # min :: RepoService -> RepoService -> RepoService # | |
| Show RepoService Source # | |
Defined in Stack.Types.TemplateName Methods showsPrec :: Int -> RepoService -> ShowS # show :: RepoService -> String # showList :: [RepoService] -> ShowS # | |
data TemplatePath Source #
Constructors
| 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
| Eq TemplatePath Source # | |
Defined in Stack.Types.TemplateName | |
| Ord TemplatePath Source # | |
Defined in Stack.Types.TemplateName Methods compare :: TemplatePath -> TemplatePath -> Ordering # (<) :: TemplatePath -> TemplatePath -> Bool # (<=) :: TemplatePath -> TemplatePath -> Bool # (>) :: TemplatePath -> TemplatePath -> Bool # (>=) :: TemplatePath -> TemplatePath -> Bool # max :: TemplatePath -> TemplatePath -> TemplatePath # min :: TemplatePath -> TemplatePath -> TemplatePath # | |
| Show TemplatePath Source # | |
Defined in Stack.Types.TemplateName Methods showsPrec :: Int -> TemplatePath -> ShowS # show :: TemplatePath -> String # showList :: [TemplatePath] -> ShowS # | |
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.