pandoc-2.0.1.1: Conversion between markup formats

CopyrightCopyright (C) 2017 John MacFarlane
LicenseGNU GPL, version 2 or above
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Stabilityalpha
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Text.Pandoc.BCP47

Description

Functions for parsing and rendering BCP47 language identifiers.

Synopsis

Documentation

getLang :: WriterOptions -> Meta -> Maybe String Source #

Get the contents of the lang metadata field or variable.

parseBCP47 :: String -> Either String Lang Source #

Parse a BCP 47 string as a Lang. Currently we parse extensions and private-use fields as "variants," even though officially they aren't.

data Lang Source #

Represents BCP 47 language/country code.

Instances

Eq Lang Source # 

Methods

(==) :: Lang -> Lang -> Bool #

(/=) :: Lang -> Lang -> Bool #

Ord Lang Source # 

Methods

compare :: Lang -> Lang -> Ordering #

(<) :: Lang -> Lang -> Bool #

(<=) :: Lang -> Lang -> Bool #

(>) :: Lang -> Lang -> Bool #

(>=) :: Lang -> Lang -> Bool #

max :: Lang -> Lang -> Lang #

min :: Lang -> Lang -> Lang #

Show Lang Source # 

Methods

showsPrec :: Int -> Lang -> ShowS #

show :: Lang -> String #

showList :: [Lang] -> ShowS #

renderLang :: Lang -> String Source #

Render a Lang as BCP 47.