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

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 ...@@ -25,7 +25,6 @@ import Text.Groom
import qualified Text.Mustache as M () import qualified Text.Mustache as M ()
import Text.Pandoc () import Text.Pandoc ()
import Text.Printf () import Text.Printf ()
import qualified Text.Sass as Sass
import Utilities import Utilities
main :: IO () main :: IO ()
...@@ -172,14 +171,7 @@ main = do ...@@ -172,14 +171,7 @@ main = do
exists <- doesFileExist src exists <- doesFileExist src
when exists $ do when exists $ do
need [src] need [src]
putNormal ("# scss (for " ++ makeRelativeTo projectDir out ++ ")") sassc [src, 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
-- --
phony "clean" $ do phony "clean" $ do
removeFilesAfter publicDir ["//"] removeFilesAfter publicDir ["//"]
......
...@@ -42,7 +42,6 @@ executable decker ...@@ -42,7 +42,6 @@ executable decker
build-depends: base build-depends: base
, Glob , Glob
, HTTP , HTTP
, hsass
, aeson , aeson
, ansi-terminal , ansi-terminal
, array , array
......
...@@ -27,6 +27,7 @@ chmod a+x decker ...@@ -27,6 +27,7 @@ chmod a+x decker
Decker uses a few external tools that need to be installed on the system: 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) - [*rsync*](http://formulae.brew.sh/repos/Homebrew/homebrew-core/formula/rsync)
for publishing slide decks and resources for publishing slide decks and resources
- [*unzip*](http://formulae.brew.sh/repos/Homebrew/homebrew-core/formula/unzip) - [*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: ...@@ -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` - [*Gnuplot*](http://gnuplot.sourceforge.net) to generate graphs using `dot`
- [*pdf2svg*](https://github.com/dawbarton/pdf2svg) to generate SVG files from - [*pdf2svg*](https://github.com/dawbarton/pdf2svg) to generate SVG files from
PDF documents PDF documents
- [*sassc*](https://github.com/sass/sassc) to compile SCSS to CSS
### Installation of external tools on macOS ### Installation of external tools on macOS
Use [Homebrew](https://brew.sh) to install most of them. Use [Homebrew](https://brew.sh) to install most of them.
``` {.sh} ``` {.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. For the rest follow instructions on their respective webites.
......
...@@ -8,6 +8,7 @@ module External ...@@ -8,6 +8,7 @@ module External
, pdflatex , pdflatex
, pdf2svg , pdf2svg
, decktape , decktape
, sassc
, checkExternalPrograms , checkExternalPrograms
) where ) where
...@@ -91,6 +92,14 @@ programs = ...@@ -91,6 +92,14 @@ programs =
[] []
(helpText (helpText
"Decktape PDF exporter (https://github.com/astefanutti/decktape)")) "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 ()) type Program = ([String] -> Action ())
...@@ -119,6 +128,9 @@ pdf2svg = makeProgram "pdf2svg" ...@@ -119,6 +128,9 @@ pdf2svg = makeProgram "pdf2svg"
decktape :: Program decktape :: Program
decktape = makeProgram "decktape" decktape = makeProgram "decktape"
sassc :: Program
sassc = makeProgram "sassc"
helpText :: String -> String helpText :: String -> String
helpText name = helpText name =
"The " ++ "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