slick-1.0.1.1: A quick & easy static site builder built with shake and pandoc.

Copyright(c) Chris Penner 2019
LicenseBSD3
Safe HaskellNone
LanguageHaskell2010

Slick

Contents

Description

 
Synopsis

Slick

This module re-exports the basics you need to run slick. For more complex tasks look into Slick.Pandoc.

To get started use the Slick Template.

Basics

slick :: Action () -> IO () Source #

Build your slick site. This is a good candidate for your main function.

Calls through to shakeArgsForward with extra verbosity

slickWithOpts :: ShakeOptions -> Action () -> IO () Source #

Build your slick site with the provided shake options. This is a good candidate for your main function.

| Calls through to shakeArgsForward with the provided options

markdownToHTML :: Text -> Action Value Source #

Convert markdown text into a Value;

The Value has a "content" key containing rendered HTML.

Metadata is assigned on the respective keys in the Value

markdownToHTML' :: FromJSON a => Text -> Action a Source #

Like markdownToHTML but allows returning any JSON serializable object

Mustache Templating

compileTemplate' :: FilePath -> Action Template Source #

Like compileTemplate from mustache but tracks changes to template files and partials within Shake for cache-busting.

substitute :: ToMustache k => Template -> k -> Text #

Substitutes all mustache defined tokens (or tags) for values found in the provided data structure.

Equivalent to substituteValue . toMustache.

Utils

getDirectoryPaths Source #

Arguments

:: [FilePath]

file pattern like *.md

-> [FilePath]

directories to look at

-> Action [FilePath] 

Given a list of extensions and directories, find all files that match, and return full paths.

convert :: (FromJSON a, ToJSON a, FromJSON b) => a -> Action b Source #

Attempt to convert between two JSON serializable objects (or Values). Failure to deserialize fails the Shake build.