You don't have to install pandoc, the idea here is to set up a container with a shared volume so that you can use pandoc from a container.
This is to make it easy to convert their word docs to other formats (ex markdown) maps current working directory to the container so file must be in cwd, and uses either interactive or a config.pandoc file to determine what to convert.
- Uses pandoc core (alpine) as a base image https://hub.docker.com/r/pandoc/core
- Uses a shared volume to host the file to be converted (ex my.docx) and a config.pandoc file if using.
- Configured with help from https://github.com/pandoc/dockerfiles#basic-usage
- This images is in the docker hub organization dawsoncollege2020
- See the running it on windows
- Uses pandoc core image https://hub.docker.com/r/pandoc/core
If you use a config.pandoc file to indicate the (no spaces, if in file name use " ")
IN=filetoread
OUT=filetocreate
TYPE=conversion-type
- input file name
- output file name
- output file format
or
- Instead: a single option to put in the full options see pandoc for full syntax
See the supporting Dockerfile and the Makefile
Note If you are newly learning docker I strongly suggest you use the command line interface as it may be used anywhere: windoze, *nix, and cloud shells. No need to learn new interfaces every time.
- install docker https://docs.docker.com/install/
- on windows Drives are not automatically shared with Docker Desktop so you must change the settings before you start the container. see Windows one time prep
- cd to the directory that holds your doc to convert, & config.pandoc if you're using it.
docker run --rm --volume "%cd%:/data" -ti dawsoncollege2020/pandocker
- install docker https://docs.docker.com/install/
- on *nix you will need to add your user to the docker group to run as a regular user
sudo usermod -aG docker youruserid
- on *nix you will need to add your user to the docker group to run as a regular user
- cd to the directory that holds your doc to convert, & config.pandoc if you're using it.
docker run -ti --rm --volume "$(pwd):/data" dawsoncollege2020/pandocker
This image can be run interactively or using a file see example config.pandoc. If config.pandoc* exists, it will be used, if not it will be interactive, the script will ask for source, destination files and the conversion type.
- See *nix runtime example for complete information.
- See the windows how to for running on windows
Instructions also in docker hub for pandocker
You will first have to clone this repo and cd into this directory, the build assumes the Dockerfile is in the current working directory. check the Makefile for version info etc.
make build
make run