1-- | An identifier is a type used to uniquely identify a resource, target...
3-- One can think of an identifier as something similar to a file path. An
4-- identifier is a path as well, with the different elements in the path
5-- separated by @/@ characters. Examples of identifiers are:
7-- * @posts/foo.markdown@
13module Hakyll.Core.Identifier
19import Control.Arrow (second)
21import GHC.Exts (IsString, fromString)
22import System.FilePath (joinPath)
24-- | An identifier used to uniquely identify a value
26newtype Identifier = Identifier {unIdentifier :: [String]}
29instance Show Identifier where
32instance IsString Identifier where
33 fromString = parseIdentifier
35-- | Parse an identifier from a string
37parseIdentifier :: String -> Identifier
38parseIdentifier = Identifier . filter (not . null) . split'
41 split' str = let (pre, post) = second (drop 1) $ break (== '/') str
44-- | Convert an identifier to a relative 'FilePath'
46toFilePath :: Identifier -> FilePath
47toFilePath = joinPath . unIdentifier
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list