Commit 86279ace authored by Henrik Tramberend's avatar Henrik Tramberend

Replaced internal SCSS compiler with external tool

The use of libsass.dso somehow prevented GHCi to compile and run decker.
That in turn made using of intero impossible. Which is not an option.
parent faebbae4
......@@ -25,7 +25,6 @@ import Text.Groom
import qualified Text.Mustache as M ()
import Text.Pandoc ()
import Text.Printf ()
import qualified Text.Sass as Sass
import Utilities
main :: IO ()
......@@ -172,14 +171,7 @@ main = do
exists <- doesFileExist src
when exists $ do
need [src]
putNormal ("# scss (for " ++ makeRelativeTo projectDir out ++ ")")
scss <- liftIO $ readFile src
result <- liftIO $ Sass.compileString scss Sass.def
case result of
Left err -> do
msg <- liftIO $ Sass.errorMessage err
throw (SassException msg)
Right css -> liftIO $ writeFile out css
sassc [src, out]
--
phony "clean" $ do
removeFilesAfter publicDir ["//"]
......
......@@ -42,7 +42,6 @@ executable decker
build-depends: base
, Glob
, HTTP
, hsass
, aeson
, ansi-terminal
, array
......
......@@ -27,6 +27,7 @@ chmod a+x decker
Decker uses a few external tools that need to be installed on the system:
- [*ssh*](https://www.openssh.com) for publishing slide decks and resources
- [*rsync*](http://formulae.brew.sh/repos/Homebrew/homebrew-core/formula/rsync)
for publishing slide decks and resources
- [*unzip*](http://formulae.brew.sh/repos/Homebrew/homebrew-core/formula/unzip)
......@@ -39,13 +40,14 @@ Decker uses a few external tools that need to be installed on the system:
- [*Gnuplot*](http://gnuplot.sourceforge.net) to generate graphs using `dot`
- [*pdf2svg*](https://github.com/dawbarton/pdf2svg) to generate SVG files from
PDF documents
- [*sassc*](https://github.com/sass/sassc) to compile SCSS to CSS
### Installation of external tools on macOS
Use [Homebrew](https://brew.sh) to install most of them.
``` {.sh}
brew install rsync unzip graphviz gnuplot pdf2svg
brew install rsync unzip graphviz gnuplot pdf2svg sassc
```
For the rest follow instructions on their respective webites.
......
......@@ -8,6 +8,7 @@ module External
, pdflatex
, pdf2svg
, decktape
, sassc
, checkExternalPrograms
) where
......@@ -91,6 +92,14 @@ programs =
[]
(helpText
"Decktape PDF exporter (https://github.com/astefanutti/decktape)"))
, ( "sassc"
, ExternalProgram
[]
"sassc"
["--style", "nested"]
["-v"]
(helpText
"Decktape PDF exporter (https://github.com/astefanutti/decktape)"))
]
type Program = ([String] -> Action ())
......@@ -119,6 +128,9 @@ pdf2svg = makeProgram "pdf2svg"
decktape :: Program
decktape = makeProgram "decktape"
sassc :: Program
sassc = makeProgram "sassc"
helpText :: String -> String
helpText name =
"The " ++
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment