~alcinnz/rhapsode

53b9d8224a56ea8463b5ef7efba9858d78d33593 — Adrian Cochrane 5 years ago 4d35659
Upgrade to nonbroken Stylish Haskell.
3 files changed, 23 insertions(+), 23 deletions(-)

M rhapsode.cabal
M src/DefaultCSS.hs
M src/Main.hs
M rhapsode.cabal => rhapsode.cabal +1 -1
@@ 64,7 64,7 @@ executable rhapsode
        http-client, http-client-tls, bytestring,
        html-conduit, xml-conduit, text, containers,
        network-uri,
        stylish-haskell >= 0.2.0, css-syntax, stylish-html-conduit
        stylish-haskell >= 0.2.2, css-syntax, stylish-html-conduit
  
  -- Directories containing source files.
  hs-source-dirs:      src

M src/DefaultCSS.hs => src/DefaultCSS.hs +20 -20
@@ 16,17 16,17 @@ userAgentCSS = unlines [
  "select::before, textarea::before, input::before {content: 'Input'; pitch: high}",
  "output::before {content: 'Output'; pitch: high}",
  "text-area, button, select, input, output {pitch: low}",
--  "input, output {content: attr(value)}",
  "input, output {content: attr(value)}",
  "text-area {speak-as: literal-punctuation}",
  "",
--  "option:not([checked]) {speak: never}",
  "option:not([checked]) {speak: never}",
  "select[multiple] option {cue-before: url(bulletpoint.wav)}",
  "",
  "/* Forms themselves require a label in order to support navigation */",
  "form::before {content: 'Form'}",
--  "form[action]::before {content: attr(action)}",
--  "form[alt]::before {content: attr(alt)}",
--  "form[title]::before {content: attr(title)}",
  "form[action]::before {content: attr(action)}",
  "form[alt]::before {content: attr(alt)}",
  "form[title]::before {content: attr(title)}",
  "",
  "/** Tables **/",
  "table::before {content: 'Table'; voice-volume: x-soft}",


@@ 78,29 78,29 @@ userAgentCSS = unlines [
  "ol ol ol ol {counter-reset: -rhaps-ol4}",
  "ol ol ol ol ol {counter-reset: -rhaps-ol5}",
  "ol ol ol ol ol ol {counter-reset: -rhaps-ol6}",
--  "ol li::before {content: counter(-rhaps-ol1)}",
--  "ol ol li::before {content: counters(-rhaps-ol1, -rhaps-ol2)}",
--  "ol ol ol li::before {content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3)}",
--  "ol ol ol ol li::before {",
--  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3, -rhaps-ol4)",
--  "}",
--  "ol ol ol ol ol li::before {",
--  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3, -rhaps-ol4, -rhaps-ol5)",
--  "}",
--  "ol ol ol ol ol ol li::before {",
--  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3, -rhaps-ol4, -rhaps-ol5, -rhaps-ol6)",
--  "}",
  "ol li::before {content: counter(-rhaps-ol1)}",
  "ol ol li::before {content: counters(-rhaps-ol1, -rhaps-ol2)}",
  "ol ol ol li::before {content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3)}",
  "ol ol ol ol li::before {",
  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3, -rhaps-ol4)",
  "}",
  "ol ol ol ol ol li::before {",
  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3, -rhaps-ol4, -rhaps-ol5)",
  "}",
  "ol ol ol ol ol ol li::before {",
  "content: counters(-rhaps-ol1, -rhaps-ol2, -rhaps-ol3, -rhaps-ol4, -rhaps-ol5, -rhaps-ol6)",
  "}",
  "",
  "",
  "/** HTML6 **/",
--  "abbr[title]::after {content: attr(title); voice-volume: x-soft}",
  "abbr[title]::after {content: attr(title); voice-volume: x-soft}",
  "abbr {speak-as: spell-out}",
  "",
  "q, blockquote {voice-family: neutral 2}",
  "cite {voice-stress: reduce}",
--  "dialog:not([open]) {speak: never}",
  "dialog:not([open]) {speak: never}",
  "kbd {speak-as: spell-out}",
--  "progress {content: attr(value) 'of' attr(max)}"
  "progress {content: attr(value) 'of' attr(max)}",
  "sub {voice-rate: x-fast}",
  "sup {voice-rate: fast}",
  "var {voice-rate: slow}"

M src/Main.hs => src/Main.hs +2 -2
@@ 42,12 42,12 @@ renderElLBS el = XML.renderLBS XML.def $ XML.Document {

retreiveStyles html manager base = do
    style <- H2C.externalStyles authorStyle testMedia html loadURL
    return agentStyle -- FIXME Stylish Haskell freezes when I parse more.
    return style
  where
    emptyStyle :: Style.QueryableStyleSheet MapPropertyParser
    emptyStyle = Style.queryableStyleSheet
    agentStyle = H2C.cssPriorityAgent emptyStyle `CSS.parse` Txt.pack userAgentCSS
    authorStyle = H2C.internalStyles testMedia (H2C.cssPriorityAuthor agentStyle) html
    authorStyle = H2C.internalStyles testMedia agentStyle html

    loadURL url = do -- TODO parallelise.
        request <- setUriRelative base url