readme.md 5.72 KB
Newer Older
Henrik Tramberend's avatar
Henrik Tramberend committed
1 2
[![pipeline status](https://gitlab2.informatik.uni-wuerzburg.de/decker/decker/badges/master/pipeline.svg)](https://gitlab2.informatik.uni-wuerzburg.de/decker/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
Pick a [published release](), download and unpack:
10

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`
21
4.  `make install`
22

Henrik Tramberend's avatar
Henrik Tramberend committed
23 24 25 26
## External tools

Decker uses a few external tools that need to be installed on the system:

27
-   [*ssh*](https://www.openssh.com) for publishing slide decks and resources
28 29 30 31 32 33 34 35 36 37 38 39
-   [*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)
    to extract resources from the decker executable
-   [*decktape*](https://github.com/astefanutti/decktape) to convert HTML slide
    decks to PDF format
-   [*LaTeX* with pdflatex](https://www.latex-project.org) to generate LaTeX in
    PDF-files and embedded Tikz figures
-   [*Graphviz*](http://graphviz.org) 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
    PDF documents
40
-   [*sassc*](https://github.com/sass/sassc) to compile SCSS to CSS
41
-   *libbzip2-dev*
42 43 44 45 46 47

### Installation of external tools on macOS

Use [Homebrew](https://brew.sh) to install most of them.

``` {.sh}
48
brew install rsync unzip graphviz gnuplot pdf2svg sassc
49 50 51 52
```

For the rest follow instructions on their respective webites.

Henrik Tramberend's avatar
Henrik Tramberend committed
53 54
## Usage

55 56 57 58
*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
59

Henrik Tramberend's avatar
Henrik Tramberend committed
60
-   `*-deck.md`
Henrik Tramberend's avatar
Henrik Tramberend committed
61

62 63
    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
64 65

    -   `*-deck.html` A reveal.js based slide show
66 67
    -   `*-handout.hmtl` A HTML document containing the speaker notes to the
        slide show.
Henrik Tramberend's avatar
Henrik Tramberend committed
68 69 70
    -   `*-deck.pdf` A PDF version of the slide show
    -   `*-handout.pdf` A PDF version of the handout

Henrik Tramberend's avatar
Henrik Tramberend committed
71
-   `*-page.md`
Henrik Tramberend's avatar
Henrik Tramberend committed
72

73 74
    Markdown files ending on `*-page.md` are translated into corresponding HTML
    or PDF documents.
Henrik Tramberend's avatar
Henrik Tramberend committed
75

76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
### Docker container

We provide prebuild docker containers. You may use them in a directory to build the html slides with 

```
docker run --rm -it -v `pwd`:/decker -p 8888:8888 gitlab2.informatik.uni-wuerzburg.de:4567/decker/decker html
```

or for Windows

```
docker run --rm -it -v %cd%:/decker -p 8888:8888 gitlab2.informatik.uni-wuerzburg.de:4567/decker/decker html
```

Exchange the `html` at the end of the command with your *decker* command of choice. Beware that file updates are not propagated into the container so `decker server` will not auto refresh.

Henrik Tramberend's avatar
Henrik Tramberend committed
92 93
## *decker* targets

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

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

Henrik Tramberend's avatar
Henrik Tramberend committed
98 99 100 101 102
-   `decker html`

    Builds HTML versions of all available documents.

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

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

Henrik Tramberend's avatar
Henrik Tramberend committed
107 108 109
-   `decker pdf-decks`

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

Henrik Tramberend's avatar
Henrik Tramberend committed
111
-   `decker watch`
Henrik Tramberend's avatar
Henrik Tramberend committed
112

113 114 115
    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
116

Henrik Tramberend's avatar
Henrik Tramberend committed
117
-   `decker server`
Henrik Tramberend's avatar
Henrik Tramberend committed
118

119 120 121
    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
122

Henrik Tramberend's avatar
Henrik Tramberend committed
123
-   `decker example`
Henrik Tramberend's avatar
Henrik Tramberend committed
124

125 126
    Write a few example files to the current directory. To start exploring
    decker type
Henrik Tramberend's avatar
Henrik Tramberend committed
127 128 129 130 131 132

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

133 134 135
    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
136

Henrik Tramberend's avatar
Henrik Tramberend committed
137
-   `decker clean`
Henrik Tramberend's avatar
Henrik Tramberend committed
138 139

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

Henrik Tramberend's avatar
Henrik Tramberend committed
141
-   `decker plan`
Henrik Tramberend's avatar
Henrik Tramberend committed
142

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

Henrik Tramberend's avatar
Henrik Tramberend committed
145
-   `decker meta`
Henrik Tramberend's avatar
Henrik Tramberend committed
146

147 148 149
    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
150

Henrik Tramberend's avatar
Henrik Tramberend committed
151
-   `decker publish`
Henrik Tramberend's avatar
Henrik Tramberend committed
152

153 154 155
    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
156 157 158 159 160

## Contributions

### Pull requests

161
Contributions are accepted via pull requests. Before working on a feature,
162 163 164
please write up an issue and discuss it with the other developers. 
For each implemented feature, increment the version number in `package.yaml`. 
Breaking changes increment the second number. Fixes increment the third number.
165 166 167

### CI build checks

168 169 170
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).
171 172 173

### Haskell source code formatting

174 175 176 177
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.