Add preliminary support for SmallCaps inline element. (Andrea Rossato)
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1327 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
7c35c0bc25
commit
2637e3595a
11 changed files with 25 additions and 10 deletions
|
@ -104,6 +104,7 @@ data Inline
|
|||
| Superscript [Inline] -- ^ Superscripted text (list of inlines)
|
||||
| Subscript [Inline] -- ^ Subscripted text (list of inlines)
|
||||
| Quoted QuoteType [Inline] -- ^ Quoted text (list of inlines)
|
||||
| SmallCaps [Inline] -- ^ Small caps text (list of inlines)
|
||||
| Code String -- ^ Inline code (literal)
|
||||
| Space -- ^ Inter-word space
|
||||
| EmDash -- ^ Em dash
|
||||
|
|
|
@ -263,6 +263,7 @@ inlineToConTeXt (Quoted SingleQuote lst) = do
|
|||
inlineToConTeXt (Quoted DoubleQuote lst) = do
|
||||
contents <- inlineListToConTeXt lst
|
||||
return $ text "\\quotation{" <> contents <> char '}'
|
||||
inlineToConTeXt (SmallCaps lst) = inlineListToConTeXt lst
|
||||
inlineToConTeXt Apostrophe = return $ char '\''
|
||||
inlineToConTeXt EmDash = return $ text "---"
|
||||
inlineToConTeXt EnDash = return $ text "--"
|
||||
|
|
|
@ -225,6 +225,7 @@ inlineToDocbook opts (Subscript lst) =
|
|||
inTagsSimple "subscript" $ inlinesToDocbook opts lst
|
||||
inlineToDocbook opts (Quoted _ lst) =
|
||||
inTagsSimple "quote" $ inlinesToDocbook opts lst
|
||||
inlineToDocbook opts (SmallCaps lst) = inlinesToDocbook opts lst
|
||||
inlineToDocbook _ Apostrophe = char '\''
|
||||
inlineToDocbook _ Ellipses = text "…"
|
||||
inlineToDocbook _ EmDash = text "—"
|
||||
|
|
|
@ -241,6 +241,7 @@ inlineListToIdentifier' (x:xs) =
|
|||
Emph lst -> inlineListToIdentifier' lst
|
||||
Strikeout lst -> inlineListToIdentifier' lst
|
||||
Superscript lst -> inlineListToIdentifier' lst
|
||||
SmallCaps lst -> inlineListToIdentifier' lst
|
||||
Subscript lst -> inlineListToIdentifier' lst
|
||||
Strong lst -> inlineListToIdentifier' lst
|
||||
Quoted _ lst -> inlineListToIdentifier' lst
|
||||
|
@ -426,6 +427,8 @@ inlineToHtml opts inline =
|
|||
(Code str) -> return $ thecode << str
|
||||
(Strikeout lst) -> inlineListToHtml opts lst >>=
|
||||
return . (thespan ! [thestyle "text-decoration: line-through;"])
|
||||
(SmallCaps lst) -> inlineListToHtml opts lst >>=
|
||||
return . (thespan ! [thestyle "font-variant: small-caps;"])
|
||||
(Superscript lst) -> inlineListToHtml opts lst >>= return . sup
|
||||
(Subscript lst) -> inlineListToHtml opts lst >>= return . sub
|
||||
(Quoted quoteType lst) ->
|
||||
|
|
|
@ -290,6 +290,7 @@ inlineToLaTeX (Quoted DoubleQuote lst) = do
|
|||
then text "\\,"
|
||||
else empty
|
||||
return $ text "``" <> s1 <> contents <> s2 <> text "''"
|
||||
inlineToLaTeX (SmallCaps lst) = inlineListToLaTeX lst
|
||||
inlineToLaTeX Apostrophe = return $ char '\''
|
||||
inlineToLaTeX EmDash = return $ text "---"
|
||||
inlineToLaTeX EnDash = return $ text "--"
|
||||
|
|
|
@ -262,6 +262,7 @@ inlineToMan opts (Quoted SingleQuote lst) = do
|
|||
inlineToMan opts (Quoted DoubleQuote lst) = do
|
||||
contents <- inlineListToMan opts lst
|
||||
return $ text "\\[lq]" <> contents <> text "\\[rq]"
|
||||
inlineToMan opts (SmallCaps lst) = inlineListToMan opts lst
|
||||
inlineToMan _ EmDash = return $ text "\\[em]"
|
||||
inlineToMan _ EnDash = return $ text "\\[en]"
|
||||
inlineToMan _ Apostrophe = return $ char '\''
|
||||
|
|
|
@ -323,6 +323,7 @@ inlineToMarkdown opts (Quoted SingleQuote lst) = do
|
|||
inlineToMarkdown opts (Quoted DoubleQuote lst) = do
|
||||
contents <- inlineListToMarkdown opts lst
|
||||
return $ char '"' <> contents <> char '"'
|
||||
inlineToMarkdown opts (SmallCaps lst) = inlineListToMarkdown opts lst
|
||||
inlineToMarkdown _ EmDash = return $ text "--"
|
||||
inlineToMarkdown _ EnDash = return $ char '-'
|
||||
inlineToMarkdown _ Apostrophe = return $ char '\''
|
||||
|
|
|
@ -369,6 +369,7 @@ inlineToOpenDocument o ils
|
|||
| Strikeout l <- ils = withTextStyle Strike $ inlinesToOpenDocument o l
|
||||
| Superscript l <- ils = withTextStyle Sup $ inlinesToOpenDocument o l
|
||||
| Subscript l <- ils = withTextStyle Sub $ inlinesToOpenDocument o l
|
||||
| SmallCaps l <- ils = withTextStyle SmallC $ inlinesToOpenDocument o l
|
||||
| Quoted t l <- ils = inQuotes t <$> inlinesToOpenDocument o l
|
||||
| Code s <- ils = preformatted s
|
||||
| Math s <- ils = inlinesToOpenDocument o (readTeXMath s)
|
||||
|
@ -508,19 +509,20 @@ paraTableStyles t s (a:xs)
|
|||
[ ("fo:text-align", x)
|
||||
, ("style:justify-single-word", "false")]
|
||||
|
||||
data TextStyle = Italic | Bold | Strike | Sub | Sup deriving ( Eq )
|
||||
data TextStyle = Italic | Bold | Strike | Sub | Sup | SmallC deriving ( Eq )
|
||||
|
||||
textStyleAttr :: TextStyle -> [(String,String)]
|
||||
textStyleAttr s
|
||||
| Italic <- s = [("fo:font-style" ,"italic" )
|
||||
,("style:font-style-asian" ,"italic" )
|
||||
,("style:font-style-complex" ,"italic" )]
|
||||
| Bold <- s = [("fo:font-weight" ,"bold" )
|
||||
,("style:font-weight-asian" ,"bold" )
|
||||
,("style:font-weight-complex" ,"bold" )]
|
||||
| Strike <- s = [("style:text-line-through-style", "solid" )]
|
||||
| Sub <- s = [("style:text-position" ,"sub 58%" )]
|
||||
| Sup <- s = [("style:text-position" ,"super 58%")]
|
||||
| Italic <- s = [("fo:font-style" ,"italic" )
|
||||
,("style:font-style-asian" ,"italic" )
|
||||
,("style:font-style-complex" ,"italic" )]
|
||||
| Bold <- s = [("fo:font-weight" ,"bold" )
|
||||
,("style:font-weight-asian" ,"bold" )
|
||||
,("style:font-weight-complex" ,"bold" )]
|
||||
| Strike <- s = [("style:text-line-through-style", "solid" )]
|
||||
| Sub <- s = [("style:text-position" ,"sub 58%" )]
|
||||
| Sup <- s = [("style:text-position" ,"super 58%" )]
|
||||
| SmallC <- s = [("fo:font-variant" ,"small-caps")]
|
||||
| otherwise = []
|
||||
|
||||
openDocumentNameSpaces :: [(String, String)]
|
||||
|
|
|
@ -282,6 +282,7 @@ inlineToRST (Quoted SingleQuote lst) = do
|
|||
inlineToRST (Quoted DoubleQuote lst) = do
|
||||
contents <- inlineListToRST lst
|
||||
return $ char '"' <> contents <> char '"'
|
||||
inlineToRST (SmallCaps lst) = inlineListToRST lst
|
||||
inlineToRST EmDash = return $ text "--"
|
||||
inlineToRST EnDash = return $ char '-'
|
||||
inlineToRST Apostrophe = return $ char '\''
|
||||
|
|
|
@ -268,6 +268,7 @@ inlineToRTF (Quoted SingleQuote lst) =
|
|||
"\\u8216'" ++ (inlineListToRTF lst) ++ "\\u8217'"
|
||||
inlineToRTF (Quoted DoubleQuote lst) =
|
||||
"\\u8220\"" ++ (inlineListToRTF lst) ++ "\\u8221\""
|
||||
inlineToRTF (SmallCaps lst) = inlineListToRTF lst
|
||||
inlineToRTF Apostrophe = "\\u8217'"
|
||||
inlineToRTF Ellipses = "\\u8230?"
|
||||
inlineToRTF EmDash = "\\u8212-"
|
||||
|
|
|
@ -356,6 +356,7 @@ inlineForNode (Superscript lst) = inlineListForNode lst
|
|||
inlineForNode (Subscript lst) = inlineListForNode lst
|
||||
inlineForNode (Quoted _ lst) = inlineListForNode lst
|
||||
inlineForNode (Code str) = inlineForNode (Str str)
|
||||
inlineForNode (SmallCaps lst) = inlineListForNode lst
|
||||
inlineForNode Space = return $ char ' '
|
||||
inlineForNode EmDash = return $ text "---"
|
||||
inlineForNode EnDash = return $ text "--"
|
||||
|
@ -425,6 +426,7 @@ inlineToTexinfo (Quoted DoubleQuote lst) = do
|
|||
contents <- inlineListToTexinfo lst
|
||||
return $ text "``" <> contents <> text "''"
|
||||
|
||||
inlineToTexinfo (SmallCaps lst) = inlineListToTexinfo lst
|
||||
inlineToTexinfo Apostrophe = return $ char '\''
|
||||
inlineToTexinfo EmDash = return $ text "---"
|
||||
inlineToTexinfo EnDash = return $ text "--"
|
||||
|
|
Loading…
Add table
Reference in a new issue