xrefcheck-0.1.3
Safe HaskellNone
LanguageHaskell2010

Xrefcheck.Core

Description

Various primitives.

Synopsis

Documentation

newtype Position Source #

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.

Constructors

Position (Maybe Text) 

Instances

Instances details
Show Position Source # 
Instance details

Defined in Xrefcheck.Core

Generic Position Source # 
Instance details

Defined in Xrefcheck.Core

Associated Types

type Rep Position :: Type -> Type #

Methods

from :: Position -> Rep Position x #

to :: Rep Position x -> Position #

NFData Position Source # 
Instance details

Defined in Xrefcheck.Core

Methods

rnf :: Position -> () #

Buildable Position Source # 
Instance details

Defined in Xrefcheck.Core

Methods

build :: Position -> Builder #

type Rep Position Source # 
Instance details

Defined in Xrefcheck.Core

type Rep Position = D1 ('MetaData "Position" "Xrefcheck.Core" "xrefcheck-0.1.3-F53rXbYHjewJ5mYL7etcgU" 'True) (C1 ('MetaCons "Position" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))

data Reference Source #

Full info about a reference.

Constructors

Reference 

Fields

Instances

Instances details
Show Reference Source # 
Instance details

Defined in Xrefcheck.Core

Generic Reference Source # 
Instance details

Defined in Xrefcheck.Core

Associated Types

type Rep Reference :: Type -> Type #

NFData Reference Source # 
Instance details

Defined in Xrefcheck.Core

Methods

rnf :: Reference -> () #

Buildable Reference Source # 
Instance details

Defined in Xrefcheck.Core

Methods

build :: Reference -> Builder #

type Rep Reference Source # 
Instance details

Defined in Xrefcheck.Core

data AnchorType Source #

Context of anchor.

Constructors

HeaderAnchor Int

Every section header is usually an anchor

HandAnchor

They can be set up manually

BiblioAnchor

Id of entry in bibliography

Instances

Instances details
Eq AnchorType Source # 
Instance details

Defined in Xrefcheck.Core

Show AnchorType Source # 
Instance details

Defined in Xrefcheck.Core

Generic AnchorType Source # 
Instance details

Defined in Xrefcheck.Core

Associated Types

type Rep AnchorType :: Type -> Type #

NFData AnchorType Source # 
Instance details

Defined in Xrefcheck.Core

Methods

rnf :: AnchorType -> () #

Buildable AnchorType Source # 
Instance details

Defined in Xrefcheck.Core

Methods

build :: AnchorType -> Builder #

type Rep AnchorType Source # 
Instance details

Defined in Xrefcheck.Core

type Rep AnchorType = D1 ('MetaData "AnchorType" "Xrefcheck.Core" "xrefcheck-0.1.3-F53rXbYHjewJ5mYL7etcgU" 'False) (C1 ('MetaCons "HeaderAnchor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: (C1 ('MetaCons "HandAnchor" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BiblioAnchor" 'PrefixI 'False) (U1 :: Type -> Type)))

data Anchor Source #

A referable anchor.

Constructors

Anchor 

Fields

Instances

Instances details
Show Anchor Source # 
Instance details

Defined in Xrefcheck.Core

Generic Anchor Source # 
Instance details

Defined in Xrefcheck.Core

Associated Types

type Rep Anchor :: Type -> Type #

Methods

from :: Anchor -> Rep Anchor x #

to :: Rep Anchor x -> Anchor #

NFData Anchor Source # 
Instance details

Defined in Xrefcheck.Core

Methods

rnf :: Anchor -> () #

Buildable Anchor Source # 
Instance details

Defined in Xrefcheck.Core

Methods

build :: Anchor -> Builder #

type Rep Anchor Source # 
Instance details

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))))

data FileInfo Source #

All information regarding a single file we care about.

Constructors

FileInfo 

Instances

Instances details
Show FileInfo Source # 
Instance details

Defined in Xrefcheck.Core

Generic FileInfo Source # 
Instance details

Defined in Xrefcheck.Core

Associated Types

type Rep FileInfo :: Type -> Type #

Methods

from :: FileInfo -> Rep FileInfo x #

to :: Rep FileInfo x -> FileInfo #

NFData FileInfo Source # 
Instance details

Defined in Xrefcheck.Core

Methods

rnf :: FileInfo -> () #

Default FileInfo Source # 
Instance details

Defined in Xrefcheck.Core

Methods

def :: FileInfo #

Buildable FileInfo Source # 
Instance details

Defined in Xrefcheck.Core

Methods

build :: FileInfo -> Builder #

type Rep FileInfo Source # 
Instance details

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])))

newtype RepoInfo Source #

Constructors

RepoInfo (Map FilePath FileInfo) 

Instances

Instances details
Show RepoInfo Source # 
Instance details

Defined in Xrefcheck.Core

Buildable RepoInfo Source # 
Instance details

Defined in Xrefcheck.Core

Methods

build :: RepoInfo -> Builder #

pattern PathSep :: Char Source #

data LocationType Source #

Type of reference.

Constructors

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

Instances details
Show LocationType Source # 
Instance details

Defined in Xrefcheck.Core

Buildable LocationType Source # 
Instance details

Defined in Xrefcheck.Core

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.

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 #

Constructors

VerifyProgress 

Fields

Instances

Instances details
Show VerifyProgress Source # 
Instance details

Defined in Xrefcheck.Core