citeproc-0.13.0.1: Generates citations and bibliography from CSL styles.

Safe Haskell | None
Language | Haskell2010

Citeproc.CaseTransform

Description

Provides functions that facilitate defining textcase transformations. To see how these can be used used, see the definitions of `addTextCase` in Citeproc.Pandoc and Citproc.CslJson.

Synopsis

- data CaseTransformState
  - = Start
  - | StartSentence
  - | AfterWordEnd
  - | AfterWordChar
  - | AfterSentenceEndingPunctuation
  - | BeforeLastWord
- newtype CaseTransformer = CaseTransformer {
  - unCaseTransformer :: Maybe Lang -> CaseTransformState -> Text -> Text
  }
- withUppercaseAll :: CaseTransformer
- withLowercaseAll :: CaseTransformer
- withCapitalizeWords :: CaseTransformer
- withCapitalizeFirst :: CaseTransformer
- withSentenceCase :: CaseTransformer
- withTitleCase :: CaseTransformer

# Documentation

data CaseTransformState Source #

Tracks context in textcase transformations.

Constructors

Start |
StartSentence |
AfterWordEnd |
AfterWordChar |
AfterSentenceEndingPunctuation |
BeforeLastWord |

#### Instances

Instances details

Show CaseTransformState Source # |
Instance details Defined in Citeproc.CaseTransform Methods showsPrec :: Int -> CaseTransformState -> ShowS Source # show :: CaseTransformState -> String Source # showList :: [CaseTransformState] -> ShowS Source #
Eq CaseTransformState Source # |
Instance details Defined in Citeproc.CaseTransform Methods (==) :: CaseTransformState -> CaseTransformState -> Bool Source # (/=) :: CaseTransformState -> CaseTransformState -> Bool Source #

newtype CaseTransformer Source #

Wraps a function used to define textcase transformations.

Constructors

CaseTransformer |

Fields

- unCaseTransformer :: Maybe Lang -> CaseTransformState -> Text -> Text

withUppercaseAll :: CaseTransformer Source #

Uppercase everything.

withLowercaseAll :: CaseTransformer Source #

Lowercase everything.

withCapitalizeWords :: CaseTransformer Source #

Capitalize all words.

withCapitalizeFirst :: CaseTransformer Source #

Capitalize first letter.

withSentenceCase :: CaseTransformer Source #

Capitalize first letter of each sentence.

withTitleCase :: CaseTransformer Source #

Use title case.