Safe Haskell | None |
---|---|
Language | Haskell2010 |
Dictionary functions.
Synopsis
- clearMetadata :: Dictionary -> Dictionary
- clearMetadataDef :: Definition -> Definition
- clone :: FilePath -> FilePath -> Dictionary -> Dictionary
- copyPropsToMetadata :: Dictionary -> Dictionary
- copyPropsToMetadataDef :: Definition -> Definition
- exclude :: FilePath -> Dictionary -> Dictionary
- insertMetadata :: Metadata -> Dictionary -> Dictionary
- insertMetadataDef :: Metadata -> Definition -> Definition
- permalink :: String -> Dictionary -> Dictionary
- permalinkDef :: String -> Definition -> Definition
- prefixDirname :: String -> Dictionary -> Dictionary
- prefixDirnameDef :: String -> Definition -> Definition
- rename :: FilePath -> FilePath -> Dictionary -> Dictionary
- renameDef :: FilePath -> FilePath -> Definition -> Definition
- renameExt :: String -> String -> Dictionary -> Dictionary
- renameExtDef :: String -> String -> Definition -> Definition
- renderContent :: (Definition -> Maybe ByteString) -> Dictionary -> Dictionary
- renderContentDef :: (Definition -> Maybe ByteString) -> Definition -> Definition
- replaceMetadata :: Metadata -> Dictionary -> Dictionary
- replaceMetadataDef :: Metadata -> Definition -> Definition
- setContent :: ByteString -> Dictionary -> Dictionary
- setContentDef :: ByteString -> Definition -> Definition
- transformContent :: (Definition -> Maybe ByteString) -> Dictionary -> Dictionary
- transformContentDef :: (Definition -> Maybe ByteString) -> Definition -> Definition
Documentation
clearMetadata :: Dictionary -> Dictionary Source #
Clear metadata.
Replace the current hash map with an empty one.
clone :: FilePath -> FilePath -> Dictionary -> Dictionary Source #
copyPropsToMetadata :: Dictionary -> Dictionary Source #
Copy definition properties into the metadata.
See the toJSON
implementation for Definition
in Types
to see what properties get put in here.
exclude :: FilePath -> Dictionary -> Dictionary Source #
Exclude.
Filter out the definitions that have the given localPath
.
insertMetadata :: Metadata -> Dictionary -> Dictionary Source #
Insert metadata.
Merge the current hash map with another one.
insertMetadataDef :: Metadata -> Definition -> Definition Source #
permalink :: String -> Dictionary -> Dictionary Source #
Permalink.
Append the basename to the dirname, and change the basename to the given string. It will NOT change definitions that already have the new basename.
permalink "index" dictionary
permalinkDef :: String -> Definition -> Definition Source #
prefixDirname :: String -> Dictionary -> Dictionary Source #
Prefix dirname.
Prefix the dirname of each definition with a given string.
prefixDirnameDef :: String -> Definition -> Definition Source #
rename :: FilePath -> FilePath -> Dictionary -> Dictionary Source #
renameDef :: FilePath -> FilePath -> Definition -> Definition Source #
renameExt :: String -> String -> Dictionary -> Dictionary Source #
Rename extension.
Example:
renameExt ".markdown" ".html" dictionary -- The definitions that had the extname ".markdown" -- now have the extname ".html"
renameExtDef :: String -> String -> Definition -> Definition Source #
renderContent :: (Definition -> Maybe ByteString) -> Dictionary -> Dictionary Source #
Render content.
Replace the content property by providing a renderer. A renderer is a function with the signature `Definition -> Maybe ByteString`.
You can use this to render templates, markdown, etc.
renderContentDef :: (Definition -> Maybe ByteString) -> Definition -> Definition Source #
replaceMetadata :: Metadata -> Dictionary -> Dictionary Source #
Replace metadata.
Replace the current hash map with another one.
replaceMetadataDef :: Metadata -> Definition -> Definition Source #
setContent :: ByteString -> Dictionary -> Dictionary Source #
Set content.
Set content directly.
setContentDef :: ByteString -> Definition -> Definition Source #
transformContent :: (Definition -> Maybe ByteString) -> Dictionary -> Dictionary Source #
Transform content.
Alias for renderContent
.
transformContentDef :: (Definition -> Maybe ByteString) -> Definition -> Definition Source #