Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add erd support #166

Merged
merged 4 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
73 changes: 73 additions & 0 deletions tests/fixtures/sample-with-diagram.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
----