readme.md 4.28 KB
Newer Older
Henrik Tramberend's avatar
Henrik Tramberend committed
1
2
[![build status](https://cgmgit.beuth-hochschule.de/teaching/decker/badges/master/build.svg)](https://cgmgit.beuth-hochschule.de/teaching/decker/commits/master)

Henrik Tramberend's avatar
Henrik Tramberend committed
3
4
5
6
# decker

A markdown based tool for slide deck creation.

7
8
## Installation

9
10
Pick a [published release](https://cgmgit.beuth-hochschule.de/teaching/decker/tags), download and unpack:

11
``` {.sh}
12
13
14
15
16
17
gunzip decker.gz
chmod a+x decker
```

## Installation from source

18
19
1.  Install [stack](https://docs.haskellstack.org/en/stable/README/).
2.  Clone this repo.
Henrik Tramberend's avatar
Henrik Tramberend committed
20
3.  `cd decker`
Henrik Tramberend's avatar
Henrik Tramberend committed
21
4.  `stack install`
22

Henrik Tramberend's avatar
Henrik Tramberend committed
23
24
## Usage

25
*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.
Henrik Tramberend's avatar
Henrik Tramberend committed
26

Henrik Tramberend's avatar
Henrik Tramberend committed
27
-   `*-deck.md`
Henrik Tramberend's avatar
Henrik Tramberend committed
28

29
    Files with this ending are processed as silde decks. From one source file potentially four different targets can be generated:
Henrik Tramberend's avatar
Henrik Tramberend committed
30
31

    -   `*-deck.html` A reveal.js based slide show
32
    -   `*-handout.hmtl` A HTML document containing the speaker notes to the slide show.
Henrik Tramberend's avatar
Henrik Tramberend committed
33
34
35
    -   `*-deck.pdf` A PDF version of the slide show
    -   `*-handout.pdf` A PDF version of the handout

Henrik Tramberend's avatar
Henrik Tramberend committed
36
-   `*-page.md`
Henrik Tramberend's avatar
Henrik Tramberend committed
37

38
    Markdown files ending on `*-page.md` are translated into corresponding HTML or PDF documents.
Henrik Tramberend's avatar
Henrik Tramberend committed
39
40
41

## *decker* targets

Henrik Tramberend's avatar
Henrik Tramberend committed
42
-   `decker help`
Henrik Tramberend's avatar
Henrik Tramberend committed
43

Henrik Tramberend's avatar
Henrik Tramberend committed
44
    Prints a help document to stdout in Markdown format.
Henrik Tramberend's avatar
Henrik Tramberend committed
45

Henrik Tramberend's avatar
Henrik Tramberend committed
46
47
48
49
50
-   `decker html`

    Builds HTML versions of all available documents.

-   `decker pdf`
Henrik Tramberend's avatar
Henrik Tramberend committed
51

Henrik Tramberend's avatar
Henrik Tramberend committed
52
    Builds PDF versions of all documents that are generated from `*-page.md` files.
Henrik Tramberend's avatar
Henrik Tramberend committed
53

Henrik Tramberend's avatar
Henrik Tramberend committed
54
55
56
-   `decker pdf-decks`

    Builds PDF versions of all slide decks (requires `decktape.sh`).
Henrik Tramberend's avatar
Henrik Tramberend committed
57

Henrik Tramberend's avatar
Henrik Tramberend committed
58
-   `decker watch`
Henrik Tramberend's avatar
Henrik Tramberend committed
59

60
    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`.
Henrik Tramberend's avatar
Henrik Tramberend committed
61

Henrik Tramberend's avatar
Henrik Tramberend committed
62
-   `decker server`
Henrik Tramberend's avatar
Henrik Tramberend committed
63

Henrik Tramberend's avatar
Henrik Tramberend committed
64
    Like `decker watch`. Additionally a local web server is started that serves the generated HTML files. The `*-deck.html` file is openend in the browser. Changed files are reloaded in the browser. (still requires `livereloadx`)
Henrik Tramberend's avatar
Henrik Tramberend committed
65

Henrik Tramberend's avatar
Henrik Tramberend committed
66
-   `decker example`
Henrik Tramberend's avatar
Henrik Tramberend committed
67

68
    Write a few example files to the current directory. To start exploring decker type
Henrik Tramberend's avatar
Henrik Tramberend committed
69
70
71
72
73
74

    ``` {.bash}
    $ decker example
    $ decker server
    ```

Henrik Tramberend's avatar
Henrik Tramberend committed
75
    and make some changes to the Markdown files. `example-deck.md` contains the source code for a slide deck that is supposed to (someday) explain most of the features supported.
Henrik Tramberend's avatar
Henrik Tramberend committed
76

Henrik Tramberend's avatar
Henrik Tramberend committed
77
-   `decker clean`
Henrik Tramberend's avatar
Henrik Tramberend committed
78
79

    Recursively removes all generated files from the current directory.
Henrik Tramberend's avatar
Henrik Tramberend committed
80

Henrik Tramberend's avatar
Henrik Tramberend committed
81
-   `decker check`
Henrik Tramberend's avatar
Henrik Tramberend committed
82

83
    Check for all required external depencies. If one of the programs is missing, an error is generated. Required programs include:
Henrik Tramberend's avatar
Henrik Tramberend committed
84
85
86
87
88
89

    -   `pdflatex` as part of a complete LaTeX installation
    -   `decktape.sh` for the generation of PDF versions of slide decks
    -   `livereloadx` as live-reloading local webserver
    -   `rsync` to publish the documents to a remote location

Henrik Tramberend's avatar
Henrik Tramberend committed
90
-   `decker plan`
Henrik Tramberend's avatar
Henrik Tramberend committed
91

Henrik Tramberend's avatar
Henrik Tramberend committed
92
93
    Prints a list of all source files found below the current directory.

Henrik Tramberend's avatar
Henrik Tramberend committed
94
-   `decker meta`
Henrik Tramberend's avatar
Henrik Tramberend committed
95

96
    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.
Henrik Tramberend's avatar
Henrik Tramberend committed
97

Henrik Tramberend's avatar
Henrik Tramberend committed
98
-   `decker publish`
Henrik Tramberend's avatar
Henrik Tramberend committed
99

100
    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.
Henrik Tramberend's avatar
Henrik Tramberend committed
101
102
103
104
105

## Contributions

### Pull requests

106
107
108
109
Contributions are accepted via pull requests. Before working on a feature, please write up an issue and discuss it with the other developers.

### CI build checks

Henrik Tramberend's avatar
Henrik Tramberend committed
110
The decker repository has a GitLab CI runner configured, that builds and runs all tests for each commit on every branch. Look at the status display for recent run of the [CI pipelines](pipelines).
111
112
113
114
115
116
117
118
119
120
121
122
123

### Haskell source code formatting

Haskell soure code readability depends heavily on consistent formatting conventions. With decker, formatting is automated using the excellent [hindent]() tool. Formatting is checked for each commit that is uploaded to the GitLab repository.

### Compilation and running

``` {.sh}
> stack setup
> stack build
> stack test
> stack exec decker
```