diff --git a/.drone.yml b/.drone.yml index 876d85d..a5119a0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,8 +7,6 @@ steps: image: plugins/docker settings: repo: ldericher/autodoc - context: src - dockerfile: src/Dockerfile auto_tag: true username: from_secret: DOCKER_USERNAME diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8bac3cb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM pandoc/extra:latest + +RUN set -ex; \ + \ + apk add --no-cache \ + bash \ + inotify-tools \ + make \ + ; + +COPY src/usr /usr + +WORKDIR /docs +ENTRYPOINT ["autodoc"] +CMD ["-bw"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..de98246 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +image_tag = ldericher/autodoc +docker_build = docker build +docker_run = docker run --rm -it +examples_flags = -v "$(shell pwd)/examples:/docs" -u "$(shell id -u):$(shell id -g)" + +.PHONY: default +default: + $(info use other targets: image build watch shell clean) + +.PHONY: image +image: + $(docker_build) --tag $(image_tag) ./ + +.PHONY: build +build: image + $(docker_run) $(examples_flags) $(image_tag) -b + +.PHONY: watch +watch: image + $(docker_run) $(examples_flags) $(image_tag) + +.PHONY: shell +shell: image + $(docker_run) $(examples_flags) --entrypoint ash $(image_tag) + +.PHONY: clean +clean: + git clean -xdf ./examples \ No newline at end of file diff --git a/README.md b/README.md index cf32205..f5f8f0e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ In general, any file-sharing solution -- preferably on top of `docker-compose` - ## Quick Start Guide using Docker -The `autodoc` image [available on Docker Hub](https://hub.docker.com/r/ldericher/autodoc) is based on [pandocker](https://hub.docker.com/r/ldericher/pandocker) providing Ubuntu's TeXlive `LaTeX` and `pandoc` in a simple box. +The `autodoc` image [available on Docker Hub](https://hub.docker.com/r/ldericher/autodoc) is based on [pandoc/extra](https://hub.docker.com/r/pandoc/extra) providing TeXlive `LaTeX` and `pandoc` in a container. 01. Install [Docker CE](https://docs.docker.com/install/) @@ -18,7 +18,7 @@ The `autodoc` image [available on Docker Hub](https://hub.docker.com/r/ldericher ```bash docker run --rm -it \ - --volume "${PWD}":/docs \ + --volume "${PWD}:/docs" \ --user "$(id -u):$(id -g)" \ ldericher/autodoc ``` @@ -58,7 +58,6 @@ services: - documents:/opt/autodoc autodoc: - restart: always image: ldericher/autodoc user: "UID:GID" volumes: diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 7f5fb2e..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: "2" - -services: - autodoc: - restart: "no" - - image: ldericher/autodoc - build: - context: ./src - - command: "bash" - - volumes: - - "${PWD}/src/usr/local/bin/autodoc:/usr/local/bin/autodoc:ro" - - "${PWD}/src/usr/local/lib/autodoc:/usr/local/lib/autodoc:ro" - - "${PWD}/examples:/docs" diff --git a/examples/eisvogel/.gitignore b/examples/eisvogel/.gitignore new file mode 100644 index 0000000..a136337 --- /dev/null +++ b/examples/eisvogel/.gitignore @@ -0,0 +1 @@ +*.pdf diff --git a/examples/eisvogel/Makefile b/examples/eisvogel/Makefile new file mode 100644 index 0000000..24b0fe1 --- /dev/null +++ b/examples/eisvogel/Makefile @@ -0,0 +1,8 @@ +#%SRCPAT% \.url$ + +.PHONY: all +all: eisvogel.pdf + +.PHONY: eisvogel.pdf +eisvogel.pdf: document.md.url + wget -O- '$(file < $<)' | pandoc -s -f markdown -t latex -o $@ --template eisvogel diff --git a/examples/eisvogel/document.md.url b/examples/eisvogel/document.md.url new file mode 100644 index 0000000..08edf3e --- /dev/null +++ b/examples/eisvogel/document.md.url @@ -0,0 +1 @@ +https://raw.githubusercontent.com/Wandmalfarbe/pandoc-latex-template/master/examples/basic-example/document.md diff --git a/examples/simple md/simple.md b/examples/simple md/simple.md index 8f8c5f1..fd3dfc2 100644 --- a/examples/simple md/simple.md +++ b/examples/simple md/simple.md @@ -15,7 +15,7 @@ Behold, for there is jumbled mess ahead! With the default HTML template, this does not translate: \textsl{Have some \LaTeX, too!} Some math is fine with HTML: $x=5$, some other is not: $\sqrt{x}=2$. -However, both of these are fixable! +However, both of these work with the `--webtex` switch for pandoc! Code blocks? Sure! diff --git a/src/Dockerfile b/src/Dockerfile deleted file mode 100644 index c9180e1..0000000 --- a/src/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ldericher/pandocker:latest - -RUN set -ex; \ - apt-get update && apt-get -y install \ - inotify-tools \ - ; rm -rf /var/lib/apt/lists/*; - -COPY usr /usr - -CMD ["autodoc", "-bw"]