diff --git a/HelloWorld.hs b/HelloWorld.hs index d8588c5..177d648 100644 --- a/HelloWorld.hs +++ b/HelloWorld.hs @@ -23,10 +23,10 @@ stepShape :: Double -> Diagram B stepShape x = rect 0.95 0.4 # showOrigin # named x startShape :: Double -> Diagram B -startShape x = text "hello" <> roundedRect 0.95 0.4 0.5 # showOrigin # named x +startShape x = text "start" # fontSize (local 0.1) # light # font "courier" <> roundedRect 0.95 0.4 0.5 # showOrigin # named x endShape :: Double -> Diagram B -endShape = startShape +endShape x = text "end" # fontSize (local 0.1) # thinWeight # font "courier" <> roundedRect 0.95 0.4 0.5 # showOrigin # named x uniqueName :: Double -> Double -> Double uniqueName x y = x * 10 + (abs y) diff --git a/README.md b/README.md index 099e215..4d515e8 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,12 @@ ## development environment -* start - `./start.sh` +* start - `./host.sh` * exit - `exit` ## hello world -* `cabal update` -* `cabal install --lib diagrams` -* `cabal install --lib diagrams-lib` -* `cabal install --lib diagrams-svg` -* `cabal install --lib base` -* `ghc HelloWorld.hs` -* `./HelloWorld -o hello-world.svg -w 400` +* `ghc HelloWorld.hs && ./HelloWorld -o hello-world.svg -w 400` ![hello-world](./hello-world.svg) diff --git a/dockerfile b/dockerfile index 2034230..c88e11a 100644 --- a/dockerfile +++ b/dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.19.1 -WORKDIR "/root/code/drakon" +WORKDIR "/root/code/drakon-renderer" RUN \ apk update \ @@ -13,6 +13,17 @@ RUN \ g++ \ ghc \ cabal && \ - git config --global --add safe.directory "/root/code/drakon" + git config --global --add safe.directory "/root/code/drakon-renderer" + +RUN \ + cabal update \ + && \ + cabal install --lib diagrams \ + && \ + cabal install --lib diagrams-lib \ + && \ + cabal install --lib diagrams-svg \ + && \ + cabal install --lib base CMD [ "/bin/sh" ] diff --git a/hello-world.svg b/hello-world.svg index 320e0ab..3cede66 100644 --- a/hello-world.svg +++ b/hello-world.svg @@ -1,3 +1,3 @@ hellohello \ No newline at end of file + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">endstart \ No newline at end of file diff --git a/start.sh b/host.sh similarity index 84% rename from start.sh rename to host.sh index b4d40bd..1371f53 100755 --- a/start.sh +++ b/host.sh @@ -9,6 +9,6 @@ docker buildx build \ && \ docker run \ -it \ - -v "$(pwd):/root/code/drakon" \ + -v "$(pwd):/root/code/drakon-renderer" \ -v "$CERTIFICATE_DIRECTORY:/root/.ssh:ro" \ "drakon-renderer:latest"