Commit 83539962 authored by Henrik Tramberend's avatar Henrik Tramberend
Browse files

Minor reformating and installation instructions

parent c73afd65
...@@ -46,7 +46,9 @@ main = do ...@@ -46,7 +46,9 @@ main = do
let everythingA = decksA <++> handoutsA <++> pagesA let everythingA = decksA <++> handoutsA <++> pagesA
let everythingPdfA = decksPdfA <++> handoutsPdfA <++> pagesPdfA let everythingPdfA = decksPdfA <++> handoutsPdfA <++> pagesPdfA
let cruft = let cruft =
map (combine projectDir) ["index.md.generated", "server.log", "//.shake"] map
(combine projectDir)
["index.md.generated", "server.log", "//.shake"]
context <- makeActionContext projectDir publicDir cacheDir supportDir context <- makeActionContext projectDir publicDir cacheDir supportDir
runShakeInContext context options $ runShakeInContext context options $
-- --
......
...@@ -2,28 +2,29 @@ ...@@ -2,28 +2,29 @@
A markdown based tool for slide deck creation. A markdown based tool for slide deck creation.
## Installation
1. Install [stack](https://docs.haskellstack.org/en/stable/README/).
2. Clone this repo.
3. `cd repo`
4. stack install
## Usage ## Usage
*decker* behaves very much like a build tool. It works recursively on the current *decker* behaves very much like a build tool. It works recursively on the current directory and all subdirectories. Markdown files ending on `.md` in those directories are processed and converted to either a reveal.js slide show, a HTML document, or a PDF document, depending on the file name.
directory and all subdirectories. Markdown files ending on `.md` in those
directories are processed and converted to either a reveal.js slide show, a HTML
document, or a PDF document, depending on the file name.
- `*-deck.md` - `*-deck.md`
Files with this ending are processed as silde decks. From one source file Files with this ending are processed as silde decks. From one source file potentially four different targets can be generated:
potentially four different targets can be generated:
- `*-deck.html` A reveal.js based slide show - `*-deck.html` A reveal.js based slide show
- `*-handout.hmtl` A HTML document containing the speaker notes to the - `*-handout.hmtl` A HTML document containing the speaker notes to the slide show.
slide show.
- `*-deck.pdf` A PDF version of the slide show - `*-deck.pdf` A PDF version of the slide show
- `*-handout.pdf` A PDF version of the handout - `*-handout.pdf` A PDF version of the handout
- `*-page.md` - `*-page.md`
Markdown files ending on `*-page.md` are translated into corresponding HTML Markdown files ending on `*-page.md` are translated into corresponding HTML or PDF documents.
or PDF documents.
## *decker* targets ## *decker* targets
...@@ -37,8 +38,7 @@ document, or a PDF document, depending on the file name. ...@@ -37,8 +38,7 @@ document, or a PDF document, depending on the file name.
- `decker pdf` - `decker pdf`
Builds PDF versions of all documents that are generated from Builds PDF versions of all documents that are generated from `*-deck.md` files.
`*-deck.md` files.
- `decker pdf-decks` - `decker pdf-decks`
...@@ -46,29 +46,22 @@ document, or a PDF document, depending on the file name. ...@@ -46,29 +46,22 @@ document, or a PDF document, depending on the file name.
- `decker watch` - `decker watch`
Builds HTML versions of all documents and then watches for document changes. Builds HTML versions of all documents and then watches for document changes. Each change to a watched document triggers a rebuild. Watching can be terminated with `^C`.
Each change to a watched document triggers a rebuild. Watching can be
terminated with `^C`.
- `decker server` - `decker server`
Like `decker watch`. Additionally a local web server is started that serves Like `decker watch`. Additionally a local web server is started that serves the generated HTML files. The `index.html` document is automatically openend in the browser. Changed files are automatically reloaded in the browser. (requires `livereloadx`)
the generated HTML files. The `index.html` document is automatically openend
in the browser. Changed files are automatically reloaded in the browser.
(requires `livereloadx`)
- `decker example` - `decker example`
Write a few example files to the current directory. To start exploring decker Write a few example files to the current directory. To start exploring decker type
type
``` {.bash} ``` {.bash}
$ decker example $ decker example
$ decker server $ decker server
``` ```
and make some changes to the Markdown files. `example-deck.md` contains the and make some changes to the Markdown files. `example-deck.md` contains the source code for a slide deck that explains most of the features supported.
source code for a slide deck that explains most of the features supported.
- `decker clean` - `decker clean`
...@@ -76,8 +69,7 @@ document, or a PDF document, depending on the file name. ...@@ -76,8 +69,7 @@ document, or a PDF document, depending on the file name.
- `decker check` - `decker check`
Check for all required external depencies. If one of the programs is missing, Check for all required external depencies. If one of the programs is missing, an error is generated. Required programs include:
an error is generated. Required programs include:
- `pdflatex` as part of a complete LaTeX installation - `pdflatex` as part of a complete LaTeX installation
- `decktape.sh` for the generation of PDF versions of slide decks - `decktape.sh` for the generation of PDF versions of slide decks
...@@ -90,13 +82,8 @@ document, or a PDF document, depending on the file name. ...@@ -90,13 +82,8 @@ document, or a PDF document, depending on the file name.
- `decker meta` - `decker meta`
Pretty prints all meta data that can be found in `*.yaml` files in the Pretty prints all meta data that can be found in `*.yaml` files in the current directory and below. Meta data is mainly used to perform substitutions in Markdown documents using the Mustache templating system.
current directory and below. Meta data is mainly used to perform
substitutions in Markdown documents using the Mustache templating system.
- `decker publish` - `decker publish`
Publish the generated files to a remote location using `rsync` if the Publish the generated files to a remote location using `rsync` if the location is specified in the meta data. The keys `rsync-destination.host` and `rsync-destination.path` specify the publishing destination.
location is specified in the meta data. The keys `rsync-destination.host` and
`rsync-destination.path` specify the publishing destination.
...@@ -307,7 +307,7 @@ cacheImageIO ...@@ -307,7 +307,7 @@ cacheImageIO
:: String -> FilePath -> IO () :: String -> FilePath -> IO ()
cacheImageIO uri cacheDir = cacheImageIO uri cacheDir =
do request <- parseRequest uri do request <- parseRequest uri
result <- httpLBS $ request result <- httpLBS request
let body = getResponseBody result let body = getResponseBody result
let cacheFile = cacheDir </> escapeToFilePath uri let cacheFile = cacheDir </> escapeToFilePath uri
createDirectoryIfMissing True cacheDir createDirectoryIfMissing True cacheDir
......
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