| Copyright | Copyright (C) 2017–2019 John MacFarlane | 
|---|---|
| License | GNU GPL, version 2 or above | 
| Maintainer | John MacFarlane <jgm@berkeley.edu> | 
| Stability | alpha | 
| Portability | portable | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
Text.Pandoc.BCP47
Description
Functions for parsing and rendering BCP47 language identifiers.
Synopsis
- getLang :: WriterOptions -> Meta -> Maybe String
- parseBCP47 :: String -> Either String Lang
- data Lang = Lang {- langLanguage :: String
- langScript :: String
- langRegion :: String
- langVariants :: [String]
 
- renderLang :: Lang -> String
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.
Represents BCP 47 language/country code.
Constructors
| Lang | |
| Fields 
 | |
renderLang :: Lang -> String Source #
Render a Lang as BCP 47.