From 848500dbf2556f0d5ce162d8080378920fef84a0 Mon Sep 17 00:00:00 2001 From: Ryan Ahearn Date: Wed, 11 Sep 2024 08:47:15 -0400 Subject: [PATCH] Document how to use pandoc to generate pdf and html versions --- README.md | 12 +++++++++++- compose.yaml | 47 ++++++----------------------------------------- 2 files changed, 17 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index d505cb0..0a1a1da 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,20 @@ Edit the files within `ssp-markdown` to populate data for the rendered SSP that ### Render SSP -Output the SSP as a markdown file and html file, both within `ssp-render` +Output the SSP as a markdown file within `./ssp-render` `render-ssp` +You can optionally use pandoc to transform the markdown file into a variety of formats. For example: + +#### PDF + +`docker run --rm --volume "/dir/with/rendered_ssp.md:/data" pandoc/latex rendered_ssp.md -o your-pdf-file-name.pdf` + +#### HTML + +`docker run --rm --volume "/dir/with/rendered_ssp.md:/data" pandoc/latex rendered_ssp.md -s -o your-html-file-name.html --metadata title="SSP Title"` + ### Import profile into working space: If you are using a `PROFILE_NAME` that does not ship with this docker container then you must first manually import it using: diff --git a/compose.yaml b/compose.yaml index 368fc90..2e78163 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,12 +1,3 @@ -# Comments are provided throughout this file to help you get started. -# If you need more help, visit the Docker Compose reference guide at -# https://docs.docker.com/go/compose-spec-reference/ - -# Here the instructions define your application as a service called "cli". -# This service is built from the Dockerfile in the current directory. -# You can add other services your application may depend on here, such as a -# database or a cache. For examples, see the Awesome Compose repository: -# https://github.com/docker/awesome-compose services: cli: build: @@ -15,35 +6,9 @@ services: - ./working_dir:/app/docs - ./templates:/app/templates -# The commented out section below is an example of how to define a PostgreSQL -# database that your application can use. `depends_on` tells Docker Compose to -# start the database before your application. The `db-data` volume persists the -# database data between container restarts. The `db-password` secret is used -# to set the database password. You must create `db/password.txt` and add -# a password of your choosing to it before running `docker compose up`. -# depends_on: -# db: -# condition: service_healthy -# db: -# image: postgres -# restart: always -# user: postgres -# secrets: -# - db-password -# volumes: -# - db-data:/var/lib/postgresql/data -# environment: -# - POSTGRES_DB=example -# - POSTGRES_PASSWORD_FILE=/run/secrets/db-password -# expose: -# - 5432 -# healthcheck: -# test: [ "CMD", "pg_isready" ] -# interval: 10s -# timeout: 5s -# retries: 5 -# volumes: -# db-data: -# secrets: -# db-password: -# file: db/password.txt + # a helper pandoc just to easily properly set the volume for local testing. + # use with `docker compose run --rm pandoc ` + pandoc: + image: pandoc/latex + volumes: + - ./working_dir/ssp-render:/data