Skip to content

Instantly share code, notes, and snippets.

@g0t4
Last active Jan 18, 2017
Embed
What would you like to do?
docker cli usefulness -> converting ascii art into nice images - > nice workflow for creating visuals and flexible outputs with asciidoctor in a container
#!/bin/bash
wget https://gist.githubusercontent.com/g0t4/c4d382b0aa0b15ed3454f501d2102500/raw/c39c6662fa15e4ad9c842eae9e2724dd1810d7eb/table.adoc
# this docker image comes preloaded with many extensions! https://hub.docker.com/r/asciidoctor/docker-asciidoctor/~/dockerfile/
# docs for asciidoctor-diagram extension http://asciidoctor.org/docs/asciidoctor-diagram/
# volume mount for current working directory, to ready table.adoc and write resultant output file
# function to hide away the docker run and volume plumbing, treat like it is installed locally :)
asciidoctor() { docker run --rm -v $(pwd):/documents asciidoctor/docker-asciidoctor asciidoctor "$@" ; }
# asciidoctor --help
asciidoctor -r asciidoctor-diagram table.adoc
             Prevent - decrease probability.                       Feelings are a separate
             Mitigate - decrease severity if it happens.           dimension that dictate the
             Insure - pass on the cost.                            relevance of the other two
                                                                   dimensions accordingly:

                               Severity                                  Feelings

                    H             M             L
             +-------------+-------------+-------------+              +-------------+
             |             |             |             |              |             |
             |             |             |             |              | S & P are   |
           H |   Prevent   |   Mitigate  | Known Cost  |            H | Irrelevant  |
      P      |             |             |             |              |             |
      r      |             |             |             |              |             |
      o      +-----------------------------------------+              +-------------+
      b      |             |             |             |              |             |
      a      |             |             |             |              |             |
      b    M |   Mitigate  |             |   Ignore    |            M |   Skewed    |
      i      |             |             |             |              |             |
      l      |             |             |             |              |             |
      i      +-----------------------------------------+              +-------------+
      t      |             |             |             |              |             |
      y      |             |             |             |              |             |
           L |   Insure    |   Ignore    |             |            L |  Relevant   |
             |             |             |             |              |             |
             |             |             |             |              |             |
             +-------------+-------------+-------------+              +-------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment