Skip to content

Commit

Permalink
use html
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 19, 2024
1 parent 2a55abc commit d98c0e1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
*/
public interface ModelDescriptor {

static final String TEXT_DESCRIPTION = ""
+ "Model name: %s" + System.lineSeparator()
+ "Model nickname: %s" + System.lineSeparator()
+ "Model description: %s" + System.lineSeparator()
+ "Model author(s): %s" + System.lineSeparator()
+ "Model citation: %s" + System.lineSeparator();
static final String TEXT_DESCRIPTION = "<html><body>"
+ "<h3>%s</h3>"
+ "<p><strong>Nickname:</strong> %s</p>"
+ "<p><strong>Description:</strong> %s</p>"
+ "</body></html>";

/**
* Create a set of specifications about the basic info of the model: name od the model, authors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,17 @@ public boolean canRunOnBioengine() {

@Override
public String buildInfo() {
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description, this.authors.toString(),
this.cite.toString());
String authorNames = "";
for (Author auth : this.authors) {
authorNames += " - " + auth.getName() + System.lineSeparator();
}
String citation = "";
for (Cite ci : this.cite) {
citation += " - " + ci.getText() + System.lineSeparator();
if (ci.getUrl() != null)
citation += " " + ci.getUrl() + System.lineSeparator();
}
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,17 @@ public boolean canRunOnBioengine() {

@Override
public String buildInfo() {
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description, this.authors.toString(),
this.cite.toString());
String authorNames = "";
for (Author auth : this.authors) {
authorNames += " - " + auth.getName() + System.lineSeparator();
}
String citation = "";
for (Cite ci : this.cite) {
citation += " - " + ci.getText() + System.lineSeparator();
if (ci.getUrl() != null)
citation += " " + ci.getUrl() + System.lineSeparator();
}
return String.format(TEXT_DESCRIPTION, this.name, this.getNickname(), this.description);
}

@Override
Expand Down

0 comments on commit d98c0e1

Please sign in to comment.