diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..f4681beed55791aef416dc5921b4556166466c07 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.git/ +.gitignore +.dockerignore +*.md +*.dot +*.pdf +example/ +*.swp +Dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b26d23684e3e0d59528ead5c823ff595c8aeb440 --- /dev/null +++ b/.gitignore @@ -0,0 +1,48 @@ +~* +*~ +*.sw[op] +*.py[cod] +.DS_Store +__pycache__/ +.vagrant/ +vendor/ +Thumbs.db +*.retry +.svn/ +.sass-cache/ +*.log +*.out +*.so +node_modules/ +.npm/ +nbproject/ +*.ipynb +.idea/ +*.egg-info/ +*.[ao] +.classpath +.cache/ +bower_components/ +*.class +*.[ewj]ar +secring.* +.*.kate-swp +.swp.* +.directory +.Trash-* +build/ +_build/ +dist/ +.tox/ +*.pdf +*.exe +*.dll +*.gz +*.tgz +*.tar +*.rar +*.zip +*.pid +*.lock +*.env +.bundle/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cc2f8ce1e04fc7d348eb73993479d965d34925ff --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM golang:1.9-alpine as on-change +RUN apk --update add git && \ + rm -rf /var/cache/apk/* && \ + /usr/local/go/bin/go get github.com/spelufo/on-change + +FROM debian:stretch-slim +COPY --from=on-change /go/bin/on-change /usr/local/bin +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + graphviz \ + lmodern \ + make \ + pandoc \ + sudo \ + texlive-extra-utils \ + texlive-fonts-recommended \ + texlive-font-utils \ + texlive-latex-base \ + texlive-latex-extra \ + texlive-luatex && \ + rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /var/cache/apt/archives/* +VOLUME /project +WORKDIR /project +COPY entrypoint /entrypoint +ENTRYPOINT ["/entrypoint"] +CMD ["on-change", ".", "make"] diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..21f83f94ebe311f9f78caffc53a72d754f703e2a --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Adar Nimrod + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..314e6758af19890303718e1a09703c6220a81ceb --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# Presentation + +A Dockerized presentation toolkit for building presentation from markup (like +Markdown or DOT). + +## Usage + +`docker run -itv "$PWD:/project" adarnimrod/presentation` + +Will watch the current directory and run `make` whenever a file changes. One can +add a shell alias `alias presentation='docker run -itv "$PWD:/project" +adarnimrod/presentation'` for easier use. + +See the example folder for more details. + +## Contains + +- [Pandoc](http://pandoc.org/) +- [Graphviz](www.graphviz.org/) +- [GNU Make](https://www.gnu.org/software/make/) +- [LuaTex](http://luatex.org/) +- [LaTeX](http://www.latex-project.org/) +- [on-change](https://github.com/spelufo/on-change) + +## License + +This software is licensed under the MIT license (see `LICENSE.txt`). + +## Author Information + +Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my [website]( +https://www.shore.co.il/). Patches are welcome via [`git send-email`]( +http://git-scm.com/book/en/v2/Git-Commands-Email). The repository is located +at: <https://www.shore.co.il/git/>. diff --git a/entrypoint b/entrypoint new file mode 100755 index 0000000000000000000000000000000000000000..167520ccbe93ec7a72a6f957e0f3f51d58f12022 --- /dev/null +++ b/entrypoint @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +uid="$(stat . --format '%u')" +gid="$(stat . --format '%g')" +sudo -Eu "#$uid" -g "#$gid" -- "$@" diff --git a/example/.gitignore b/example/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a1363379944a5745ceb49c0e493d80eb9335c79a --- /dev/null +++ b/example/.gitignore @@ -0,0 +1 @@ +*.pdf diff --git a/example/Makefile b/example/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..f8d561fe69a2617ecc15a34313ba9b8d7825037d --- /dev/null +++ b/example/Makefile @@ -0,0 +1,12 @@ +.PHONY: all clean + +all: presentation.pdf + +presentation.pdf: diagram.pdf + pandoc -t beamer presentation.md -o presentation.pdf + +diagram.pdf: diagram.dot + dot diagram.dot -Tpdf > diagram.pdf + +clean: + - rm *.pdf diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000000000000000000000000000000000000..405b8c79f43e0e7e2fe3e07f7c7c00acf3bf0107 --- /dev/null +++ b/example/README.md @@ -0,0 +1,14 @@ +# Example presentation + +An example presentation written in Markdown and DOT. + +## Usage + +To watch the current directory and build the presentation whenever a change +occurs + +`docker run -tv "$PWD:/project" adarnimrod/presentation` + +To build the presentation and exit + +`docker run -tv "$PWD:/project" adarnimrod/presentation make` diff --git a/example/diagram.dot b/example/diagram.dot new file mode 100644 index 0000000000000000000000000000000000000000..db306e108ea3d0b30a464dd77720a803d31d9163 --- /dev/null +++ b/example/diagram.dot @@ -0,0 +1,3 @@ +digraph Diagram { + "Point A" -> "Point B" [label="Route"] +} diff --git a/example/presentation.md b/example/presentation.md new file mode 100644 index 0000000000000000000000000000000000000000..af2336d5497e91d9065a91b6f1ca9e77f8a16944 --- /dev/null +++ b/example/presentation.md @@ -0,0 +1,15 @@ +--- +title: Presentation +author: Your name here +... + +# Section + +## Heading + +- Bullet point. +- Another bullet point. + +## Diagram + +