diff --git a/Dockerfile b/Dockerfile index 4bbe1eb3..6a2e9838 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,8 @@ ENV ASCIIDOCTOR_VERSION=${asciidoctor_version} \ ASCIIDOCTOR_MATHEMATICAL_VERSION=${asciidoctor_mathematical_version} \ ASCIIDOCTOR_REVEALJS_VERSION=${asciidoctor_revealjs_version} \ KRAMDOWN_ASCIIDOC_VERSION=${kramdown_asciidoc_version} \ - ASCIIDOCTOR_BIBTEX_VERSION=${asciidoctor_bibtex_version} + ASCIIDOCTOR_BIBTEX_VERSION=${asciidoctor_bibtex_version} \ + PATH="/root/.cabal/bin/:${PATH}" # Installing package required for the runtime of # any of the asciidoctor-* functionnalities @@ -88,6 +89,24 @@ RUN apk add --no-cache --virtual .pythonmakedepends \ seqdiag \ && apk del -r --no-cache .pythonmakedepends +# ERD +RUN apk add --no-cache --virtual .haskellmakedepends \ + alpine-sdk \ + cabal \ + ghc-dev \ + ghc \ + gmp-dev \ + gnupg \ + libffi-dev \ + linux-headers \ + perl-utils \ + wget \ + xz \ + zlib-dev \ + && cabal v2-update \ + && cabal v2-install erd \ + && apk del -r --no-cache .haskellmakedepends + WORKDIR /documents VOLUME /documents diff --git a/README.adoc b/README.adoc index 00e1a44e..58fa5dcb 100644 --- a/README.adoc +++ b/README.adoc @@ -11,7 +11,7 @@ GitHub renders asciidoctor natively, but DockerHub does not (it needs markdown). This Docker image provides: * https://asciidoctor.org/[Asciidoctor] 2.0.12 -* https://asciidoctor.org/docs/asciidoctor-diagram/[Asciidoctor Diagram] 2.0.5 with Graphviz integration (supports plantuml and graphiz diagrams) +* https://asciidoctor.org/docs/asciidoctor-diagram/[Asciidoctor Diagram] 2.0.5 with ERD and Graphviz integration (supports plantuml and graphiz diagrams) * https://asciidoctor.org/docs/asciidoctor-pdf/[Asciidoctor PDF] 1.5.3 * https://asciidoctor.org/docs/asciidoctor-epub3/[Asciidoctor EPUB3] 1.5.0.alpha.19 * https://github.com/asciidoctor/asciidoctor-mathematical[Asciidoctor Mathematical] 0.3.4 diff --git a/README.md b/README.md index cb25cef3..c1ec2913 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This Docker image provides: - [Asciidoctor](https://asciidoctor.org/) 2.0.12 -- [Asciidoctor Diagram](https://asciidoctor.org/docs/asciidoctor-diagram/) 2.0.5 with Graphviz integration (supports plantuml and graphiz diagrams) +- [Asciidoctor Diagram](https://asciidoctor.org/docs/asciidoctor-diagram/) 2.0.5 with ERD and Graphviz integration (supports plantuml and graphiz diagrams) - [Asciidoctor PDF](https://asciidoctor.org/docs/asciidoctor-pdf/) 1.5.3 diff --git a/tests/fixtures/sample-with-diagram.adoc b/tests/fixtures/sample-with-diagram.adoc index 5ca6645e..08dc41b0 100644 --- a/tests/fixtures/sample-with-diagram.adoc +++ b/tests/fixtures/sample-with-diagram.adoc @@ -133,3 +133,76 @@ rackdiag { } } ---- + +=== ERD +https://github.com/BurntSushi/erd + +[erd, erd-1, svg] +---- +title {label: "nfldb Entity-Relationship diagram (condensed)", size: "20"} +# Entities +[player] {bgcolor: "#d0e0d0"} + *player_id {label: "varchar, not null"} + full_name {label: "varchar, null"} + team {label: "varchar, not null"} + position {label: "player_pos, not null"} + status {label: "player_status, not null"} +[team] {bgcolor: "#d0e0d0"} + *team_id {label: "varchar, not null"} + city {label: "varchar, not null"} + name {label: "varchar, not null"} +[game] {bgcolor: "#ececfc"} + *gsis_id {label: "gameid, not null"} + start_time {label: "utctime, not null"} + week {label: "usmallint, not null"} + season_year {label: "usmallint, not null"} + season_type {label: "season_phase, not null"} + finished {label: "boolean, not null"} + home_team {label: "varchar, not null"} + home_score {label: "usmallint, not null"} + away_team {label: "varchar, not null"} + away_score {label: "usmallint, not null"} +[drive] {bgcolor: "#ececfc"} + *+gsis_id {label: "gameid, not null"} + *drive_id {label: "usmallint, not null"} + start_field {label: "field_pos, null"} + start_time {label: "game_time, not null"} + end_field {label: "field_pos, null"} + end_time {label: "game_time, not null"} + pos_team {label: "varchar, not null"} + pos_time {label: "pos_period, null"} +[play] {bgcolor: "#ececfc"} + *+gsis_id {label: "gameid, not null"} + *+drive_id {label: "usmallint, not null"} + *play_id {label: "usmallint, not null"} + time {label: "game_time, not null"} + pos_team {label: "varchar, not null"} + yardline {label: "field_pos, null"} + down {label: "smallint, null"} + yards_to_go {label: "smallint, null"} +[play_player] {bgcolor: "#ececfc"} + *+gsis_id {label: "gameid, not null"} + *+drive_id {label: "usmallint, not null"} + *+play_id {label: "usmallint, not null"} + *+player_id {label: "varchar, not null"} + team {label: "varchar, not null"} +[meta] {bgcolor: "#fcecec"} + version {label: "smallint, null"} + season_type {label: "season_phase, null"} + season_year {label: "usmallint, null"} + week {label: "usmallint, null"} +# Relationships +player *--1 team +game *--1 team {label: "home"} +game *--1 team {label: "away"} +drive *--1 team +play *--1 team +play_player *--1 team +game 1--* drive +game 1--* play +game 1--* play_player +drive 1--* play +drive 1--* play_player +play 1--* play_player +player 1--* play_player +----