drasil-lang-0.1.60.0: A framework for code and document generation for scientific software - Language SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Document.Reference

Description

Defines a type used to hold referencing information.

Synopsis

Type

data Reference Source #

A Reference contains the identifier (UID), a reference address (LblType), a human-readable shortname (ShortName), and any extra information about the reference (RefInfo).

Instances

Instances details
Generic Reference Source # 
Instance details

Defined in Language.Drasil.Document.Reference

Associated Types

type Rep Reference :: Type -> Type #

HasChunkRefs Reference Source # 
Instance details

Defined in Language.Drasil.Document.Reference

Methods

chunkRefs :: Reference -> Set UID #

HasUID Reference Source #

Finds the UID of a Reference.

Instance details

Defined in Language.Drasil.Document.Reference

Methods

uid :: Getter Reference UID #

HasRefAddress Reference Source #

Finds the reference address contained in a Reference (through a LblType).

Instance details

Defined in Language.Drasil.Document.Reference

HasShortName Reference Source #

Finds the shortname of the reference address used for the Reference.

Instance details

Defined in Language.Drasil.Document.Reference

Eq Reference Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Document.Reference

type Rep Reference Source # 
Instance details

Defined in Language.Drasil.Document.Reference

type Rep Reference = D1 ('MetaData "Reference" "Language.Drasil.Document.Reference" "drasil-lang-0.1.60.0-GSVjWL6zqIJGx21JJ17VJN" 'False) (C1 ('MetaCons "Reference" 'PrefixI 'True) (S1 ('MetaSel ('Just "_ui") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID) :*: (S1 ('MetaSel ('Just "ra") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LblType) :*: S1 ('MetaSel ('Just "sn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ShortName))))

Class

class HasReference c where Source #

A class that contains a list of References.

Methods

getReferences :: Lens' c [Reference] Source #

Provides a Lens to the References.

Constructors

ref :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Reference Source #

Projector function that creates a Reference from something Referable.

refS :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence Source #

Takes the reference UID and wraps it into a Sentence.

namedRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence -> Sentence Source #

Takes a Reference with a name to be displayed and wraps it into a Sentence. Does not overwrite the shortname contained in the reference, but will only display as the given Sentence.

complexRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> RefInfo -> Sentence Source #

Takes a Reference with additional display info. Uses the internal shortname for its display name.

namedComplexRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence -> RefInfo -> Sentence Source #

Takes a Reference with a name to be displayed and any additional information and wraps it into a Sentence. Does not overwrite the shortname contained in the reference, but will only display as the given Sentence along with the given RefInfo.