Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data types for working with the metadata of epub documents
This module defines the Metadata structure which contains most of the taxonomic information about the literary work. Metadata is probably the most important data structure in this library.
Both commonly-used versions of epub (2.x and 3.x) are supported by these types.
Synopsis
- data Creator = Creator {}
- data DateEvent
- newtype DateValue = DateValue String
- data Description = Description (Maybe String) String
- data Identifier = Identifier {}
- data Metadata = Metadata {
- metaIds :: [Identifier]
- metaTitles :: [Title]
- metaLangs :: [String]
- metaContributors :: [Creator]
- metaCreators :: [Creator]
- metaDates :: Map DateEvent DateValue
- metaSources :: [Source]
- metaType :: Maybe String
- metaCoverages :: [String]
- metaDescriptions :: [Description]
- metaFormats :: [String]
- metaPublishers :: [String]
- metaRelations :: [String]
- metaRights :: [String]
- metaSubjects :: [String]
- data Refinement = Refinement {}
- data Source = Source {}
- data Title = Title {}
- dateEventFromString :: Maybe String -> Maybe DateEvent
- dateEventToString :: DateEvent -> String
- emptyMetadata :: Metadata
- refineCreator :: [Refinement] -> (String, Creator) -> Creator
- refineIdentifier :: [Refinement] -> Identifier -> Identifier
- refineSource :: [Refinement] -> (String, Source) -> Source
- refineTitle :: [Refinement] -> (String, Title) -> Title
Documentation
package/metadata/dc:creator or package/metadata/dc:contributor tags
This structure is used for both contributor and creator as they are exactly the same.
Creator | |
|
EPUB 2.x: package/metadata/dc:date tag, opf:event attribute, text | EPUB 3.x: package/metadata/dc:date tag | package/metadata/meta property="dcterms:issued" | package/metadata/meta property="dcterms:modified" | package/metadata/meta property="dcterms:..."
data Description Source #
package/metadata/dc:description tag, xml:lang attribute, text
Instances
Show Description Source # | |
Defined in Codec.Epub.Data.Metadata showsPrec :: Int -> Description -> ShowS # show :: Description -> String # showList :: [Description] -> ShowS # | |
Eq Description Source # | |
Defined in Codec.Epub.Data.Metadata (==) :: Description -> Description -> Bool # (/=) :: Description -> Description -> Bool # |
data Identifier Source #
package/metadata/dc:identifier tag
Instances
Show Identifier Source # | |
Defined in Codec.Epub.Data.Metadata showsPrec :: Int -> Identifier -> ShowS # show :: Identifier -> String # showList :: [Identifier] -> ShowS # | |
Eq Identifier Source # | |
Defined in Codec.Epub.Data.Metadata (==) :: Identifier -> Identifier -> Bool # (/=) :: Identifier -> Identifier -> Bool # |
package/metadata tag
This is perhaps the most useful data structure in this library. It contains most of the information tools will want to use to organize epub documents.
Metadata | |
|
data Refinement Source #
Refinements represent meta tags within the metadata section that refine other tags. These are used during the parsing phase and are discarded as their information is slotted into the data they refine (CreatorS, TitleS, IdentifierS, etc..)
This is specific to epub3
Instances
Show Refinement Source # | |
Defined in Codec.Epub.Data.Metadata showsPrec :: Int -> Refinement -> ShowS # show :: Refinement -> String # showList :: [Refinement] -> ShowS # |
package/metadata/dc:source tags
Source | |
|
package/metadata/dc:title tag
dateEventToString :: DateEvent -> String Source #
emptyMetadata :: Metadata Source #
Note: This isn't valid as-is, some required values are empty lists!
refineCreator :: [Refinement] -> (String, Creator) -> Creator Source #
Used internally by Codec.Epub.Parse.Metadata to merge epub3 meta tag info into the data gathered from contributor and creator tags
refineIdentifier :: [Refinement] -> Identifier -> Identifier Source #
Used internally by Codec.Epub.Parse.Metadata to merge epub3 meta tag info into the data gathered from an identifier tag
refineSource :: [Refinement] -> (String, Source) -> Source Source #
Used internally by Codec.Epub.Parse.Metadata to merge epub3 meta tag info into the data gathered from contributor and creator tags
refineTitle :: [Refinement] -> (String, Title) -> Title Source #
Used internally by Codec.Epub.Parse.Metadata to merge epub3 meta tag info into the data gathered from a title tag