Skip to content

Commit

Permalink
Merge pull request #39 from DILCISBoard/feat/table-headings
Browse files Browse the repository at this point in the history
FEAT: Headings for requirement tables.
  • Loading branch information
carlwilson authored May 13, 2024
2 parents 2bc736a + 6f6a710 commit 76fe05f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ public String toString() {
public void serialise(final Writer destination, final boolean isPdf) throws IOException {
Utilities.serialiseToTemplate("eu/dilcis/csip/out/table_markdown.mustache",
Map.of("requirements", this.requirements, "caption", this.heading, "examples", this.examples, "pdf",
isPdf),
isPdf, "headed", isHeaded()),
destination);
}

@Override
public boolean isHeaded() {
return this.heading.startsWith("###");
}
}
4 changes: 4 additions & 0 deletions src/main/java/eu/dilcis/csip/structure/Source.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public final int hashCode() {
return Objects.hash(type, name, heading, label);
}

public boolean isHeaded() {
return false;
}

@Override
public final boolean equals(final Object obj) {
if (this == obj)
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/eu/dilcis/csip/out/table_markdown.mustache
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{{#headed}}
{{{ caption }}}

{{/headed}}
{{^pdf}}
| ID | Name, Location & Description | Card & Level |
| ------- | ---------------------------- | ------------ |
Expand Down

0 comments on commit 76fe05f

Please sign in to comment.