patat 0.8.0.0 → 0.8.1.1
raw patch · 5 files changed
+28/−16 lines, 5 files
Files
- CHANGELOG.md +7/−0
- README.md +10/−9
- patat.cabal +1/−1
- src/Patat/Presentation/Display.hs +6/−5
- src/Patat/Theme.hs +4/−1
CHANGELOG.md view
@@ -1,5 +1,12 @@ # Changelog +- 0.8.1.1 (2018-10-26)+ * Tickle CircleCI cache++- 0.8.1.0 (2018-10-26)+ * Add support for italic ansi code in themes+ * Fix centered titles not being centered (contribution by Hamza Haiken)+ - 0.8.0.0 (2018-08-31) * Themed border rendering improvements (contribution by Hamza Haiken) * Add support for margins (contribution by Hamza Haiken)
README.md view
@@ -431,7 +431,8 @@ patat: wrap: true theme:- emph: [vividBlue, onVividBlack, bold]+ emph: [vividBlue, onVividBlack, italic]+ strong: [bold] imageTarget: [onDullWhite, vividRed] ... @@ -451,13 +452,13 @@ The accepted styles are: -`bold`, `dullBlack`, `dullBlue`, `dullCyan`, `dullGreen`, `dullMagenta`,-`dullRed`, `dullWhite`, `dullYellow`, `onDullBlack`, `onDullBlue`, `onDullCyan`,-`onDullGreen`, `onDullMagenta`, `onDullRed`, `onDullWhite`, `onDullYellow`,-`onVividBlack`, `onVividBlue`, `onVividCyan`, `onVividGreen`, `onVividMagenta`,-`onVividRed`, `onVividWhite`, `onVividYellow`, `underline`, `vividBlack`,-`vividBlue`, `vividCyan`, `vividGreen`, `vividMagenta`, `vividRed`,-`vividWhite`, `vividYellow`+`bold`, `italic`, `dullBlack`, `dullBlue`, `dullCyan`, `dullGreen`,+`dullMagenta`, `dullRed`, `dullWhite`, `dullYellow`, `onDullBlack`,+`onDullBlue`, `onDullCyan`, `onDullGreen`, `onDullMagenta`, `onDullRed`,+`onDullWhite`, `onDullYellow`, `onVividBlack`, `onVividBlue`, `onVividCyan`,+`onVividGreen`, `onVividMagenta`, `onVividRed`, `onVividWhite`, `onVividYellow`,+`underline`, `vividBlack`, `vividBlue`, `vividCyan`, `vividGreen`,+`vividMagenta`, `vividRed`, `vividWhite`, `vividYellow` Also accepted are styles of the form `rgb#RrGgBb` and `onRgb#RrGgBb`, where `Rr` `Gg` and `Bb` are hexadecimal bytes (e.g. `rgb#f08000` for an orange foreground,@@ -470,7 +471,7 @@ As part of theming, syntax highlighting is also configurable. This can be configured like this: -```+```markdown --- patat: theme:
patat.cabal view
@@ -1,5 +1,5 @@ Name: patat-Version: 0.8.0.0+Version: 0.8.1.1 Synopsis: Terminal-based presentations using Pandoc Description: Terminal-based presentations using Pandoc License: GPL-2
src/Patat/Presentation/Display.hs view
@@ -110,11 +110,12 @@ prettyFragment theme fragment Just (ActiveTitle block) -> displayWithBorders pres $ \canvasSize theme ->- let pblock = prettyBlock theme block- (prows, pcols) = PP.dimensions pblock- offsetRow = (csRows canvasSize `div` 2) - (prows `div` 2)- offsetCol = (csCols canvasSize `div` 2) - (pcols `div` 2)- spaces = PP.NotTrimmable $ PP.spaces offsetCol in+ let pblock = prettyBlock theme block+ (prows, pcols) = PP.dimensions pblock+ (mLeft, mRight) = marginsOf pSettings+ offsetRow = (csRows canvasSize `div` 2) - (prows `div` 2)+ offsetCol = ((csCols canvasSize - mLeft - mRight) `div` 2) - (pcols `div` 2)+ spaces = PP.NotTrimmable $ PP.spaces offsetCol in mconcat (replicate (offsetRow - 3) PP.hardline) <$$> PP.indent spaces spaces pblock
src/Patat/Theme.hs view
@@ -200,6 +200,8 @@ sgrToString (Ansi.SetConsoleIntensity Ansi.BoldIntensity) = Just "bold" +sgrToString (Ansi.SetItalicized True) = Just "italic"+ sgrToString (Ansi.SetRGBColor layer color) = Just $ (\str -> case layer of Ansi.Foreground -> str@@ -231,7 +233,8 @@ , c <- [minBound .. maxBound] ] ++ [Ansi.SetUnderlining u | u <- [minBound .. maxBound]] ++- [Ansi.SetConsoleIntensity c | c <- [minBound .. maxBound]]+ [Ansi.SetConsoleIntensity c | c <- [minBound .. maxBound]] +++ [Ansi.SetItalicized i | i <- [minBound .. maxBound]] --------------------------------------------------------------------------------