8000 add markdown conversion to html and run current tests by denis-yuen · Pull Request #6093 · dockstore/dockstore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add markdown conversion to html and run current tests #6093

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

Merged
merged 1 commit into from
Apr 4, 2025
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. 8000
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion THIRD-PARTY-LICENSES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Lists of 333 third-party dependencies.
Lists of 334 third-party dependencies.
(Apache License, Version 2.0) akka-actor (com.typesafe.akka:akka-actor_2.13:2.5.32 - https://akka.io/)
(Apache License, Version 2.0) akka-protobuf (com.typesafe.akka:akka-protobuf_2.13:2.5.32 - https://akka.io/)
(Apache License, Version 2.0) akka-slf4j (com.typesafe.akka:akka-slf4j_2.13:2.5.32 - https://akka.io/)
Expand Down Expand Up @@ -94,6 +94,7 @@ Lists of 333 third-party dependencies.
(The MIT License (MIT)) ClassGraph (io.github.classgraph:classgraph:4.8.154 - https://github.com/classgraph/classgraph)
(Apache License, Version 2.0) ClassMate (com.fasterxml:classmate:1.7.0 - https://github.com/FasterXML/java-classmate)
(The Apache License, Version 2.0) com.helger:profiler (com.helger:profiler:1.1.1 - https://github.com/phax/profiler)
(BSD-2-Clause) commonmark-java core (org.commonmark:commonmark:0.24.0 - https://github.com/commonmark/commonmark-java/commonmark)
(The Apache Software License, Version 2.0) Commons Digester (commons-digester:commons-digester:2.1 - http://commons.apache.org/digester/)
(BSD-3-Clause) commons-compiler (org.codehaus.janino:commons-compiler:3.1.7 - http://janino-compiler.github.io/commons-compiler/)
(Apache License 2.0) compiler (com.github.spullara.mustache.java:compiler:0.9.14 - http://github.com/spullara/mustache.java)
Expand Down
5 changes: 5 additions & 0 deletions bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,11 @@ POM as their parent.
<artifactId>bcprov-ext-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>org.commonmark</groupId>
<artifactId>commonmark</artifactId>
<version>0.24.0</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
6 changes: 6 additions & 0 deletions dockstore-webservice/generated/src/main/resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,12 @@
<version>2.18.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.commonmark</groupId>
<artifactId>commonmark</artifactId>
<version>0.24.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
Expand Down
4 changes: 4 additions & 0 deletions dockstore-webservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,10 @@
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.commonmark</groupId>
<artifactId>commonmark</artifactId>
</dependency>
</dependencies>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.hc.client5.http.classic.HttpClient;
import org.apache.http.HttpStatus;
import org.commonmark.node.Node;
import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;
import org.hibernate.SessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -671,6 +674,15 @@ private static void fillInMetadata(DepositMetadata depositMetadata,
String description = workflow.getDescription();
// The Zenodo API requires at description of at least three characters
String descriptionStr = (description == null || description.isEmpty()) ? "No description specified" : workflow.getDescription();


// convert from Markdown to HTML (feels weird but plain text from (e.g.) WDL descriptors should remain unmolested even if not Markdown)
// most descriptions are just READMEs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda makes me wonder if, someday, we should track the source (README, descriptor file, etc) or type (plain text, markdown, html) of the description.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parser parser = Parser.builder().build();
Node document = parser.parse(descriptionStr);
HtmlRenderer renderer = HtmlRenderer.builder().build();
descriptionStr = renderer.render(document);

depositMetadata.setDescription(descriptionStr);

// We will set the Zenodo workflow version publication date to the date of the DOI issuance
Expand Down
Loading
0