~alcinnz/rhapsode

d94a3ecb9788980310707c7bc6a4a66ab68d6d6c — Adrian Cochrane 4 years ago 8672961
Propagate local attrs through to output.
3 files changed, 5 insertions(+), 1 deletions(-)

M src/SSML.hs
M src/SpeechStyle.hs
M useragent.css
M src/SSML.hs => src/SSML.hs +1 -0
@@ 22,6 22,7 @@ styleToNodes = Prelude.map style . postorder styleToSSML'

styleToSSML' SpeechStyle { speak = False } _ = []
styleToSSML' self@SpeechStyle {content = ""} children = el "prosody" [
        ("xml:lang", lang self),
        ("rhapsode:pseudo", pseudoEl self),
        ("volume", volume self),
        ("rate", rate self),

M src/SpeechStyle.hs => src/SpeechStyle.hs +3 -0
@@ 36,6 36,7 @@ data SpeechStyle = SpeechStyle {
    marker :: Maybe Text,

    content :: Text,
    lang :: Maybe Text,
    pseudoEl :: Maybe Text
}



@@ 67,6 68,7 @@ instance PropertyParser SpeechStyle where
        marker = Nothing,

        content = "",
        lang = Nothing,
        pseudoEl = Nothing
    }
    inherit _ = temp -- Text synthesizers handle inheritance.


@@ 114,6 116,7 @@ instance PropertyParser SpeechStyle where
    longhand _ self "content" [Ident "initial"] = Just self {content = ""}
    longhand _ self "content" toks = (\v -> self {content = v}) <$> parseStrings toks
    longhand _ self "::" [Ident pseudo] = Just self {pseudoEl = Just pseudo} -- To make sure content doesn't override :before & :after
    longhand _ self "-rhaps-lang" [String v] = Just self {lang = Just v}
    longhand _ _ _ _ = Nothing

    shorthand _ "pause" [a, b] | isPause [a], isPause [b] = [("pause-before", [a]), ("pause-after", [b])]

M useragent.css => useragent.css +1 -1
@@ 1,7 1,7 @@
head, link, meta, style, script, title, base {speak: never}
datalist, template {speak: never}
html {speak-as: normal no-punctuation}
* {white-space: normal;}
[lang] {-rhaps-lang: attr(lang)} /* Pass this info through styletree into output */

/** Forms **/
button, select, textarea, input, output {speak: never} /* Leave to special form entry mode */