Safe Haskell | None |
---|---|
Language | Haskell2010 |
Various primitives.
Synopsis
- newtype Position = Position (Maybe Text)
- data Reference = Reference {}
- data AnchorType
- data Anchor = Anchor {}
- data FileInfo = FileInfo {
- _fiReferences :: [Reference]
- _fiAnchors :: [Anchor]
- fiReferences :: Lens' FileInfo [Reference]
- fiAnchors :: Lens' FileInfo [Anchor]
- newtype RepoInfo = RepoInfo (Map FilePath FileInfo)
- finaliseFileInfo :: FileInfo -> FileInfo
- pattern PathSep :: Char
- data LocationType
- isExternal :: LocationType -> Bool
- isLocal :: LocationType -> Bool
- locationType :: Text -> LocationType
- data VerifyMode
- shouldCheckLocal :: VerifyMode -> Bool
- shouldCheckExternal :: VerifyMode -> Bool
- headerToAnchor :: Text -> Text
- stripAnchorDupNo :: Text -> Maybe Text
- canonizeLocalRef :: Text -> Text
- data VerifyProgress = VerifyProgress {}
- initVerifyProgress :: [Reference] -> VerifyProgress
- showAnalyseProgress :: VerifyMode -> VerifyProgress -> Text
- reprintAnalyseProgress :: Rewrite -> VerifyMode -> VerifyProgress -> IO ()
Documentation
Description of element position in source file. We keep this in text because scanners for different formats use different representation of this thing, and it actually appears in reports only.
Full info about a reference.
Instances
Show Reference Source # | |
Generic Reference Source # | |
NFData Reference Source # | |
Defined in Xrefcheck.Core | |
Buildable Reference Source # | |
Defined in Xrefcheck.Core | |
type Rep Reference Source # | |
Defined in Xrefcheck.Core type Rep Reference = D1 ('MetaData "Reference" "Xrefcheck.Core" "xrefcheck-0.1.3-F53rXbYHjewJ5mYL7etcgU" 'False) (C1 ('MetaCons "Reference" 'PrefixI 'True) ((S1 ('MetaSel ('Just "rName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "rLink") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "rAnchor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "rPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Position)))) |
data AnchorType Source #
Context of anchor.
HeaderAnchor Int | Every section header is usually an anchor |
HandAnchor | They can be set up manually |
BiblioAnchor | Id of entry in bibliography |
Instances
A referable anchor.
Instances
Show Anchor Source # | |
Generic Anchor Source # | |
NFData Anchor Source # | |
Defined in Xrefcheck.Core | |
Buildable Anchor Source # | |
Defined in Xrefcheck.Core | |
type Rep Anchor Source # | |
Defined in Xrefcheck.Core type Rep Anchor = D1 ('MetaData "Anchor" "Xrefcheck.Core" "xrefcheck-0.1.3-F53rXbYHjewJ5mYL7etcgU" 'False) (C1 ('MetaCons "Anchor" 'PrefixI 'True) (S1 ('MetaSel ('Just "aType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AnchorType) :*: (S1 ('MetaSel ('Just "aName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "aPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Position)))) |
All information regarding a single file we care about.
FileInfo | |
|
Instances
Show FileInfo Source # | |
Generic FileInfo Source # | |
NFData FileInfo Source # | |
Defined in Xrefcheck.Core | |
Default FileInfo Source # | |
Defined in Xrefcheck.Core | |
Buildable FileInfo Source # | |
Defined in Xrefcheck.Core | |
type Rep FileInfo Source # | |
Defined in Xrefcheck.Core type Rep FileInfo = D1 ('MetaData "FileInfo" "Xrefcheck.Core" "xrefcheck-0.1.3-F53rXbYHjewJ5mYL7etcgU" 'False) (C1 ('MetaCons "FileInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "_fiReferences") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Reference]) :*: S1 ('MetaSel ('Just "_fiAnchors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Anchor]))) |
finaliseFileInfo :: FileInfo -> FileInfo Source #
data LocationType Source #
Type of reference.
LocalLoc | Reference on this file |
RelativeLoc | Reference to a file relative to given one |
AbsoluteLoc | Reference to a file relative to the root |
ExternalLoc | Reference to a file at outer site |
OtherLoc | Entry not to be processed (e.g. "mailto:e-mail") |
Instances
Show LocationType Source # | |
Defined in Xrefcheck.Core showsPrec :: Int -> LocationType -> ShowS # show :: LocationType -> String # showList :: [LocationType] -> ShowS # | |
Buildable LocationType Source # | |
Defined in Xrefcheck.Core build :: LocationType -> Builder # |
isExternal :: LocationType -> Bool Source #
Whether this is a link to external resource.
isLocal :: LocationType -> Bool Source #
Whether this is a link to repo-local resource.
locationType :: Text -> LocationType Source #
Get type of reference.
data VerifyMode Source #
Which parts of verification do we perform.
shouldCheckLocal :: VerifyMode -> Bool Source #
shouldCheckExternal :: VerifyMode -> Bool Source #
headerToAnchor :: Text -> Text Source #
Convert section header name to an anchor refering it. Conversion rules: https://docs.gitlab.com/ee/user/markdown.html#header-ids-and-links
stripAnchorDupNo :: Text -> Maybe Text Source #
When there are several anchors with the same name, github automatically attaches "-number" suffixes to duplications to make them referable unambiguously. For instance, if there are two headers called "description", they would gain "description" and "description-1" anchors correspondingly.
This function strips this suffix and returns the original anchor in case when suffix is present.
canonizeLocalRef :: Text -> Text Source #
Strip ./
prefix from local references.
data VerifyProgress Source #
Instances
Show VerifyProgress Source # | |
Defined in Xrefcheck.Core showsPrec :: Int -> VerifyProgress -> ShowS # show :: VerifyProgress -> String # showList :: [VerifyProgress] -> ShowS # |
initVerifyProgress :: [Reference] -> VerifyProgress Source #
showAnalyseProgress :: VerifyMode -> VerifyProgress -> Text Source #
reprintAnalyseProgress :: Rewrite -> VerifyMode -> VerifyProgress -> IO () Source #