link-relations 0.1.0.0 → 0.1.1.0
raw patch · 5 files changed
+63/−6 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Web.LinkRelations: relBlockedBy :: LinkRelation
+ Web.LinkRelations: relPreload :: LinkRelation
Files
- NEWS.md +24/−0
- link-relations.cabal +1/−1
- src/Web/LinkRelations.hs +27/−1
- util/generate.hs +8/−4
- util/link-relations-1.csv +3/−0
NEWS.md view
@@ -3,6 +3,30 @@ +link-relations 0.1.1.0 -- 2016-01-28+====================================++General, build and documentation changes:++* (None)++New APIs, features and enhancements:++* Update to new registry revision, which adds the `blocked-by` and `preload`+ relation types++Bug fixes:++* (None)++Dependency changes:++* (None)+++++ link-relations 0.1.0.0 -- 2015-12-15 ====================================
link-relations.cabal view
@@ -1,5 +1,5 @@ name: link-relations-version: 0.1.0.0+version: 0.1.1.0 synopsis: Use web link relation types (RFC 5988) in Haskell description: This library provides access to the IANA registry of link relation types, for
src/Web/LinkRelations.hs view
@@ -32,7 +32,7 @@ -- 'LinkRelation' datatype. -- -- This version of the package corresponds to the--- /2015-01-21/+-- /2016-01-22/ -- version of the registry. module Web.LinkRelations ( -- * Types and Conversions@@ -50,6 +50,7 @@ , relAppendix , relArchives , relAuthor+ , relBlockedBy , relBookmark , relCanonical , relChapter@@ -90,6 +91,7 @@ , relPayment , relPredecessorVersion , relPrefetch+ , relPreload , relPrev , relPreview , relPrevious@@ -133,6 +135,7 @@ | RelAppendix | RelArchives | RelAuthor+ | RelBlockedBy | RelBookmark | RelCanonical | RelChapter@@ -173,6 +176,7 @@ | RelPayment | RelPredecessorVersion | RelPrefetch+ | RelPreload | RelPrev | RelPreview | RelPrevious@@ -210,6 +214,7 @@ , ("appendix", RelAppendix) , ("archives", RelArchives) , ("author", RelAuthor)+ , ("blocked-by", RelBlockedBy) , ("bookmark", RelBookmark) , ("canonical", RelCanonical) , ("chapter", RelChapter)@@ -250,6 +255,7 @@ , ("payment", RelPayment) , ("predecessor-version", RelPredecessorVersion) , ("prefetch", RelPrefetch)+ , ("preload", RelPreload) , ("prev", RelPrev) , ("preview", RelPreview) , ("previous", RelPrevious)@@ -310,6 +316,7 @@ RelAppendix -> "appendix" RelArchives -> "archives" RelAuthor -> "author"+ RelBlockedBy -> "blocked-by" RelBookmark -> "bookmark" RelCanonical -> "canonical" RelChapter -> "chapter"@@ -350,6 +357,7 @@ RelPayment -> "payment" RelPredecessorVersion -> "predecessor-version" RelPrefetch -> "prefetch"+ RelPreload -> "preload" RelPrev -> "prev" RelPreview -> "preview" RelPrevious -> "previous"@@ -420,6 +428,14 @@ relAuthor :: LinkRelation relAuthor = RelAuthor +-- | Identifies the entity blocking access to a resource folllowing on receipt+-- of a legal demand.+--+-- Reference:+-- <https://www.iana.org/go/draft-ietf-httpbis-legally-restricted-status-04 RFC -ietf-httpbis-legally-restricted-status-04>+relBlockedBy :: LinkRelation+relBlockedBy = RelBlockedBy+ -- | Gives a permanent link to use for bookmarking purposes. -- -- Reference: <http://www.w3.org/TR/html5/links.html#link-type-bookmark>@@ -733,6 +749,16 @@ -- Reference: <http://www.w3.org/TR/html5/links.html#link-type-prefetch> relPrefetch :: LinkRelation relPrefetch = RelPrefetch++-- | Refers to a resource that should be loaded early in the processing of the+-- link\'s context, without blocking rendering.+--+-- Reference: <http://www.w3.org/TR/preload/>+--+-- Note: Additional target attributes establish the detailed fetch properties+-- of the link.+relPreload :: LinkRelation+relPreload = RelPreload -- | Indicates that the link\'s context is a part of a series, and that the -- previous in the series is the link target.
util/generate.hs view
@@ -19,7 +19,7 @@ import Control.Applicative import Control.Monad (guard, liftM)-import Data.Char (toUpper)+import Data.Char (isDigit, toUpper) import Data.Csv import Data.Foldable (mapM_) import Data.Int (Int64)@@ -50,7 +50,7 @@ -- | Y-M-D date specifying the time of the last update to the IANA registry. lastUpdated :: BL.ByteString-lastUpdated = "2015-01-21"+lastUpdated = "2016-01-22" ------------------------------------------------------------------------------- -- Types@@ -167,8 +167,12 @@ in case stripLinkSuffix w of Just (t, r) | rfcPrefix `BL.isPrefixOf` t -> Just $- let num = BL.drop rfcDrop t- in iana <> "rfc" <> num <> " RFC " <> num <> ">" <> r+ let name = BL.drop rfcDrop t+ pref =+ if BLC.all isDigit name+ then "rfc"+ else "draft"+ in iana <> pref <> name <> " RFC " <> name <> ">" <> r | httpPrefix `BL.isPrefixOf` t -> Just $ "<" <> BL.drop httpDrop t <> ">" <> r | otherPrefix `BL.isPrefixOf` t -> Just $
util/link-relations-1.csv view
@@ -5,6 +5,8 @@ archives,"Refers to a collection of records, documents, or other materials of historical interest.",[http://www.w3.org/TR/2011/WD-html5-20110113/links.html#rel-archives], author,Refers to the context's author.,[http://www.w3.org/TR/html5/links.html#link-type-author], +blocked-by,"Identifies the entity blocking access to a resource+ folllowing on receipt of a legal demand.",[RFC-ietf-httpbis-legally-restricted-status-04], bookmark,Gives a permanent link to use for bookmarking purposes.,[http://www.w3.org/TR/html5/links.html#link-type-bookmark], canonical,Designates the preferred version of a resource (the IRI and its contents).,[RFC6596], chapter,Refers to a chapter in a collection of resources.,[http://www.w3.org/TR/1999/REC-html401-19991224], @@ -102,6 +104,7 @@ predecessor-version,"Points to a resource containing the predecessor version in the version history.",[RFC5829], prefetch,Indicates that the link target should be preemptively cached.,[http://www.w3.org/TR/html5/links.html#link-type-prefetch], +preload,"Refers to a resource that should be loaded early in the processing of the link's context, without blocking rendering.",[http://www.w3.org/TR/preload/],Additional target attributes establish the detailed fetch properties of the link. prev,"Indicates that the link's context is a part of a series, and that the previous in the series is the link target.",[http://www.w3.org/TR/html5/links.html#link-type-prev], preview,Refers to a resource that provides a preview of the link's context.,"[RFC6903], section 3",