highlighting-kate 0.2.8.2 → 0.2.9
raw patch · 7 files changed
+84/−74 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Text.Highlighting.Kate: OptInline :: FormatOption
+ Text.Highlighting.Kate.Format: OptInline :: FormatOption
Files
- Text/Highlighting/Kate/Format.hs +28/−26
- Text/Highlighting/Kate/Syntax/Latex.hs +1/−1
- changelog +8/−0
- css/hk-espresso.css +16/−16
- css/hk-kate.css +15/−15
- css/hk-pyg.css +15/−15
- highlighting-kate.cabal +1/−1
Text/Highlighting/Kate/Format.hs view
@@ -23,6 +23,7 @@ | OptDetailed -- ^ Include detailed lexical information in classes. -- (By default, only the default style is included. This -- option causes output to be more verbose.)+ | OptInline -- ^ Format as span-level, not block-level element deriving (Eq, Show, Read) -- | Format a list of highlighted @SourceLine@s as XHtml.@@ -33,19 +34,20 @@ formatAsXHtml opts lang lines = let startNum = getStartNum opts numberOfLines = length lines- code = thecode << intersperse br (map (sourceLineToHtml opts) lines)- in if OptNumberLines `elem` opts- then let lnTitle = title "Click to toggle line numbers"- lnOnClick = strAttr "onclick" "with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"- nums = td ! [theclass "nums", lnTitle, lnOnClick] $ pre <<- (intersperse br $ map lineNum [startNum..(startNum + numberOfLines - 1)])- lineNum n = if OptLineAnchors `elem` opts- then anchor ! [identifier $ show n] << show n- else stringToHtml $ show n- sourceCode = td ! [theclass "sourceCode"] $ - pre ! [theclass $ unwords ["sourceCode", lang]] $ code- in table ! [theclass "sourceCode"] $ tr << [nums, sourceCode]- else pre ! [theclass $ unwords ["sourceCode", lang]] $ code+ code = thecode ! [theclass $ unwords ["sourceCode", lang]] << intersperse br (map (sourceLineToHtml opts) lines)+ in if OptInline `elem` opts+ then code+ else if OptNumberLines `elem` opts+ then let lnTitle = title "Click to toggle line numbers"+ lnOnClick = strAttr "onclick" "with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"+ nums = td ! [theclass "nums", lnTitle, lnOnClick] $ pre <<+ (intersperse br $ map lineNum [startNum..(startNum + numberOfLines - 1)])+ lineNum n = if OptLineAnchors `elem` opts+ then anchor ! [identifier $ show n] << show n+ else stringToHtml $ show n+ sourceCode = td ! [theclass "sourceCode"] $ pre ! [theclass "sourceCode"] << code+ in table ! [theclass "sourceCode"] $ tr << [nums, sourceCode]+ else pre ! [theclass "sourceCode"] << code labeledSourceToHtml :: [FormatOption] -> LabeledSource -> Html labeledSourceToHtml _ ([], txt) = toHtml txt@@ -78,16 +80,16 @@ \ { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }\n\ \td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }\n\ \td.sourceCode { padding-left: 5px; }\n\ - \pre.sourceCode span.kw { color: #007020; font-weight: bold; } \n\ - \pre.sourceCode span.dt { color: #902000; }\n\ - \pre.sourceCode span.dv { color: #40a070; }\n\ - \pre.sourceCode span.bn { color: #40a070; }\n\ - \pre.sourceCode span.fl { color: #40a070; }\n\ - \pre.sourceCode span.ch { color: #4070a0; }\n\ - \pre.sourceCode span.st { color: #4070a0; }\n\ - \pre.sourceCode span.co { color: #60a0b0; font-style: italic; }\n\ - \pre.sourceCode span.ot { color: #007020; }\n\ - \pre.sourceCode span.al { color: red; font-weight: bold; }\n\ - \pre.sourceCode span.fu { color: #06287e; }\n\ - \pre.sourceCode span.re { }\n\ - \pre.sourceCode span.er { color: red; font-weight: bold; }"+ \code.sourceCode span.kw { color: #007020; font-weight: bold; } \n\ + \code.sourceCode span.dt { color: #902000; }\n\ + \code.sourceCode span.dv { color: #40a070; }\n\ + \code.sourceCode span.bn { color: #40a070; }\n\ + \code.sourceCode span.fl { color: #40a070; }\n\ + \code.sourceCode span.ch { color: #4070a0; }\n\ + \code.sourceCode span.st { color: #4070a0; }\n\ + \code.sourceCode span.co { color: #60a0b0; font-style: italic; }\n\ + \code.sourceCode span.ot { color: #007020; }\n\ + \code.sourceCode span.al { color: red; font-weight: bold; }\n\ + \code.sourceCode span.fu { color: #06287e; }\n\ + \code.sourceCode span.re { }\n\ + \code.sourceCode span.er { color: red; font-weight: bold; }"
Text/Highlighting/Kate/Syntax/Latex.hs view
@@ -114,7 +114,7 @@ updateState $ \st -> st { synStCharsParsedInLine = oldCharsParsed + length txt, synStPrevChar = prevchar } return (labs, txt) -styles = [("Comment","co"),("Error","al"),("Region Marker","re"),("Alert","al")]+styles = [("Keyword","kw"),("Comment","co"),("Error","al"),("Math","dv"),("Keyword Mathmode","kw"),("Environment","fu"),("Verbatim","st"),("Region Marker","re"),("Alert","al"),("Structure Text","kw"),("Structure Keyword","kw"),("Structure Math","kw"),("Structure Keyword Mathmode","kw")] parseExpressionInternal = do context <- currentContext
changelog view
@@ -1,3 +1,11 @@+highlighting-kate 0.2.9 (29 Jan 2011)++ * Added OptInline to FormatOptions. Inline code is formatted+ with a "code" tag but no "pre" tag.+ * Put language class on "code" instead of "pre".+ Put "sourceCode" class on "pre" in addition to "code".+ * Fixed a bug in tango style with numbering.+ highlighting-kate 0.2.8.2 (28 Jan 2011) * formatAsXHtml: Don't put `<br/>` after last line.
css/hk-espresso.css view
@@ -1,19 +1,19 @@ /* Based on ultraviolet's espresso_libre.css */-table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre +table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }-td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; } -pre.sourceCode, table.sourceCode { background-color: #2A211C; color: #BDAE9D; }+td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }+code.sourceCode, pre.sourceCode, table.sourceCode { background-color: #2A211C; color: #BDAE9D; } td.sourceCode { padding-left: 5px; }-pre.sourceCode span.kw { color: #43A8ED; font-weight: bold; } -pre.sourceCode span.dt { text-decoration: underline; }-pre.sourceCode span.dv { color: #44AA43; }-pre.sourceCode span.bn { color: #44AA43; }-pre.sourceCode span.fl { color: #44AA43; }-pre.sourceCode span.ch { color: #049B0A; }-pre.sourceCode span.st { color: #049B0A; }-pre.sourceCode span.co { color: #0066FF; font-style: italic; }-pre.sourceCode span.ot { }-pre.sourceCode span.al { color: yellow; font-weight: bold; }-pre.sourceCode span.fu { color: #FF9358; font-weight: bold; }-pre.sourceCode span.re { }-pre.sourceCode span.er { color: yellow; font-weight: bold; }+code.sourceCode span.kw { color: #43A8ED; font-weight: bold; }+code.sourceCode span.dt { text-decoration: underline; }+code.sourceCode span.dv { color: #44AA43; }+code.sourceCode span.bn { color: #44AA43; }+code.sourceCode span.fl { color: #44AA43; }+code.sourceCode span.ch { color: #049B0A; }+code.sourceCode span.st { color: #049B0A; }+code.sourceCode span.co { color: #0066FF; font-style: italic; }+code.sourceCode span.ot { }+code.sourceCode span.al { color: yellow; font-weight: bold; }+code.sourceCode span.fu { color: #FF9358; font-weight: bold; }+code.sourceCode span.re { }+code.sourceCode span.er { color: yellow; font-weight: bold; }
css/hk-kate.css view
@@ -1,19 +1,19 @@ /* Based on kate's own default colors for Haskell */-table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre +table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }-td.lineNumbers { text-align: right; background-color: #EBEBEB; color: black; padding-right: 5px; padding-left: 5px; } +td.lineNumbers { text-align: right; background-color: #EBEBEB; color: black; padding-right: 5px; padding-left: 5px; } td.sourceCode { padding-left: 5px; } pre.sourceCode { }-pre.sourceCode span.kw { font-weight: bold; } -pre.sourceCode span.dt { color: #800000; }-pre.sourceCode span.dv { color: #0000FF; }-pre.sourceCode span.bn { color: #0000FF; }-pre.sourceCode span.fl { color: #800080; }-pre.sourceCode span.ch { color: #FF00FF; }-pre.sourceCode span.st { color: #DD0000; }-pre.sourceCode span.co { color: #808080; font-style: italic; }-pre.sourceCode span.ot { }-pre.sourceCode span.al { color: green; font-weight: bold; }-pre.sourceCode span.fu { color: #000080; }-pre.sourceCode span.re { }-pre.sourceCode span.er { color: red; font-weight: bold; }+code.sourceCode span.kw { font-weight: bold; }+code.sourceCode span.dt { color: #800000; }+code.sourceCode span.dv { color: #0000FF; }+code.sourceCode span.bn { color: #0000FF; }+code.sourceCode span.fl { color: #800080; }+code.sourceCode span.ch { color: #FF00FF; }+code.sourceCode span.st { color: #DD0000; }+code.sourceCode span.co { color: #808080; font-style: italic; }+code.sourceCode span.ot { }+code.sourceCode span.al { color: green; font-weight: bold; }+code.sourceCode span.fu { color: #000080; }+code.sourceCode span.re { }+code.sourceCode span.er { color: red; font-weight: bold; }
css/hk-pyg.css view
@@ -1,19 +1,19 @@ /* Loosely based on pygment's default colors */-table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre +table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }-td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; } +td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; } td.sourceCode { padding-left: 5px; } pre.sourceCode { }-pre.sourceCode span.kw { color: #007020; font-weight: bold; } -pre.sourceCode span.dt { color: #902000; }-pre.sourceCode span.dv { color: #40a070; }-pre.sourceCode span.bn { color: #40a070; }-pre.sourceCode span.fl { color: #40a070; }-pre.sourceCode span.ch { color: #4070a0; }-pre.sourceCode span.st { color: #4070a0; }-pre.sourceCode span.co { color: #60a0b0; font-style: italic; }-pre.sourceCode span.ot { color: #007020; }-pre.sourceCode span.al { color: red; font-weight: bold; }-pre.sourceCode span.fu { color: #06287e; }-pre.sourceCode span.re { }-pre.sourceCode span.er { color: red; font-weight: bold; }+code.sourceCode span.kw { color: #007020; font-weight: bold; }+code.sourceCode span.dt { color: #902000; }+code.sourceCode span.dv { color: #40a070; }+code.sourceCode span.bn { color: #40a070; }+code.sourceCode span.fl { color: #40a070; }+code.sourceCode span.ch { color: #4070a0; }+code.sourceCode span.st { color: #4070a0; }+code.sourceCode span.co { color: #60a0b0; font-style: italic; }+code.sourceCode span.ot { color: #007020; }+code.sourceCode span.al { color: red; font-weight: bold; }+code.sourceCode span.fu { color: #06287e; }+code.sourceCode span.re { }+code.sourceCode span.er { color: red; font-weight: bold; }
highlighting-kate.cabal view
@@ -1,5 +1,5 @@ Name: highlighting-kate-Version: 0.2.8.2+Version: 0.2.9 Cabal-Version: >= 1.2 Build-Type: Simple Category: Text