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

FEAT: Headings for requirement tables. #39

Merged
merged 2 commits into from
May 13, 2024
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
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
Loading