diff --git a/.github/workflows/on_release_update_readme.yml b/.github/workflows/on_release_update_readme.yml index d4e66311..5ef454be 100644 --- a/.github/workflows/on_release_update_readme.yml +++ b/.github/workflows/on_release_update_readme.yml @@ -4,22 +4,22 @@ on: types: - published # It seems that you can publish directly witout creating jobs: - replace_version_in_README: + replace_version: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Modify version number in README - uses: mingjun97/file-regex-replace@master + uses: vyan024/file-regex-replace-2023 with: regex: '=[0-9]+\.[0-9]+\.[0-9]+ ' replacement: '=${{ github.event.release.tag_name }} ' include: '^README\.md' # Optional, defaults to ".*" - name: Modify version number in release action - uses: mingjun97/file-regex-replace@master + uses: vyan024/file-regex-replace-2023 with: - regex: '=[0-9]+\.[0-9]+\.[0-9]+ ' + regex: '"[0-9]+\.[0-9]+\.[0-9]+"' replacement: '=${{ github.event.release.tag_name }} ' - include: '^\.github\/workflows\/on_release_perform_maven_release\.yml' # Optional, defaults to ".*" + include: '^\.github\/workflows\/on_workflow_dispatch_perform_maven_release\.yml' # Optional, defaults to ".*" - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: @@ -35,7 +35,4 @@ jobs: title: '🤖 Update readme version to ${{ github.event.release.tag_name }}' body: | This pull request has been generated by run of GitHub action ".github/workflows/on_release_update_readme.yml" - team-reviewers: | - owners - maintainers draft: false \ No newline at end of file diff --git a/.github/workflows/on_tag_generate_release_notes.yml b/.github/workflows/on_tag_generate_release_notes.yml index 7e6f0c94..494e4fae 100644 --- a/.github/workflows/on_tag_generate_release_notes.yml +++ b/.github/workflows/on_tag_generate_release_notes.yml @@ -1,14 +1,15 @@ -name: On tag created generate GitHub release notes +name: On tag created generate GitHub release with notes on: push: tags: - '[0-9]+.[0-9]+.[0-9]+' + jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Generate release notes - uses: raulanatol/github-actions-releaser@main + - uses: lakto/gren-action@v2.0.0 env: - GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_GITHUB }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + options: '--override' \ No newline at end of file diff --git a/.github/workflows/on_release_perform_maven_release.yml b/.github/workflows/on_workflow_dispatch_perform_maven_release.yml similarity index 94% rename from .github/workflows/on_release_perform_maven_release.yml rename to .github/workflows/on_workflow_dispatch_perform_maven_release.yml index 97e6dfaa..86ef6776 100644 --- a/.github/workflows/on_release_perform_maven_release.yml +++ b/.github/workflows/on_workflow_dispatch_perform_maven_release.yml @@ -1,13 +1,7 @@ # This workflow will build a Java project with Maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -name: On GitHub Release perform equivalent maven release - -#on: -# release: -# types: -# - created -# - published +name: On workflow dispatch start maven release on: workflow_dispatch: @@ -15,7 +9,7 @@ on: releaseversion: description: 'Release version' required: true - default: '0.1.10' + default: "0.1.11" jobs: build: diff --git a/README.md b/README.md index 9aad53bf..2b72accb 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can use the archetype by running this maven-friendly 😅command. Current version is ![GitHub version](https://badge.fury.io/gh/Riduidel%2Faadarchi.svg) ```sh -mvn archetype:generate -DarchetypeVersion=0.1.10 -Daadarchi-version=0.1.10 -DarchetypeGroupId=io.github.Riduidel.aadarchi -DarchetypeArtifactId=archetype +mvn archetype:generate -DarchetypeVersion=0.1.11 -Daadarchi-version=0.1.11 -DarchetypeGroupId=io.github.Riduidel.aadarchi -DarchetypeArtifactId=archetype ``` This will ask you a few questions and generate the project. diff --git a/aadarchi-maven-plugin/pom.xml b/aadarchi-maven-plugin/pom.xml index 3fad3248..13f05dcd 100644 --- a/aadarchi-maven-plugin/pom.xml +++ b/aadarchi-maven-plugin/pom.xml @@ -3,7 +3,7 @@ system io.github.Riduidel.aadarchi - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT 4.0.0 diff --git a/aadarchi-test-utils/pom.xml b/aadarchi-test-utils/pom.xml index f6daab21..0a2ba2fd 100644 --- a/aadarchi-test-utils/pom.xml +++ b/aadarchi-test-utils/pom.xml @@ -3,9 +3,9 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT - Aadarchi: test utilities + Aadarchi : test utilities aadarchi-test-utils Some test utilities dedicated to the improvement of Aadarchi quality. Mainly contains tools allowing easy injection of Maven properties into tests diff --git a/adr-tickets-extractor/pom.xml b/adr-tickets-extractor/pom.xml index 003ead2f..578c79e1 100644 --- a/adr-tickets-extractor/pom.xml +++ b/adr-tickets-extractor/pom.xml @@ -3,7 +3,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT adr-tickets-extractor Aadarchi : ADR ticket extractor diff --git a/archetype/pom.xml b/archetype/pom.xml index 7d65ae08..8f1baa07 100644 --- a/archetype/pom.xml +++ b/archetype/pom.xml @@ -4,7 +4,7 @@ io.github.Riduidel.aadarchi system - 0.1.10 + 0.1.12-SNAPSHOT archetype maven-archetype diff --git a/architecture-documentation/pom.xml b/architecture-documentation/pom.xml index fcb706dc..30720e5a 100644 --- a/architecture-documentation/pom.xml +++ b/architecture-documentation/pom.xml @@ -1,237 +1,237 @@ - - 4.0.0 - - system - io.github.Riduidel.aadarchi - 0.1.11-SNAPSHOT - - architecture-documentation - Aadarchi : System documentation generator - Using Aadarchi to document agile archiecture documentation system - - 11 - UTF-8 - UTF-8 - highlightjs - org.ndx.aadarchi.base.ArchitectureDocumentationBuilder - - - - - https://github.com/Riduidel/aadarchi/issues - - - - - io.github.Riduidel.aadarchi - base - ${project.version} - - - io.github.Riduidel.aadarchi - structurizr-components-detector - ${project.version} - - - io.github.Riduidel.aadarchi - sipoc-diagram-generator - ${project.version} - - - io.github.Riduidel.aadarchi - github-scm-handler - ${project.version} - - - io.github.Riduidel.aadarchi - adr-tickets-extractor - ${project.version} - - - io.github.Riduidel.aadarchi - model-linter - ${project.version} - - - org.junit.jupiter - junit-jupiter-api - - - org.junit.jupiter - junit-jupiter-engine - - - - org.jboss.weld - weld-junit5 - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${maven.compiler.release} - - - - org.apache.maven.plugins - maven-release-plugin - - true - true - -Dasciidoc.documents.hide.bug.report=true - settings-aadarchi,release - - - - - - - ${project.groupId} - aadarchi-maven-plugin - ${project.version} - - - - generate-model - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${version.java} - - - - - - - - generate-docs - - - src/docs/asciidoc - - - - ${project.build.directory}/asciidoc/docs - - - - package - - - ${project.groupId} - aadarchi-maven-plugin - ${project.version} - - - generate-html-doc - package - - generate-html-docs - - - - generate-pdf-doc - package - - generate-pdf-docs - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - package - - attach-artifact - - - - - ${project.build.directory}/asciidoc/docs/pdf/index.pdf - pdf - documentation - - - - - - - - - - - - - generate-slides - - - src/slides/asciidoc - - - - - - ${project.groupId} - aadarchi-maven-plugin - ${project.version} - - - generate-html-slides - package - - generate-html-slides - - - - - - - - - - livereload - - package - - - ${project.groupId} - aadarchi-maven-plugin - ${project.version} - - - generate-html-slides - package - - livereload - - - - - - - - + + 4.0.0 + + system + io.github.Riduidel.aadarchi + 0.1.12-SNAPSHOT + + architecture-documentation + Aadarchi : System documentation generator + Using Aadarchi to document agile archiecture documentation system + + 11 + UTF-8 + UTF-8 + highlightjs + org.ndx.aadarchi.base.ArchitectureDocumentationBuilder + + + + + https://github.com/Riduidel/aadarchi/issues + + + + + io.github.Riduidel.aadarchi + base + ${project.version} + + + io.github.Riduidel.aadarchi + structurizr-components-detector + ${project.version} + + + io.github.Riduidel.aadarchi + sipoc-diagram-generator + ${project.version} + + + io.github.Riduidel.aadarchi + github-scm-handler + ${project.version} + + + io.github.Riduidel.aadarchi + adr-tickets-extractor + ${project.version} + + + io.github.Riduidel.aadarchi + model-linter + ${project.version} + + + org.junit.jupiter + junit-jupiter-api + + + org.junit.jupiter + junit-jupiter-engine + + + + org.jboss.weld + weld-junit5 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${maven.compiler.release} + + + + org.apache.maven.plugins + maven-release-plugin + + true + true + -Dasciidoc.documents.hide.bug.report=true + settings-aadarchi,release + + + + + + + ${project.groupId} + aadarchi-maven-plugin + ${project.version} + + + + generate-model + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${version.java} + + + + + + + + generate-docs + + + src/docs/asciidoc + + + + ${project.build.directory}/asciidoc/docs + + + + package + + + ${project.groupId} + aadarchi-maven-plugin + ${project.version} + + + generate-html-doc + package + + generate-html-docs + + + + generate-pdf-doc + package + + generate-pdf-docs + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + package + + attach-artifact + + + + + ${project.build.directory}/asciidoc/docs/pdf/index.pdf + pdf + documentation + + + + + + + + + + + + + generate-slides + + + src/slides/asciidoc + + + + + + ${project.groupId} + aadarchi-maven-plugin + ${project.version} + + + generate-html-slides + package + + generate-html-slides + + + + + + + + + + livereload + + package + + + ${project.groupId} + aadarchi-maven-plugin + ${project.version} + + + generate-html-slides + package + + livereload + + + + + + + + \ No newline at end of file diff --git a/architecture-documentation/src/architecture/resources/workspace.dsl b/architecture-documentation/src/architecture/resources/workspace.dsl index 5c5fd959..20c90dee 100644 --- a/architecture-documentation/src/architecture/resources/workspace.dsl +++ b/architecture-documentation/src/architecture/resources/workspace.dsl @@ -9,13 +9,13 @@ workspace "aadarchi-documentation-system" { "aadarchi.maven.pom" "pom.xml" } maven = container "maven" "The maven build engine" "java, maven" - aadarchi_maven_plugin = container "aadarchi-maven-plugin" "" "java, maven-plugin"{ + aadarchi_maven_plugin = container "aadarchi-maven-plugin" { properties { "aadarchi.sequence.generator.with" "true" } maven -> this "Invokes this plugin during build to generate data" } - aadarchi_base = container "base" "" "Java, CDI" { + aadarchi_base = container "base"{ properties { "aadarchi.sequence.generator.with" "true" } @@ -24,7 +24,7 @@ workspace "aadarchi-documentation-system" { aadarchi_maven_plugin -> this } archetype_6 = container "archetype" "" "maven" - architecture_documentation = container "architecture-documentation" "" "java, maven, structurizr, asciidoc" + architecture_documentation = container "architecture-documentation" } person_architect -> archetype_6 "Bootstrap a valid project" person_architect -> maven "Generates documentation" diff --git a/base/pom.xml b/base/pom.xml index 1a401018..12875d79 100644 --- a/base/pom.xml +++ b/base/pom.xml @@ -1,98 +1,98 @@ - - 4.0.0 - - system - io.github.Riduidel.aadarchi - 0.1.11-SNAPSHOT - - base - Aadarchi : Base module - Base module defining the various used interfaces, and some very useful implementations - jar - - - jakarta.enterprise - jakarta.enterprise.cdi-api - - - org.jboss.weld.se - weld-se-core - - - com.structurizr - structurizr-annotations - - - com.structurizr - structurizr-client - - - - com.fasterxml.jackson.core - jackson-annotations - - - - - com.structurizr - structurizr-dsl - - - com.structurizr - structurizr-export - - - ${project.groupId} - cdi-config-extension - ${project.version} - - - ${project.groupId} - markdown-to-asciidoc - ${project.version} - - - commons-io - commons-io - - - org.apache.commons - commons-lang3 - - - org.apache.commons - commons-text - 1.10.0 - - - com.pivovarit - throwing-function - - - org.junit.jupiter - junit-jupiter-api - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.assertj - assertj-core - test - - - org.jboss.weld - weld-junit5 - test - - - ${project.groupId} - aadarchi-test-utils - ${project.version} - test - - + + 4.0.0 + + system + io.github.Riduidel.aadarchi + 0.1.12-SNAPSHOT + + base + Aadarchi : Base module + Base module defining the various used interfaces, and some very useful implementations + jar + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + org.jboss.weld.se + weld-se-core + + + com.structurizr + structurizr-annotations + + + com.structurizr + structurizr-client + + + + com.fasterxml.jackson.core + jackson-annotations + + + + + com.structurizr + structurizr-dsl + + + com.structurizr + structurizr-export + + + ${project.groupId} + cdi-config-extension + ${project.version} + + + ${project.groupId} + MarkdownToAsciidoc + ${project.version} + + + commons-io + commons-io + + + org.apache.commons + commons-lang3 + + + org.apache.commons + commons-text + 1.10.0 + + + com.pivovarit + throwing-function + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.assertj + assertj-core + test + + + org.jboss.weld + weld-junit5 + test + + + ${project.groupId} + aadarchi-test-utils + ${project.version} + test + + \ No newline at end of file diff --git a/base/src/main/java/org/ndx/aadarchi/base/enhancers/scm/ReadmeReader.java b/base/src/main/java/org/ndx/aadarchi/base/enhancers/scm/ReadmeReader.java index a9e46ea5..cfe51f83 100644 --- a/base/src/main/java/org/ndx/aadarchi/base/enhancers/scm/ReadmeReader.java +++ b/base/src/main/java/org/ndx/aadarchi/base/enhancers/scm/ReadmeReader.java @@ -1,13 +1,11 @@ package org.ndx.aadarchi.base.enhancers.scm; -import java.util.logging.Logger; - -import javax.enterprise.inject.Instance; -import javax.inject.Inject; - +import com.kodcu.asciidocfx.MarkdownToAsciidoc; +import com.structurizr.annotation.Component; +import com.structurizr.model.Element; +import com.structurizr.model.StaticStructureElement; import org.apache.commons.io.IOUtils; import org.apache.commons.vfs2.FileObject; -import org.apache.commons.vfs2.FileSystemManager; import org.apache.commons.vfs2.filter.RegexFileFilter; import org.apache.deltaspike.core.api.config.ConfigProperty; import org.ndx.aadarchi.base.AgileArchitectureSection; @@ -18,11 +16,8 @@ import org.ndx.aadarchi.base.utils.StructurizrUtils; import org.ndx.aadarchi.base.utils.commonsvfs.FileObjectDetector; -import com.structurizr.annotation.Component; -import com.structurizr.model.Element; -import com.structurizr.model.StaticStructureElement; - -import nl.jworks.markdown_to_asciidoc.Converter; +import javax.inject.Inject; +import java.util.logging.Logger; /** * Collect each model element readme and output them in generated elements folder @@ -80,7 +75,7 @@ void writeReadmeFor(FileObject readme, Element element, OutputBuilder builder) { // location String readmeText = IOUtils.toString(cache.openStreamFor(readme), "UTF-8"); if (readme.getName().getExtension().toLowerCase().equals("md")) { - readmeText = Converter.convertMarkdownToAsciiDoc(readmeText); + readmeText = MarkdownToAsciidoc.convert(readmeText); } builder.writeToOutput(AgileArchitectureSection.code, element, this, Format.adoc, readmeText); } finally { diff --git a/base/src/main/java/org/ndx/aadarchi/base/utils/AsciidocProducer.java b/base/src/main/java/org/ndx/aadarchi/base/utils/AsciidocProducer.java index b059feb1..8eaf2d14 100644 --- a/base/src/main/java/org/ndx/aadarchi/base/utils/AsciidocProducer.java +++ b/base/src/main/java/org/ndx/aadarchi/base/utils/AsciidocProducer.java @@ -1,9 +1,8 @@ package org.ndx.aadarchi.base.utils; +import com.kodcu.asciidocfx.MarkdownToAsciidoc; import org.ndx.aadarchi.base.AgileArchitectureException; -import nl.jworks.markdown_to_asciidoc.Converter; - public class AsciidocProducer { public static class UnableToGetAsciidocFrom extends AgileArchitectureException { @@ -15,8 +14,7 @@ public UnableToGetAsciidocFrom(String message) { private String asAsciidoc(String filename, String content) { if(filename.endsWith(".md")) { - return Converter.convertMarkdownToAsciiDoc( - content); + return MarkdownToAsciidoc.convert(content); } else if(filename.endsWith(".adoc")) { return content; } else { diff --git a/cdi-config-extension/pom.xml b/cdi-config-extension/pom.xml index 98776b60..4ce94a1e 100644 --- a/cdi-config-extension/pom.xml +++ b/cdi-config-extension/pom.xml @@ -3,7 +3,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT cdi-config-extension Aadarchi : CDI Config extension diff --git a/cdi-in-maven-plugin-helper/pom.xml b/cdi-in-maven-plugin-helper/pom.xml index 708166f4..146db9c4 100644 --- a/cdi-in-maven-plugin-helper/pom.xml +++ b/cdi-in-maven-plugin-helper/pom.xml @@ -3,7 +3,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT cdi-in-maven-plugin-helper Aadarchi : CDI in Maven helper diff --git a/github-scm-handler/pom.xml b/github-scm-handler/pom.xml index 86717846..f64c5cc8 100644 --- a/github-scm-handler/pom.xml +++ b/github-scm-handler/pom.xml @@ -3,7 +3,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT github-scm-handler Aadarchi : GitHub SCM handler @@ -21,7 +21,7 @@ ${project.groupId} - markdown-to-asciidoc + MarkdownToAsciidoc ${project.version} diff --git a/github-scm-handler/src/main/java/org/ndx/aadarchi/github/GitHubComment.java b/github-scm-handler/src/main/java/org/ndx/aadarchi/github/GitHubComment.java index ccbe721c..64767d01 100644 --- a/github-scm-handler/src/main/java/org/ndx/aadarchi/github/GitHubComment.java +++ b/github-scm-handler/src/main/java/org/ndx/aadarchi/github/GitHubComment.java @@ -2,12 +2,11 @@ import java.io.IOException; import java.util.Date; +import com.kodcu.asciidocfx.MarkdownToAsciidoc; import org.kohsuke.github.GHIssueComment; import org.ndx.aadarchi.base.enhancers.tickets.Comment; -import nl.jworks.markdown_to_asciidoc.Converter; - public class GitHubComment implements Comment { private GHIssueComment source; @@ -26,7 +25,7 @@ public Date getDate() { @Override public String getText() { - return Converter.convertMarkdownToAsciiDoc(source.getBody()); + return MarkdownToAsciidoc.convert(source.getBody()); } } diff --git a/github-scm-handler/src/main/java/org/ndx/aadarchi/github/GitHubTicket.java b/github-scm-handler/src/main/java/org/ndx/aadarchi/github/GitHubTicket.java index 1a71b0c4..b14afb99 100644 --- a/github-scm-handler/src/main/java/org/ndx/aadarchi/github/GitHubTicket.java +++ b/github-scm-handler/src/main/java/org/ndx/aadarchi/github/GitHubTicket.java @@ -1,17 +1,16 @@ package org.ndx.aadarchi.github; -import java.io.IOException; -import java.util.Collection; -import java.util.Date; -import java.util.Optional; -import java.util.stream.Collectors; - +import com.kodcu.asciidocfx.MarkdownToAsciidoc; import org.kohsuke.github.GHIssue; import org.ndx.aadarchi.base.enhancers.tickets.Comment; import org.ndx.aadarchi.base.enhancers.tickets.Ticket; import org.ndx.aadarchi.base.enhancers.tickets.TicketStatus; -import nl.jworks.markdown_to_asciidoc.Converter; +import java.io.IOException; +import java.util.Collection; +import java.util.Date; +import java.util.Optional; +import java.util.stream.Collectors; public class GitHubTicket implements Ticket { @@ -33,7 +32,7 @@ public String getTitle() { @Override public String getText() { - return Converter.convertMarkdownToAsciiDoc(source.getBody()); + return MarkdownToAsciidoc.convert(source.getBody()); } @Override diff --git a/github-vfs/pom.xml b/github-vfs/pom.xml index 42d9dc07..c3aa02a0 100644 --- a/github-vfs/pom.xml +++ b/github-vfs/pom.xml @@ -4,7 +4,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT github-vfs Aadarchi : GitHub virtual file system diff --git a/gitlab-scm-handler/pom.xml b/gitlab-scm-handler/pom.xml index 721e383f..741d03e9 100644 --- a/gitlab-scm-handler/pom.xml +++ b/gitlab-scm-handler/pom.xml @@ -3,7 +3,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT gitlab-scm-handler Aadarchi : Gitlab SCM Handler diff --git a/gitlab-vfs/pom.xml b/gitlab-vfs/pom.xml index 92c8a76b..79056064 100644 --- a/gitlab-vfs/pom.xml +++ b/gitlab-vfs/pom.xml @@ -3,7 +3,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT gitlab-vfs Aadarchi : GitLab virtual file system diff --git a/markdown-to-asciidoc/CONTRIBUTING.adoc b/markdown-to-asciidoc/CONTRIBUTING.adoc deleted file mode 100644 index 98543d2d..00000000 --- a/markdown-to-asciidoc/CONTRIBUTING.adoc +++ /dev/null @@ -1,14 +0,0 @@ -This module is a fork of https://github.com/bodiam/markdown-to-asciidoc created to allow it to be used in entrerprisey contexts. - -**Do not** contribute to this module, but rather to upstream project. - -To retrieve code, run the command - -> mvn generate-sources -pl :markdown-to-asciidoc -Pdownload - -It will download source code (and README file), but won't manage dependencies, so you may have errors to fix. - -IMPORTANT: WE DO NOT USE Kotlin here, so all kotlin code has been replaced by equivalent Java code. -Why? -Because the cost of foreign syntax doesn't pay when there is only one 18 KB file! -As a consequence, there is one error in `Converter.java` which can be fixed by simply replacing the Kotlin converter by the Java one. \ No newline at end of file diff --git a/markdown-to-asciidoc/README.adoc b/markdown-to-asciidoc/README.adoc deleted file mode 100644 index e9f91a73..00000000 --- a/markdown-to-asciidoc/README.adoc +++ /dev/null @@ -1,50 +0,0 @@ -= Markdown to AsciiDoc converter - -image:https://badges.gitter.im/Join%20Chat.svg[link="https://gitter.im/bodiam/markdown-to-asciidoc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"] - -image:https://travis-ci.org/bodiam/markdown-to-asciidoc.svg["Build Status", link="https://travis-ci.org/bodiam/markdown-to-asciidoc"] - -A small, lightweight converter for Markdown to http://www.asciidoc.org[AsciiDoc] written in Java, and based on http://pegdown.org[Pegdown]. - -Uses https://github.com/bodiam/markdown-to-asciidoc/tree/master/src/test/resources/nl/jworks/markdown_to_asciidoc[Cucumber tests] as a reusable -set to test conversion between Markdown and AsciiDoc. - -== Features - -Currently, the following are supported by the Markdown to AsciiDoc converter: - -* Code blocks -* Definition lists -* Headings -* Lines -* Links -* Lists (ordered, unordered, nested, mixed) -* Basic markup (bold, italic, monospaced, etc) -* Tables (including alignments) - -Also, currently known *not* supported items are: - -* Table cell spanning - -== Usage - -Add the following dependency to your project: - -`nl.jworks.markdown_to_asciidoc:markdown_to_asciidoc:1.0` - -To use the library, call the following: - -`assertEquals("= Title", Converter.convertMarkdownToAsciiDoc("# Title"));` - -The Converter converts all Markdown input to AsciiDoc. - -== Uses - -Currently the conversion library is used in the https://plugins.jetbrains.com/plugin/7391[IntelliJ AsciiDoc Plugin] to seamlessly convert between -from Markdown to AsciiDoc. - -If you know of any projects using the library, please let me know on Twitter: http://www.twitter.com/epragt[@epragt]. - -== Bugs - -If you find a bug or a missing feature, please report it the https://github.com/bodiam/markdown-to-asciidoc/issues[Github Issue Tracker]. diff --git a/markdown-to-asciidoc/pom.xml b/markdown-to-asciidoc/pom.xml deleted file mode 100644 index f4b6f3ae..00000000 --- a/markdown-to-asciidoc/pom.xml +++ /dev/null @@ -1,115 +0,0 @@ - - 4.0.0 - - io.github.Riduidel.aadarchi - system - 0.1.11-SNAPSHOT - - markdown-to-asciidoc - Markdown to Asciidoc converter - This project is a fork of https://github.com/bodiam/markdown-to-asciidoc to avoid depending upon Jitpack (which prevents usage in legacy companies) - - - 7.2.3 - - - - - org.pegdown - pegdown - 1.6.0 - - - org.jsoup - jsoup - ${version.jsoup} - - - - io.cucumber - cucumber-java - ${cucumber.version} - test - - - io.cucumber - cucumber-picocontainer - ${cucumber.version} - test - - - io.cucumber - cucumber-junit - ${cucumber.version} - test - - - junit - junit - 4.13.2 - test - - - org.apache.commons - commons-io - 1.3.2 - test - - - - - - download - - ${project.build.directory}/zipped - - - - - com.googlecode.maven-download-plugin - download-maven-plugin - 1.6.7 - - - download-markdown-to-asciidoc-source - generate-sources - - wget - - - https://github.com/bodiam/markdown-to-asciidoc/archive/refs/heads/master.zip - ${download.dir} - - - - - - maven-antrun-plugin - - - generate-sources - - - - - - - - - - - - - - - - run - - - - - - - - - \ No newline at end of file diff --git a/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/Converter.java b/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/Converter.java deleted file mode 100644 index 7b594b57..00000000 --- a/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/Converter.java +++ /dev/null @@ -1,51 +0,0 @@ -package nl.jworks.markdown_to_asciidoc; - -import org.pegdown.Extensions; -import org.pegdown.PegDownProcessor; -import org.pegdown.ast.RootNode; - -import java.io.*; - -public class Converter { - public static void main(String[] args) throws IOException { - if (args.length != 1) { - System.err.println("markdown_to_asciidoc: Please specify a file to convert"); - return; - } - - File input = new File(args[0]); - if (!input.exists()) { - System.err.println("markdown_to_asciidoc: Cannot find the specified file to convert"); - return; - } - - try { - BufferedReader reader = new BufferedReader(new FileReader(input)); - try { - StringBuilder buffer = new StringBuilder(); - String line; - while ((line = reader.readLine()) != null) { - buffer.append(line).append("\n"); - } - - reader.close(); - System.out.println(convertMarkdownToAsciiDoc(buffer.toString().trim())); - } finally { - reader.close(); - } - } catch (IOException e) { - System.err.println("markdown_to_asciidoc: An error occurred while reading the input file"); - } - } - - public static String convertMarkdownToAsciiDoc(String markdown) { - PegDownProcessor processor = new PegDownProcessor(Extensions.ALL); - // insert blank line before fenced code block if necessary - if (markdown.contains("```")) { - markdown = markdown.replaceAll("(?m)(? references = new HashMap(); - protected final Map abbreviations = new HashMap(); - protected final LinkRenderer linkRenderer = new LinkRenderer(); - - protected TableNode currentTableNode; - protected int currentTableColumn; - protected boolean inTableHeader; - - protected char listMarker; - protected int listLevel = 0; - protected int blockQuoteLevel = 0; - - // Experimental feature. - protected boolean autoDetectLanguageType; - protected Linguist linguist = new Linguist(); - - protected RootNode rootNode; - - public ToAsciiDocSerializer(RootNode rootNode) { - this(rootNode, null); - } - - public ToAsciiDocSerializer(RootNode rootNode, String source) { - this.printer = new Printer(); - this.linguist = new Linguist(); - this.autoDetectLanguageType = false; - checkArgNotNull(rootNode, "rootNode"); - this.rootNode = rootNode; - this.source = source; - } - - public String toAsciiDoc() { - cleanAst(rootNode); - rootNode.accept(this); - String result = normalizeWhitelines(printer.getString()); - printer.clear(); - return result; - } - - public void visit(RootNode node) { - for (ReferenceNode refNode : node.getReferences()) { - visitChildren(refNode); - references.put(normalize(printer.getString()), refNode); - printer.clear(); - } - for (AbbreviationNode abbrNode : node.getAbbreviations()) { - visitChildren(abbrNode); - String abbr = printer.getString(); - printer.clear(); - abbrNode.getExpansion().accept(this); - String expansion = printer.getString(); - abbreviations.put(abbr, expansion); - printer.clear(); - } - visitChildren(node); - } - - public void visit(AbbreviationNode node) { - } - - @Override - public void visit(AnchorLinkNode node) { - printer.print(node.getText()); - } - - public void visit(AutoLinkNode node) { - printLink(linkRenderer.render(node)); - } - - public void visit(BlockQuoteNode node) { - printer.println().println(); - - blockQuoteLevel += 4; - - repeat('_', blockQuoteLevel); - printer.println(); - visitChildren(node); - printer.println().println(); - repeat('_', blockQuoteLevel); - - blockQuoteLevel -= 4; - - printer.println(); - } - - public void visit(BulletListNode node) { - char prevListMarker = listMarker; - listMarker = '*'; - - listLevel = listLevel + 1; - visitChildren(node); - listLevel = listLevel - 1; - - listMarker = prevListMarker; - } - - public void visit(CodeNode node) { - printer.print('`'); - printer.printEncoded(node.getText()); - printer.print('`'); - } - - public void visit(DefinitionListNode node) { - printer.println(); - visitChildren(node); - } - - public void visit(DefinitionTermNode node) { - visitChildren(node); - printer.indent(2); - printer.print("::").println(); - } - - public void visit(DefinitionNode node) { - visitChildren(node); - if (printer.indent > 0) { - printer.indent(-2); - } - printer.println(); - } - - public void visit(ExpImageNode node) { - String text = printChildrenToString(node); - LinkRenderer.Rendering imageRenderer = linkRenderer.render(node, text); - Node linkNode; - if ((linkNode = findParentNode(node, rootNode)) instanceof ExpLinkNode) { - printImageTagWithLink(imageRenderer, linkRenderer.render((ExpLinkNode) linkNode, null)); - } - else { - printImageTag(linkRenderer.render(node, text)); - } - } - - public void visit(ExpLinkNode node) { - String text = printChildrenToString(node); - if (text.startsWith("image:")) { - printer.print(text); - } - else { - printLink(linkRenderer.render(node, text)); - } - } - - public void visit(HeaderNode node) { - printer.println().println(); - repeat('=', node.getLevel()); - printer.print(' '); - visitChildren(node); - printer.println().println(); - } - - private void repeat(char c, int times) { - for (int i = 0; i < times; i++) { - printer.print(c); - } - } - - public void visit(HtmlBlockNode node) { - String text = node.getText(); - if (text.length() > 0) printer.println(); - - if(text.startsWith(""); - visitChildren(node); - printer.print(""); - } - - public void visit(TableCellNode node) { -// String tag = inTableHeader ? "th" : "td"; - List columns = currentTableNode.getColumns(); - TableColumnNode column = columns.get(Math.min(currentTableColumn, columns.size() - 1)); - - String pstr = printer.getString(); - if (pstr.length() > 0) { - if (pstr.endsWith("\n") || pstr.endsWith(" ")) { - printer.print("|"); - } - else { - printer.print(" |"); - } - } - else { - printer.print("|"); - } - column.accept(this); - if (node.getColSpan() > 1) printer.print(" colspan=\"").print(Integer.toString(node.getColSpan())).print('"'); - visitChildren(node); - - currentTableColumn += node.getColSpan(); - } - - public void visit(TableColumnNode node) { - // nothing here yet - } - - public void visit(TableHeaderNode node) { - inTableHeader = true; -// printIndentedTag(node, "thead"); - - visitChildren(node); - - inTableHeader = false; - } - - private boolean ifColumnsHaveAlignmentSpecified(List columns) { - for (TableColumnNode column : columns) { - if(column.getAlignment() != TableColumnNode.Alignment.None) { - return true; - } - } - return false; - } - - private String getColumnAlignment(List columns) { - - List result = new ArrayList(); - - for (TableColumnNode column : columns) { - switch (column.getAlignment()) { - case None: - case Left: - result.add("<"); - break; - case Right: - result.add(">"); - break; - case Center: - result.add("^"); - break; - default: - throw new IllegalStateException(); - } - } - - return Joiner.join(result, ","); - } - - - public void visit(TableNode node) { - currentTableNode = node; - - List columns = node.getColumns(); - - if(ifColumnsHaveAlignmentSpecified(columns)) { - printer.print("[cols=\""); - printer.print(getColumnAlignment(columns)); - printer.print("\"]"); - printer.println(); - } - - printer.print("|==="); - visitChildren(node); - printer.println(); - printer.print("|==="); - printer.println(); - - currentTableNode = null; - } - - public void visit(TableRowNode node) { - currentTableColumn = 0; - - printer.println(); - - visitChildren(node); -// printIndentedTag(node, "tr"); - - if(inTableHeader) { - printer.println(); - } - } - - public void visit(VerbatimNode node) { - printer.println(); - - String type = node.getType(); - String text = node.getText(); - - if (autoDetectLanguageType) { - type = linguist.detectLanguage(text); - } - - if (!type.isEmpty()) { - printer.print("[source," + type + "]"); - } - - printer.println(); - repeat('-', 4); - printer.println(); - printer.print(text); - repeat('-', 4); - printer.println().println(); - } - - public void visit(WikiLinkNode node) { - printLink(linkRenderer.render(node)); - } - - public void visit(TextNode node) { - if (abbreviations.isEmpty()) { - printer.print(node.getText()); - } else { - printWithAbbreviations(node.getText()); - } - } - - public void visit(SpecialTextNode node) { - printer.printEncoded(node.getText()); - } - - public void visit(SuperNode node) { - visitChildren(node); - } - - public void visit(Node node) { - throw new RuntimeException("Don't know how to handle node " + node); - } - - // helpers - - protected void visitChildren(AbstractNode node) { - for (Node child : node.getChildren()) { - child.accept(this); - } - } - - - /** - * Removes superfluous nodes from the tree. - * - * @param node The node to clean. - */ - protected void cleanAst(Node node) { - List children = node.getChildren(); - for (int i = 0, len = children.size(); i < len; i++) { - Node c = children.get(i); - if (c instanceof RootNode) { - children.set(i, c.getChildren().get(0)); - } - else if (c.getClass().equals(SuperNode.class) && c.getChildren().size() == 1) { - children.set(i, c.getChildren().get(0)); - } - - cleanAst(c); - } - } - - protected void printNodeSurroundedBy(AbstractNode node, String token) { - printer.print(token); - visitChildren(node); - printer.print(token); - } - - protected void printImageTag(LinkRenderer.Rendering rendering) { - printer.print("image:"); - printer.print(rendering.href); - printer.print('['); - printTextWithQuotesIfNeeded(printer, rendering.text); - printer.print(']'); - } - - protected void printImageTagWithLink(LinkRenderer.Rendering image, LinkRenderer.Rendering link) { - printer.print("image:").print(image.href).print('['); - if (image.text != null && !image.text.isEmpty()) { - printTextWithQuotesIfNeeded(printer, image.text); - printer.print(','); - } - - printer.print("link=").print(link.href).print(']'); - } - - protected void printLink(LinkRenderer.Rendering rendering) { - String uri = rendering.href; - String text = rendering.text; - - if (uri.startsWith("#")) { - printer.print("<<").print(uri.substring(1)).print(',').print(text).print(">>"); - } else { - if (!uri.contains("://")) { - uri = "link:" + uri; - } - printer.print(uri); - if (!uri.equals(text)) { - printer.print('['); - printTextWithQuotesIfNeeded(printer, rendering.text); - printer.print(']'); - } - } - } - - protected String printChildrenToString(SuperNode node) { - Printer priorPrinter = printer; - printer = new Printer(); - visitChildren(node); - String result = printer.getString(); - printer = priorPrinter; - return result; - } - - protected String normalize(String string) { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < string.length(); i++) { - char c = string.charAt(i); - switch (c) { - case ' ': - case '\n': - case '\t': - continue; - } - sb.append(Character.toLowerCase(c)); - } - return sb.toString(); - } - - protected String normalizeWhitelines(String text) { - // replace all double or more empty lines with single empty lines - return text.replaceAll("(?m)^[ \t]*\r?\n{2,}", "\n").trim(); - } - - protected void printTextWithQuotesIfNeeded(Printer p, String text) { - if (text != null && !text.isEmpty()) { - if (text.contains(",")) { - p.print('"').print(text).print('"'); - } - else { - p.print(text); - } - } - } - - protected void printWithAbbreviations(String string) { - Map> expansions = null; - - for (Map.Entry entry : abbreviations.entrySet()) { - // first check, whether we have a legal match - String abbr = entry.getKey(); - - int ix = 0; - while (true) { - int sx = string.indexOf(abbr, ix); - if (sx == -1) break; - - // only allow whole word matches - ix = sx + abbr.length(); - - if (sx > 0 && Character.isLetterOrDigit(string.charAt(sx - 1))) continue; - if (ix < string.length() && Character.isLetterOrDigit(string.charAt(ix))) { - continue; - } - - // ok, legal match so save an expansions "task" for all matches - if (expansions == null) { - expansions = new TreeMap>(); - } - expansions.put(sx, entry); - } - } - - if (expansions != null) { - int ix = 0; - for (Map.Entry> entry : expansions.entrySet()) { - int sx = entry.getKey(); - String abbr = entry.getValue().getKey(); - String expansion = entry.getValue().getValue(); - - printer.printEncoded(string.substring(ix, sx)); - printer.print("'); - printer.printEncoded(abbr); - printer.print(""); - ix = sx + abbr.length(); - } - printer.print(string.substring(ix)); - } else { - printer.print(string); - } - } - - protected Node findParentNode(Node target, Node from) { - if (target.equals(rootNode)) { - return null; - } - - Node candidate; - - for (Node c : from.getChildren()) { - if (target.equals(c)) { - return from; - } - else if ((candidate = findParentNode(target, c)) != null) { - return candidate; - } - } - - return null; - } - - protected boolean isFirstChild(Node parent, Node child) { - return child.equals(parent.getChildren().get(0)); - } - - protected boolean isListItemText(Node node) { - if (listLevel == 0) { - return false; - } - else { - Node parent = findParentNode(node, rootNode); - return (parent instanceof ListItemNode && isFirstChild(parent, node)); - } - } -} diff --git a/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/code/Linguist.java b/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/code/Linguist.java deleted file mode 100644 index f93590fe..00000000 --- a/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/code/Linguist.java +++ /dev/null @@ -1,18 +0,0 @@ -package nl.jworks.markdown_to_asciidoc.code; - - -/** - * A really basic way of detecting code types. - */ -public class Linguist { - - public String detectLanguage(String text) { - if(text.startsWith("<")) { - return "html"; - } else if(text.endsWith(";")) { - return "java"; - } else { - return "groovy"; - } - } -} diff --git a/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/html/TableToAsciiDoc.java b/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/html/TableToAsciiDoc.java deleted file mode 100644 index b0bd232b..00000000 --- a/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/html/TableToAsciiDoc.java +++ /dev/null @@ -1,69 +0,0 @@ -package nl.jworks.markdown_to_asciidoc.html; - -import org.jsoup.Jsoup; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; -import org.jsoup.select.Elements; - -public class TableToAsciiDoc { - public static String convert(String html) { - if(!html.startsWith(" 0) { - result.append('\n'); - } - - // table data - result.append(buildAsciiDocRow(row, "td")); - result.append('\n'); - } - - result.append("|==="); - result.append('\n'); - - return result.toString(); - } - - private static String buildAsciiDocRow(Element row, String query) { - Elements columns = row.select(query); - StringBuilder dataRow = new StringBuilder(); - for (Element col : columns) { - dataRow.append('|').append(applyBasicFormatting(col)).append(' '); - } - return dataRow.toString().trim(); - } - - private static String applyBasicFormatting(Element element) { - - String result = element.ownText(); - - for (Element child : element.children()) { - if("code".equals(child.tagName())) { - result = "`" + child.ownText() + "`"; - } else if("b".equals(child.tagName()) || "strong".equals(child.tagName())) { - result = "*" + child.ownText() + "*"; - } else if("i".equals(child.tagName()) || "em".equals(child.tagName())) { - result = "_" + child.ownText() + "_"; - } else if("a".equals(child.tagName())) { - result = child.attr("href") + "[" + child.ownText() + "]"; - } - } - - return result; - } -} diff --git a/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/util/Joiner.java b/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/util/Joiner.java deleted file mode 100644 index 11bd17ea..00000000 --- a/markdown-to-asciidoc/src/main/java/nl/jworks/markdown_to_asciidoc/util/Joiner.java +++ /dev/null @@ -1,19 +0,0 @@ -package nl.jworks.markdown_to_asciidoc.util; - -import java.util.List; - -public class Joiner { - - public static String join(List list, String delim) { - int len = list.size(); - if (len == 0) { - return ""; - } - StringBuilder sb = new StringBuilder(list.get(0).toString()); - for (int i = 1; i < len; i++) { - sb.append(delim); - sb.append(list.get(i).toString()); - } - return sb.toString(); - } -} diff --git a/markdown-to-asciidoc/src/main/kotlin/nl/jworks/markdown_to_asciidoc/KotlinSerializer.kt b/markdown-to-asciidoc/src/main/kotlin/nl/jworks/markdown_to_asciidoc/KotlinSerializer.kt deleted file mode 100644 index 1a13c601..00000000 --- a/markdown-to-asciidoc/src/main/kotlin/nl/jworks/markdown_to_asciidoc/KotlinSerializer.kt +++ /dev/null @@ -1,624 +0,0 @@ -package nl.jworks.markdown_to_asciidoc - -import nl.jworks.markdown_to_asciidoc.code.Linguist -import nl.jworks.markdown_to_asciidoc.html.TableToAsciiDoc - -import nl.jworks.markdown_to_asciidoc.util.Joiner -import org.parboiled.common.StringUtils -import org.pegdown.LinkRenderer -import org.pegdown.Printer -import org.pegdown.ast.* - -import java.util.* - -import org.parboiled.common.Preconditions.checkArgNotNull - -class ToAsciiDocSerializerKt @JvmOverloads constructor(private var rootNode: RootNode, private var source: String) : Visitor { - - protected var printer = Printer() - protected val references: MutableMap = HashMap() - protected val abbreviations: MutableMap = HashMap() - protected val linkRenderer = LinkRenderer() - - protected var currentTableNode: TableNode? = null - protected var currentTableColumn: Int = 0 - protected var inTableHeader: Boolean = false - - protected var listMarker: Char = ' ' - protected var listLevel = 0 - protected var blockQuoteLevel = 0 - - // Experimental feature. - protected var autoDetectLanguageType: Boolean = false - protected var linguist = Linguist() - - init { - this.printer = Printer() - this.linguist = Linguist() - this.autoDetectLanguageType = false - checkArgNotNull(rootNode, "rootNode") - } - - fun toAsciiDoc(): String { - cleanAst(rootNode) - rootNode.accept(this) - val result = normalizeWhitelines(printer.string) - printer.clear() - return result - } - - override fun visit(node: RootNode) { - for (refNode in node.references) { - visitChildren(refNode) - references.put(normalize(printer.string), refNode) - printer.clear() - } - for (abbrNode in node.abbreviations) { - visitChildren(abbrNode) - val abbr = printer.string - printer.clear() - abbrNode.expansion.accept(this) - val expansion = printer.string - abbreviations.put(abbr, expansion) - printer.clear() - } - visitChildren(node) - } - - override fun visit(node: AbbreviationNode) {} - - override fun visit(node: AnchorLinkNode) { - printer.print(node.text) - } - - override fun visit(node: AutoLinkNode) { - printLink(linkRenderer.render(node)) - } - - override fun visit(node: BlockQuoteNode) { - printer.println().println() - - blockQuoteLevel += 4 - - repeat('_', blockQuoteLevel) - printer.println() - visitChildren(node) - printer.println().println() - repeat('_', blockQuoteLevel) - - blockQuoteLevel -= 4 - - printer.println() - } - - override fun visit(node: BulletListNode) { - val prevListMarker = listMarker - listMarker = '*' - - listLevel += 1 - visitChildren(node) - listLevel -= 1 - - listMarker = prevListMarker - } - - override fun visit(node: CodeNode) { - printer.print('`') - printer.printEncoded(node.text) - printer.print('`') - } - - override fun visit(node: DefinitionListNode) { - printer.println() - visitChildren(node) - } - - override fun visit(node: DefinitionTermNode) { - visitChildren(node) - printer.indent(2) - printer.print("::").println() - } - - override fun visit(node: DefinitionNode) { - visitChildren(node) - if (printer.indent > 0) { - printer.indent(-2) - } - printer.println() - } - - override fun visit(node: ExpImageNode) { - val text = printChildrenToString(node) - val imageRenderer = linkRenderer.render(node, text) - val linkNode: Node? = findParentNode(node, rootNode) - if (linkNode is ExpLinkNode) { - printImageTagWithLink(imageRenderer, linkRenderer.render(linkNode, null)) - } else { - printImageTag(linkRenderer.render(node, text)) - } - } - - override fun visit(node: ExpLinkNode) { - val text = printChildrenToString(node) - if (text.startsWith("image:")) { - printer.print(text) - } else { - printLink(linkRenderer.render(node, text)) - } - } - - override fun visit(node: HeaderNode) { - printer.println().println() - repeat('=', node.level) - printer.print(' ') - visitChildren(node) - printer.println().println() - } - - private fun repeat(c: Char, times: Int) { - for (i in 0 until times) { - printer.print(c) - } - } - - override fun visit(node: HtmlBlockNode) { - val text: String = node.text - if (text.isNotEmpty()) printer.println() - if (text.startsWith(" { - printer.print("«") - visitChildren(node) - printer.print("»") - } - QuotedNode.Type.Double -> { - printer.print("\"") - visitChildren(node) - printer.print("\"") - } - QuotedNode.Type.Single -> { - printer.print("'") - visitChildren(node) - printer.print("'") - } - } - } - - override fun visit(node: ReferenceNode) { - // reference nodes are not printed - } - - override fun visit(node: RefImageNode) { - val text = printChildrenToString(node) - val key = if (node.referenceKey != null) printChildrenToString(node.referenceKey) else text - val refNode = references[normalize(key)] - if (refNode == null) { // "fake" reference image link - printer.print("![").print(text).print(']') - if (node.separatorSpace != null) { - printer.print(node.separatorSpace).print('[') - if (node.referenceKey != null) printer.print(key) - printer.print(']') - } - } else - printImageTag(linkRenderer.render(node, refNode.url, refNode.title, text)) - } - - override fun visit(node: RefLinkNode) { - val text = printChildrenToString(node) - val key = if (node.referenceKey != null) printChildrenToString(node.referenceKey) else text - val refNode = references[normalize(key)] - if (refNode == null) { // "fake" reference link - printer.print('[').print(text).print(']') - if (node.separatorSpace != null) { - printer.print(node.separatorSpace).print('[') - if (node.referenceKey != null) printer.print(key) - printer.print(']') - } - } else - printLink(linkRenderer.render(node, refNode.url, refNode.title, text)) - } - - override fun visit(node: SimpleNode) { - when (node.type) { - SimpleNode.Type.Apostrophe -> printer.print("'") - SimpleNode.Type.Ellipsis -> printer.print("…") - SimpleNode.Type.Emdash -> printer.print("—") - SimpleNode.Type.Endash -> printer.print("–") - SimpleNode.Type.HRule -> printer.println().print("'''") - SimpleNode.Type.Linebreak -> - // look for length of span to detect hard line break (2 trailing spaces plus endline) - // necessary because Pegdown doesn't distinguish between a hard line break and a normal line break - if (source.substring(node.startIndex, node.endIndex).startsWith(HARD_LINE_BREAK_MARKDOWN)) { - printer.print(" +").println() - } else { - // QUESTION should we fold or preserve soft line breaks? (pandoc emits a space here) - printer.println() - } - SimpleNode.Type.Nbsp -> printer.print("{nbsp}") - else -> throw IllegalStateException() - } - } - - override fun visit(node: StrongEmphSuperNode) { - if (node.isClosed) { - if (node.isStrong) { - printNodeSurroundedBy(node, "*") - } else { - printNodeSurroundedBy(node, "_") - } - } else { - //sequence was not closed, treat open chars as ordinary chars - printer.print(node.chars) - visitChildren(node) - } - } - - override fun visit(node: StrikeNode) { - printer.print("[line-through]").print('#') - visitChildren(node) - printer.print('#') - } - - override fun visit(node: TableBodyNode) { - visitChildren(node) - } - - override fun visit(node: TableCaptionNode) { - printer.println().print("") - visitChildren(node) - printer.print("") - } - - override fun visit(node: TableCellNode) { - val columns = currentTableNode!!.columns - val column = columns[Math.min(currentTableColumn, columns.size - 1)] - - val pstr = printer.string - if (pstr.isNotEmpty()) { - if (pstr.endsWith("\n") || pstr.endsWith(" ")) { - printer.print("|") - } else { - printer.print(" |") - } - } else { - printer.print("|") - } - column.accept(this) - if (node.colSpan > 1) { - printer.print(" colspan=\"").print(Integer.toString(node.colSpan)).print('"') - } - visitChildren(node) - - currentTableColumn += node.colSpan - } - - override fun visit(node: TableColumnNode) { - // nothing here yet - } - - override fun visit(node: TableHeaderNode) { - inTableHeader = true - visitChildren(node) - inTableHeader = false - } - - private fun ifColumnsHaveAlignmentSpecified(columns: List) = columns.any { it.alignment != TableColumnNode.Alignment.None } - - private fun getColumnAlignment(columns: List): String { - - val result = ArrayList() - - for (column in columns) { - when (column.alignment) { - TableColumnNode.Alignment.None, TableColumnNode.Alignment.Left -> result.add("<") - TableColumnNode.Alignment.Right -> result.add(">") - TableColumnNode.Alignment.Center -> result.add("^") - else -> throw IllegalStateException() - } - } - - return Joiner.join(result, ",") - } - - override fun visit(node: TableNode) { - currentTableNode = node - - val columns = node.columns - - if (ifColumnsHaveAlignmentSpecified(columns)) { - printer.print("[cols=\"") - printer.print(getColumnAlignment(columns)) - printer.print("\"]") - printer.println() - } - - printer.print("|===") - visitChildren(node) - printer.println() - printer.print("|===") - printer.println() - - currentTableNode = null - } - - override fun visit(node: TableRowNode) { - currentTableColumn = 0 - printer.println() - - visitChildren(node) - - if (inTableHeader) { - printer.println() - } - } - - override fun visit(node: VerbatimNode) { - printer.println() - - var type = node.type - val text = node.text - - if (autoDetectLanguageType) { - type = linguist.detectLanguage(text) - } - - if (!type.isEmpty()) { - printer.print("[source,$type]") - } - - printer.println() - repeat('-', 4) - printer.println() - printer.print(text) - repeat('-', 4) - printer.println().println() - } - - override fun visit(node: WikiLinkNode) = printLink(linkRenderer.render(node)) - - override fun visit(node: TextNode) { - if (abbreviations.isEmpty()) { - printer.print(node.text) - } else { - printWithAbbreviations(node.text) - } - } - - override fun visit(node: SpecialTextNode) { - printer.printEncoded(node.text) - } - - override fun visit(node: SuperNode) = visitChildren(node) - - override fun visit(node: Node) = throw RuntimeException("Don't know how to handle node " + node) - - // helpers - protected fun visitChildren(node: AbstractNode) = node.children.forEach { it.accept(this) } - - /** - * Removes superfluous nodes from the tree. - */ - protected fun cleanAst(node: Node) { - val children = node.children - var i = 0 - val len = children.size - while (i < len) { - val c = children[i] - if (c is RootNode) { - children[i] = c.getChildren()[0] - } else if (c.javaClass == SuperNode::class.java && c.children.size == 1) { - children[i] = c.children[0] - } - - cleanAst(c) - i++ - } - } - - protected fun printNodeSurroundedBy(node: AbstractNode, token: String) { - printer.print(token) - visitChildren(node) - printer.print(token) - } - - protected fun printImageTag(rendering: LinkRenderer.Rendering) { - printer.print("image:") - printer.print(rendering.href) - printer.print('[') - printTextWithQuotesIfNeeded(printer, rendering.text) - printer.print(']') - } - - protected fun printImageTagWithLink(image: LinkRenderer.Rendering, link: LinkRenderer.Rendering) { - printer.print("image:").print(image.href).print('[') - if (image.text != null && !image.text.isEmpty()) { - printTextWithQuotesIfNeeded(printer, image.text) - printer.print(',') - } - - printer.print("link=").print(link.href).print(']') - } - - protected fun printLink(rendering: LinkRenderer.Rendering) { - var uri = rendering.href - val text = rendering.text - - if (uri.startsWith("#")) { - printer.print("<<").print(uri.substring(1)).print(',').print(text).print(">>") - } else { - if (!uri.contains("://")) { - uri = "link:" + uri - } - printer.print(uri) - if (uri != text) { - printer.print('[') - printTextWithQuotesIfNeeded(printer, rendering.text) - printer.print(']') - } - } - } - - protected fun printChildrenToString(node: SuperNode): String { - val priorPrinter = printer - printer = Printer() - visitChildren(node) - val result = printer.string - printer = priorPrinter - return result - } - - protected fun normalize(string: String): String { - val sb = StringBuilder() - loop@ for (i in 0 until string.length) { - val c = string[i] - when (c) { - ' ', '\n', '\t' -> continue@loop - } - sb.append(Character.toLowerCase(c)) - } - return sb.toString() - } - - protected fun normalizeWhitelines(text: String): String { - // replace all double or more empty lines with single empty lines - return text.replace("(?m)^[ \t]*\r?\n{2,}".toRegex(), "\n").trim { it <= ' ' } - } - - protected fun printTextWithQuotesIfNeeded(p: Printer, text: String?) { - if (text != null && !text.isEmpty()) { - if (text.contains(",")) { - p.print('"').print(text).print('"') - } else { - p.print(text) - } - } - } - - protected fun printWithAbbreviations(string: String) { - var expansions: MutableMap>? = null - - for (entry in abbreviations.entries) { - // first check, whether we have a legal match - val abbr = entry.key - - var ix = 0 - while (true) { - val sx = string.indexOf(abbr, ix) - if (sx == -1) break - - // only allow whole word matches - ix = sx + abbr.length - - if (sx > 0 && Character.isLetterOrDigit(string[sx - 1])) continue - if (ix < string.length && Character.isLetterOrDigit(string[ix])) { - continue - } - - // ok, legal match so save an expansions "task" for all matches - if (expansions == null) { - expansions = TreeMap() - } - expansions.put(sx, entry) - } - } - - if (expansions != null) { - var ix = 0 - for ((sx, value) in expansions) { - val abbr = value.key - val expansion = value.value - - printer.printEncoded(string.substring(ix, sx)) - printer.print("') - printer.printEncoded(abbr) - printer.print("") - ix = sx + abbr.length - } - printer.print(string.substring(ix)) - } else { - printer.print(string) - } - } - - protected fun findParentNode(target: Node, from: Node): Node? { - if (target == rootNode) { - return null - } - - for (c in from.children) { - val candidate: Node? = findParentNode(target, c) - - if (target == c) { - return from - } else if (candidate != null) { - return candidate - } - } - - return null - } - - protected fun isFirstChild(parent: Node, child: Node): Boolean { - return child == parent.children[0] - } - - protected fun isListItemText(node: Node): Boolean { - return if (listLevel == 0) { - false - } else { - val parent = findParentNode(node, rootNode) - parent is ListItemNode && isFirstChild(parent, node) - } - } - - companion object { - val HARD_LINE_BREAK_MARKDOWN = " \n" - } -} diff --git a/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/RunCukesTest.java b/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/RunCukesTest.java deleted file mode 100644 index 7fa3c2f0..00000000 --- a/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/RunCukesTest.java +++ /dev/null @@ -1,11 +0,0 @@ -package nl.jworks.markdown_to_asciidoc; - -import org.junit.runner.RunWith; - -import io.cucumber.junit.Cucumber; -import io.cucumber.junit.CucumberOptions; - -@RunWith(Cucumber.class) -@CucumberOptions(publish = false) -public class RunCukesTest { -} diff --git a/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/Stepdefs.java b/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/Stepdefs.java deleted file mode 100644 index 6ebcd35a..00000000 --- a/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/Stepdefs.java +++ /dev/null @@ -1,37 +0,0 @@ -package nl.jworks.markdown_to_asciidoc; - -import static org.junit.Assert.assertEquals; - -import io.cucumber.java.en.Given; -import io.cucumber.java.en.Then; -import io.cucumber.java.en.When; - -public class Stepdefs { - - private String markdown; - private String asciiDoc; - - @Given("^the Markdown source$") - public void the_markdown_source(String markdown) throws Throwable { - if (markdown.contains("{sp}")) { - this.markdown = markdown.replaceAll("\\{sp\\}", " "); - } - else { - this.markdown = markdown; - } - } - - @When("^it is converted to AsciiDoc") - public void it_is_converted_to_asciidoc() throws Throwable { - // Express the Regexp above with the code you wish you had - this.asciiDoc = Converter.convertMarkdownToAsciiDoc(markdown); - } - - @Then("^the result should match the AsciiDoc source$") - public void the_result_should_match_the_asciidoc_source(String result) throws Throwable { - // Express the Regexp above with the code you wish you had - - assertEquals(result, asciiDoc); - - } -} diff --git a/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/TestSuite.java b/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/TestSuite.java deleted file mode 100644 index 6f33d294..00000000 --- a/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/TestSuite.java +++ /dev/null @@ -1,34 +0,0 @@ -package nl.jworks.markdown_to_asciidoc; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.net.URL; - -import org.apache.commons.io.IOUtils; -import org.junit.Ignore; -import org.junit.Test; - -/** - * Converts the testsuite from https://github.com/karlcow/markdown-testsuite (run cat-all.py) to asciidoc, checks the output - */ -public class TestSuite { - @Ignore - @Test - public void test() { - String markDown = readToString("testsuite.md"); - String asciiDoc = Converter.convertMarkdownToAsciiDoc(markDown); - assertEquals(readToString("testsuite.adoc"), asciiDoc); - } - - private String readToString(String resourceName) { - URL url = getClass().getResource("/" + resourceName); - try { - return IOUtils.toString(url.openStream()); - } catch (IOException e) { - fail(); - return null; - } - } -} diff --git a/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/html/TableToAsciiDocTest.java b/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/html/TableToAsciiDocTest.java deleted file mode 100644 index f3773033..00000000 --- a/markdown-to-asciidoc/src/test/java/nl/jworks/markdown_to_asciidoc/html/TableToAsciiDocTest.java +++ /dev/null @@ -1,100 +0,0 @@ -package nl.jworks.markdown_to_asciidoc.html; - -import org.junit.Test; - -import static org.junit.Assert.*; - -public class TableToAsciiDocTest { - - @Test - public void convertTable() throws Exception { - String html = "\n" + - " \n" + - " \n" + - " \n" + - "
BaseNavigating ToResult
http://myapp.com/abchttp://myapp.com/abc
http://myapp.comabchttp://myapp.comabc
\n"; - - String expected = "|===\n" + - "|Base |Navigating To |Result\n" + - "\n" + - "|http://myapp.com/ |abc |http://myapp.com/abc\n" + - "|http://myapp.com |abc |http://myapp.comabc\n" + - "|===\n"; - - String actual = TableToAsciiDoc.convert(html); - - assertEquals(expected, actual); - - } - - @Test - public void convertTableWithCode() throws Exception { - String html = "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "
Case SensitiveCase InsensitiveDescription
startsWithiStartsWithMatches values that start with the given value
containsiContainsMatches values that contain the given value anywhere
endsWithiEndsWithMatches values that end with the given value
containsWordiContainsWordMatches values that contain the given value surrounded by either whitespace or the beginning or end of the value
notStartsWithiNotStartsWithMatches values that DO NOT start with the given value
notContainsiNotContainsMatches values that DO NOT contain the given value anywhere
notEndsWithiNotEndsWithMatches values that DO NOT end with the given value
notContainsWordiNotContainsWordMatches values that DO NOT contain the given value surrounded by either whitespace or the beginning or end of the value
"; - - String expected = "|===\n" + - "|Case Sensitive |Case Insensitive |Description\n" + - "\n" + - "|`startsWith` |`iStartsWith` |Matches values that start with the given value\n" + - "|`contains` |`iContains` |Matches values that contain the given value anywhere\n" + - "|`endsWith` |`iEndsWith` |Matches values that end with the given value\n" + - "|`containsWord` |`iContainsWord` |Matches values that contain the given value surrounded by either whitespace or the beginning or end of the value\n" + - "|`notStartsWith` |`iNotStartsWith` |Matches values that DO NOT start with the given value\n" + - "|`notContains` |`iNotContains` |Matches values that DO NOT contain the given value anywhere\n" + - "|`notEndsWith` |`iNotEndsWith` |Matches values that DO NOT end with the given value\n" + - "|`notContainsWord` |`iNotContainsWord` |Matches values that DO NOT contain the given value surrounded by either whitespace or the beginning or end of the value\n" + - "|===\n"; - - String actual = TableToAsciiDoc.convert(html); - - assertEquals(expected, actual); - - } - - @Test - public void convertTableWithLinks() throws Exception { - String html = "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - "
Short NameDriver
htmlunitorg.openqa.selenium.htmlunit.HtmlUnitDriver
firefoxorg.openqa.selenium.firefox.FirefoxDriver
ieorg.openqa.selenium.ie.InternetExplorerDriver
chromeorg.openqa.selenium.chrome.ChromeDriver
"; - - String expected = "|===\n" + - "|Short Name |Driver\n" + - "\n" + - "|`htmlunit` |http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/htmlunit/HtmlUnitDriver.html[org.openqa.selenium.htmlunit.HtmlUnitDriver]\n" + - "|`firefox` |http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/firefox/FirefoxDriver.html[org.openqa.selenium.firefox.FirefoxDriver]\n" + - "|`ie` |http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/ie/InternetExplorerDriver.html[org.openqa.selenium.ie.InternetExplorerDriver]\n" + - "|`chrome` |http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/chrome/ChromeDriver.html[org.openqa.selenium.chrome.ChromeDriver]\n" + - "|===\n"; - - String actual = TableToAsciiDoc.convert(html); - - assertEquals(expected, actual); - - } -} \ No newline at end of file diff --git a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/code.feature b/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/code.feature deleted file mode 100644 index f8b658b3..00000000 --- a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/code.feature +++ /dev/null @@ -1,122 +0,0 @@ -# language: en -@code -Feature: Code - In order to group content - As a writer - I want to be able to create code blocks - - Scenario: Render a code block without language - Given the Markdown source - """ - ``` - summary(cars$dist) - summary(cars$speed) - ``` - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - ---- - summary(cars$dist) - summary(cars$speed) - ---- - """ - - Scenario: Render a code block without language containing HTML - Given the Markdown source - """ - ``` - No language indicated, so no syntax highlighting. - But let's throw in a tag. - ``` - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - ---- - No language indicated, so no syntax highlighting. - But let's throw in a tag. - ---- - """ - - Scenario: Render a javascript code block - Given the Markdown source - """ - ```javascript - var s = "JavaScript syntax highlighting"; - alert(s); - ``` - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - [source,javascript] - ---- - var s = "JavaScript syntax highlighting"; - alert(s); - ---- - """ - - Scenario: Render a python code block - Given the Markdown source - """ - ```python - s = "Python syntax highlighting" - print s - ``` - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - [source,python] - ---- - s = "Python syntax highlighting" - print s - ---- - """ - - Scenario: Render an indented code block - Given the Markdown source - """ - $ gem install asciidoctor - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - ---- - $ gem install asciidoctor - ---- - """ - - Scenario: Render code block adjacent to preceding paragraph - Given the Markdown source - """ - Here's an example: - ```javascript - var s = "JavaScript syntax highlighting"; - alert(s); - ``` - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Here's an example: - - [source,javascript] - ---- - var s = "JavaScript syntax highlighting"; - alert(s); - ---- - """ - - Scenario: Render inline code - Given the Markdown source - """ - We defined the `add` function to - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - We defined the `add` function to - """ - diff --git a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/descriptionlists.feature b/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/descriptionlists.feature deleted file mode 100644 index 1bdcbb56..00000000 --- a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/descriptionlists.feature +++ /dev/null @@ -1,41 +0,0 @@ -# language: en -@descriptionlists -Feature: Description lists - In order to describe terms - As a writer - I want to be able to create description lists - - Scenario: Render a description list - Given the Markdown source - """ - Apple - : Pomaceous fruit of plants of the genus Malus in - the family Rosaceae. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Apple:: - Pomaceous fruit of plants of the genus Malus in - the family Rosaceae. - """ - - Scenario: Render a multiple description lists - Given the Markdown source - """ - Apple - : Pomaceous fruit of plants of the genus Malus in - the family Rosaceae. - - Orange - : The fruit of an evergreen tree of the genus Citrus. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Apple:: - Pomaceous fruit of plants of the genus Malus in - the family Rosaceae. - Orange:: - The fruit of an evergreen tree of the genus Citrus. - """ diff --git a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/headings.feature b/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/headings.feature deleted file mode 100644 index 43926b68..00000000 --- a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/headings.feature +++ /dev/null @@ -1,107 +0,0 @@ -# language: en -@headings -Feature: Headings - In order to group content - As a writer - I want to be able to style heading - - Scenario: Render a level 1 heading - Given the Markdown source - """ - # Title # - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - = Title - """ - - Scenario: Render a level 1 underscored heading - Given the Markdown source - """ - Title - ===== - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - = Title - """ - - Scenario: Render a level 2 heading - Given the Markdown source - """ - ## Title - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - == Title - """ - - Scenario: Render a level 2 underscored heading - Given the Markdown source - """ - Title - ----- - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - == Title - """ - - Scenario: Render a level 3 heading - Given the Markdown source - """ - ## Title - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - == Title - """ - - Scenario: Render a level 4 heading - Given the Markdown source - """ - #### Title - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - ==== Title - """ - - Scenario: Render a level 5 heading - Given the Markdown source - """ - ##### Title - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - ===== Title - """ - - Scenario: Render a level 6 heading - Given the Markdown source - """ - ###### Title - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - ====== Title - """ - - Scenario: Render a heading with different styling - Given the Markdown source - """ - # Title #### - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - = Title - """ diff --git a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/lines.feature b/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/lines.feature deleted file mode 100644 index 5309e68a..00000000 --- a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/lines.feature +++ /dev/null @@ -1,26 +0,0 @@ -# language: en -@lines -Feature: Lines - In order to group content - As a writer - I want to be able to create horizontal lines - - Scenario: Create 4 horizontal lines - Given the Markdown source - """ - --- - - - - - - - *** - - * * * - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - ''' - ''' - ''' - ''' - """ diff --git a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/links.feature b/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/links.feature deleted file mode 100644 index 57b53846..00000000 --- a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/links.feature +++ /dev/null @@ -1,138 +0,0 @@ -# language: en -@links -Feature: Links - In order to group content - As a writer - I want to be able to create links - - Scenario: Render an implicit inline link - Given the Markdown source - """ - Use [http://example.com](http://example.com) for sample links in documentation. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Use http://example.com for sample links in documentation. - """ - - Scenario: Render an inline link - Given the Markdown source - """ - This is [an example](http://example.com/) inline link. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - This is http://example.com/[an example] inline link. - """ - - Scenario: Render linked text with comma - Given the Markdown source - """ - This is [a very, very cool](http://example.com/) inline link. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - This is http://example.com/["a very, very cool"] inline link. - """ - - Scenario: Render a reference style link with link definition - Given the Markdown source - """ - The [syntax page] [s] provides complete, detailed documentation for - - [s]: /projects/markdown/syntax "Markdown Syntax" - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - The link:/projects/markdown/syntax[syntax page] provides complete, detailed documentation for - """ - - Scenario: Render a reference style link with link text - Given the Markdown source - """ - The [syntax page] provides complete, detailed documentation for - - [syntax page]: http://www.syntaxpage.com - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - The http://www.syntaxpage.com[syntax page] provides complete, detailed documentation for - """ - - Scenario: Render an internal link using the cross reference syntax - Given the Markdown source - """ - Refer to [Quick start](#quick-start) to learn how to get started. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Refer to <> to learn how to get started. - """ - - Scenario: Render an reference style image - Given the Markdown source - """ - ![Alt text][logo] - - [logo]: images/icons/home.png - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - image:images/icons/home.png[Alt text] - """ - - Scenario: Render an inline image with parameters - Given the Markdown source - """ - ![Alt text](images/icons/home.png) - - ![Alt text](images/icons/home.png?width=100) - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - image:images/icons/home.png[Alt text] - - image:images/icons/home.png?width=100[Alt text] - """ - - Scenario: Render an inline image with comma in alt text - Given the Markdown source - """ - ![Alt,text](images/icons/home.png) - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - image:images/icons/home.png["Alt,text"] - """ - - Scenario: Render a hyperlinked inline image with alt text - Given the Markdown source - """ - [![Build Status](https://travis-ci.org/asciidoctor/asciidoctor.png)](https://travis-ci.org/asciidoctor/asciidoctor) - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - image:https://travis-ci.org/asciidoctor/asciidoctor.png[Build Status,link=https://travis-ci.org/asciidoctor/asciidoctor] - """ - - #failing - #Scenario: Render a hyperlinked inline image with no alt text - # Given the Markdown source - # """ - # [![](https://travis-ci.org/asciidoctor/asciidoctor.png)](https://travis-ci.org/asciidoctor/asciidoctor) - # """ - # When it is converted to AsciiDoc - # Then the result should match the AsciiDoc source - # """ - # image:https://travis-ci.org/asciidoctor/asciidoctor.png[link=https://travis-ci.org/asciidoctor/asciidoctor] - # """ diff --git a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/lists.feature b/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/lists.feature deleted file mode 100644 index 783f0b8f..00000000 --- a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/lists.feature +++ /dev/null @@ -1,196 +0,0 @@ -# language: en -@lists -Feature: Lists - In order to group content - As a writer - I want to be able to create lists - - Scenario: Render an unordered list - Given the Markdown source - """ - * Item 1 - * Item 2 - * Item 3 - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - * Item 1 - * Item 2 - * Item 3 - """ - - Scenario: Render an unordered list of paragraphs - Given the Markdown source - """ - * Paragraph 1 - - * Paragraph 2 - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - * Paragraph 1 - - * Paragraph 2 - """ - - Scenario: Render an unordered nested list - Given the Markdown source - """ - * Item 1 - * Item 1_1 - * Item 1_2 - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - * Item 1 - ** Item 1_1 - ** Item 1_2 - """ - - Scenario: Render an ordered list - Given the Markdown source - """ - 1. Item 1 - 1. Item 2 - 1. Item 3 - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - . Item 1 - . Item 2 - . Item 3 - """ - - Scenario: Render a nested ordered list - Given the Markdown source - """ - 1. Item 1 - 1. Item 1.1 - 1. Item 1.2 - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - . Item 1 - .. Item 1.1 - .. Item 1.2 - """ - - Scenario: Render a nested ordered list combined with unordered list - Given the Markdown source - """ - 1. Item 1 - 1. Item 11 - * bullet 111 - * bullet 112 - * bullet 1121 - 1. Item 11211 - 1. Item 12 - 1. Item 2 - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - . Item 1 - .. Item 11 - *** bullet 111 - *** bullet 112 - **** bullet 1121 - ..... Item 11211 - .. Item 12 - . Item 2 - """ - - Scenario: Render an ordered list combined with a nested unordered list - Given the Markdown source - """ - 1. Item 1 - - 2. Item 2 - - * Subitem of Item 2 - - 3. Item 3 - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - . Item 1 - - . Item 2 - - ** Subitem of Item 2 - - . Item 3 - """ - - Scenario: Render an ordered list of paragraphs - Given the Markdown source - """ - . Paragraph 1 - - . Paragraph 2 - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - . Paragraph 1 - - . Paragraph 2 - """ - - Scenario: Render an unordered list with a link - Given the Markdown source - """ - There is a Maven example project available. - - * [http://github.com/geb/geb-example-maven](https://github.com/geb/geb-example-maven) - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - There is a Maven example project available. - - * https://github.com/geb/geb-example-maven[http://github.com/geb/geb-example-maven] - """ - -#@@knownissue This doesn't work. Item 4 is contains 3 para nodes instead of a code block -# Scenario: Render 4 numbered items with a code block -# Given the Markdown source -# """ -# 1. Use the `browser` object explicitly (made available by the testing adapters) -# 2. Use the page instance returned by the `to()` and `at()` methods instead of calling through the browser -# 3. Use methods on the `Page` classes instead of the `content {}` block and dynamic properties -# 4. If you need to use content definition options like `required:` and `wait:` then you can still reference content elements defined using the DSL in methods on `Page` and `Module` classes as usual, e.g.: -# -# static content = { -# async(wait: true) { $(".async") } -# } -# -# String asyncText() { -# async.text() // Wait here for the async definition to return a non-empty Navigator... -# } -# Using this “typed” style is not an all or nothing proposition. -# """ -# When it is converted to AsciiDoc -# Then the result should match the AsciiDoc source -# """ -# . Use the `browser` object explicitly (made available by the testing adapters) -# . Use the page instance returned by the `to()` and `at()` methods instead of calling through the browser -# . Use methods on the `Page` classes instead of the `content {}` block and dynamic properties -# . If you need to use content definition options like `required:` and `wait:` then you can still reference content elements defined using the DSL in methods on `Page` and `Module` classes as usual, e.g.: -# -# static content = { -# async(wait: true) { $(".async") } -# } -# -# String asyncText() { -# async.text() // Wait here for the async definition to return a non-empty Navigator... -# } -# -# Using this “typed” style is not an all or nothing proposition. -# """ diff --git a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/markup.feature b/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/markup.feature deleted file mode 100644 index 7ea6dc3b..00000000 --- a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/markup.feature +++ /dev/null @@ -1,350 +0,0 @@ -# language: en -@markup -Feature: Markup - In order to group content - As a writer - I want to be able to apply markup to text - - Scenario: Don't apply formatting - Given the Markdown source - """ - Normal text - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Normal text - """ - - Scenario: Don't apply formatting for one line over multiple lines - Given the Markdown source - """ - Normal text - Normal text - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Normal text - Normal text - """ - - Scenario: Don't apply formatting for multiple lines - Given the Markdown source - """ - Normal text - - Normal text - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Normal text - - Normal text - """ - - Scenario: Text, lists, text - Given the Markdown source - """ - The support provides: - - * Understanding of implicit browser methods (e.g. `to()`, `at()`) in test classes (e.g. `extends GebSpec`) - * Understanding of content defined via the Content DSL (within `Page` and `Module` classes only) - * Completion in `at {}` and `content {}` blocks - - This effectively enables more authoring support with less explicit type information. The Geb development team would like to thank the good folks at JetBrains for adding this explicit support for Geb to IDEA. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - The support provides: - - * Understanding of implicit browser methods (e.g. `to()`, `at()`) in test classes (e.g. `extends GebSpec`) - * Understanding of content defined via the Content DSL (within `Page` and `Module` classes only) - * Completion in `at {}` and `content {}` blocks - - This effectively enables more authoring support with less explicit type information. The Geb development team would like to thank the good folks at JetBrains for adding this explicit support for Geb to IDEA. - """ - -# @fixme -# Scenario: Escaped characters -# Given the Markdown source -# """ -# \*this text is surrounded by literal asterisks\* -# """ -# When it is converted to AsciiDoc -# Then the result should match the AsciiDoc source -# """ -# +++*this text is surrounded by literal asterisks*+++ -# """ - - Scenario: Make text bold - Given the Markdown source - """ - **Bold text** - __Bold text__ - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - *Bold text* - *Bold text* - """ - - Scenario: Make text italic - Given the Markdown source - """ - *Italic text* - _Italic text_ - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - _Italic text_ - _Italic text_ - """ - - Scenario: Make text mono - Given the Markdown source - """ - `Mono text` - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - `Mono text` - """ - - Scenario: Make text bold and italic - Given the Markdown source - """ - This is ***bold and italic*** text - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - This is *_bold and italic_* text - """ - - Scenario: Blockquotes - Given the Markdown source - """ - > Blockquotes are very handy in email to emulate reply text. - > This line is part of the same quote. - - Quote break. - - > This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - ____ - - Blockquotes are very handy in email to emulate reply text. - This line is part of the same quote. - - ____ - - Quote break. - - ____ - - This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can _put_ *Markdown* into a blockquote. - - ____ - """ - - @blockquotes - Scenario: Nested Blockquotes - Given the Markdown source - """ - > > What's new? - > - > I've got Markdown in my AsciiDoc! - > - > > Like what? - > - > * Blockquotes - > * Headings - > * Fenced code blocks - > - > > Is there more? - > - > Yep. AsciiDoc and Markdown share a lot of common syntax already. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - ____ - - ________ - - What's new? - - ________ - - I've got Markdown in my AsciiDoc! - - ________ - - Like what? - - ________ - - * Blockquotes - * Headings - * Fenced code blocks - - ________ - - Is there more? - - ________ - - Yep. AsciiDoc and Markdown share a lot of common syntax already. - - ____ - """ - - Scenario: Superscript - Given the Markdown source - """ - superscript^2^ - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - superscript^2^ - """ - - Scenario: Subscript - Given the Markdown source - """ - CO~2~ - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - CO~2~ - """ - - Scenario: Double angle bracket quoting - Given the Markdown source - """ - <> - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - «hello» - """ - - Scenario: Double quoting - Given the Markdown source - """ - "hello" - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - "hello" - """ - - - Scenario: Single quoting - Given the Markdown source - """ - 'hello' - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - 'hello' - """ - - Scenario: Apostroph - Given the Markdown source - """ - a'a - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - a'a - """ - - Scenario: Ellipsis two - Given the Markdown source - """ - a...a - a. . .a - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - a…a - a…a - """ - - Scenario: Em Dash - Given the Markdown source - """ - a---a - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - a—a - """ - - Scenario: En Dash - Given the Markdown source - """ - a--a - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - a–a - """ - - Scenario: Nbsp - Given the Markdown source - """ - << a a >> - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - «{nbsp}a a{nbsp}» - """ - - Scenario: Should recognize a hard line break - Given the Markdown source - """ - Roses are red,{sp}{sp} - Violets are blue.{sp} - Sort of blue. - More like violet. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Roses are red, + - Violets are blue. - Sort of blue. - More like violet. - """ - - Scenario: Strikethrough - Given the Markdown source - """ - This is ~~striked~~ text - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - This is [line-through]#striked# text - """ diff --git a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/paragraphs.feature b/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/paragraphs.feature deleted file mode 100644 index 501b8a1a..00000000 --- a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/paragraphs.feature +++ /dev/null @@ -1,45 +0,0 @@ -# language: en -@paragraphs -Feature: Paragraphs - In order to write normal content - As a writer - I want to be able to create discrete paragraphs - - Scenario: Render a paragraph with a single line - Given the Markdown source - """ - A paragraph with a single line. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - A paragraph with a single line. - """ - - Scenario: Render a paragraph with multiple lines - Given the Markdown source - """ - First line of paragraph. - Second line of paragraph. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - First line of paragraph. - Second line of paragraph. - """ - - Scenario: Render multiple paragraphs seperated by a blank line - Given the Markdown source - """ - First paragraph. - - Second paragraph. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - First paragraph. - - Second paragraph. - """ diff --git a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/tables.feature b/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/tables.feature deleted file mode 100644 index 5a4c5c5a..00000000 --- a/markdown-to-asciidoc/src/test/resources/nl/jworks/markdown_to_asciidoc/tables.feature +++ /dev/null @@ -1,118 +0,0 @@ -# language: en -@tables -Feature: Tables - In order to group content - As a writer - I want to be able to create tables - - Scenario: Render a table - Given the Markdown source - """ - | Name of Column 1 | Name of Column 2| - | ---------------- | --------------- | - | Cell in column 1, row 1 | Cell in column 2, row 1| - | Cell in column 1, row 2 | Cell in column 2, row 2| - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - |=== - |Name of Column 1 |Name of Column 2 - - |Cell in column 1, row 1 |Cell in column 2, row 1 - |Cell in column 1, row 2 |Cell in column 2, row 2 - |=== - """ - - # NOTE we are still getting trailing space at the end of lines - Scenario: Leave a trailing space at the end of each adjacent cell - Given the Markdown source - """ - | Browser | Tablet | Smartphone | - | ------- | ------ | ---------- | - | Safari 5.1+| iPad 2+ | iOS 6+ | - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - |=== - |Browser |Tablet |Smartphone - - |Safari 5.1+ |iPad 2+ |iOS 6+ - |=== - """ - - Scenario: Render a table with left, center and right align columns - Given the Markdown source - """ - | Tables | Are | Cool| - | ------------- |:-------------:| ----:| - | col 3 is | right-aligned | $1600| - | col 2 is | centered | $12| - | zebra stripes | are neat | $1| - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - [cols="<,^,>"] - |=== - |Tables |Are |Cool - - |col 3 is |right-aligned |$1600 - |col 2 is |centered |$12 - |zebra stripes |are neat |$1 - |=== - """ - - Scenario: Render a markdown HTML table - Given the Markdown source - """ - Care must be taken with slashes when specifying both the base URL and the relative URL as trailing and leading slashes have significant meaning. The following table illustrates the resolution of different types of URLs. - - - - - -
BaseNavigating ToResult
http://myapp.com/abchttp://myapp.com/abc
http://myapp.comabchttp://myapp.comabc
- - It is usually most desirable to define your base urls with trailing slashes and not to use leading slashes on relative URLs. - """ - When it is converted to AsciiDoc - Then the result should match the AsciiDoc source - """ - Care must be taken with slashes when specifying both the base URL and the relative URL as trailing and leading slashes have significant meaning. The following table illustrates the resolution of different types of URLs. - - |=== - |Base |Navigating To |Result - - |http://myapp.com/ |abc |http://myapp.com/abc - |http://myapp.com |abc |http://myapp.comabc - |=== - - It is usually most desirable to define your base urls with trailing slashes and not to use leading slashes on relative URLs. - """ - -# @table -# Scenario: Render a table with left, center and right align columns -# Given the Markdown source -# """ -# | | Grouping || -# | First Header | Second Header | Third Header | -# | ------------ | :-----------: | -----------: | -# | Content | *Long Cell* || -# | Content | **Cell** | Cell | -# | New section | More | Data | -# """ -# When it is converted to AsciiDoc -# Then the result should match the AsciiDoc source -# """ -# [cols="<,^,>"] -# |=== -# | 2+| Grouping -# -# | Content 2+| _Long Cell_ -# | Content | *Cell* | Cell -# | New section | More | Data -# |=== -# """ - diff --git a/markdown-to-asciidoc/src/test/resources/pandoc/clean.sh b/markdown-to-asciidoc/src/test/resources/pandoc/clean.sh deleted file mode 100644 index 0941b833..00000000 --- a/markdown-to-asciidoc/src/test/resources/pandoc/clean.sh +++ /dev/null @@ -1,2 +0,0 @@ -rm *.adoc -rm *.html \ No newline at end of file diff --git a/markdown-to-asciidoc/src/test/resources/pandoc/convert-to-adoc.sh b/markdown-to-asciidoc/src/test/resources/pandoc/convert-to-adoc.sh deleted file mode 100644 index 6b075865..00000000 --- a/markdown-to-asciidoc/src/test/resources/pandoc/convert-to-adoc.sh +++ /dev/null @@ -1 +0,0 @@ -pandoc -s -S unorderedlists.md -t asciidoc -o unorderedlists.adoc \ No newline at end of file diff --git a/markdown-to-asciidoc/src/test/resources/pandoc/convert-to-html.sh b/markdown-to-asciidoc/src/test/resources/pandoc/convert-to-html.sh deleted file mode 100644 index 392126ab..00000000 --- a/markdown-to-asciidoc/src/test/resources/pandoc/convert-to-html.sh +++ /dev/null @@ -1 +0,0 @@ -asciidoctor unorderedlists.adoc \ No newline at end of file diff --git a/markdown-to-asciidoc/src/test/resources/pandoc/nestednestedquotes.md b/markdown-to-asciidoc/src/test/resources/pandoc/nestednestedquotes.md deleted file mode 100644 index 4ed5d11c..00000000 --- a/markdown-to-asciidoc/src/test/resources/pandoc/nestednestedquotes.md +++ /dev/null @@ -1,23 +0,0 @@ - -= Nested quotes - -Small test for nested quotes - -> > > Hello World! -> -> > What's new? -> -> I've got Markdown in my AsciiDoc! -> -> > > I think so! -> -> > Like what? -> -> * Blockquotes -> * Headings -> * Fenced code blocks -> -> > Is there more? -> -> Yep. AsciiDoc and Markdown share a lot of common syntax already. - diff --git a/markdown-to-asciidoc/src/test/resources/pandoc/nestedquotes.md b/markdown-to-asciidoc/src/test/resources/pandoc/nestedquotes.md deleted file mode 100644 index 79d2c8e2..00000000 --- a/markdown-to-asciidoc/src/test/resources/pandoc/nestedquotes.md +++ /dev/null @@ -1,19 +0,0 @@ - -= Nested quotes - -Small test for nested quotes - -> > What's new? -> -> I've got Markdown in my AsciiDoc! -> -> > Like what? -> -> * Blockquotes -> * Headings -> * Fenced code blocks -> -> > Is there more? -> -> Yep. AsciiDoc and Markdown share a lot of common syntax already. - diff --git a/markdown-to-asciidoc/src/test/resources/pandoc/quotes.md b/markdown-to-asciidoc/src/test/resources/pandoc/quotes.md deleted file mode 100644 index ab54c896..00000000 --- a/markdown-to-asciidoc/src/test/resources/pandoc/quotes.md +++ /dev/null @@ -1,11 +0,0 @@ -= Quotes - -Small test for quotes - - -> Blockquotes are very handy in email to emulate reply text. -> This line is part of the same quote. - -Quote break. - -> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote. diff --git a/markdown-to-asciidoc/src/test/resources/pandoc/unorderedlists.md b/markdown-to-asciidoc/src/test/resources/pandoc/unorderedlists.md deleted file mode 100644 index 9b9d8015..00000000 --- a/markdown-to-asciidoc/src/test/resources/pandoc/unorderedlists.md +++ /dev/null @@ -1,6 +0,0 @@ -# test - -* Item 1 - * Item 1_1 - * Item 1_2 - diff --git a/markdown-to-asciidoc/src/test/resources/testsuite.adoc b/markdown-to-asciidoc/src/test/resources/testsuite.adoc deleted file mode 100644 index 3e88ca4d..00000000 --- a/markdown-to-asciidoc/src/test/resources/testsuite.adoc +++ /dev/null @@ -1,844 +0,0 @@ -[source] ----- -summary(cars$dist) -summary(cars$speed) ----- - - -= 2-paragraphs-hard-return-spaces - -This is a first paragraph, -on multiple lines. -This is a second paragraph. -There are spaces in between the two. - -= 2-paragraphs-hard-return - -This is a first paragraph, -on multiple lines. -This is a second paragraph -which has multiple lines too. - -= 2-paragraphs-line-returns - -A first paragraph. -A second paragraph after 3 CR (carriage return). - -= 2-paragraphs-line-spaces - -This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. -A few spaces and a new long long long long long long long long long long long long long long long long paragraph on 1 line. - -= 2-paragraphs-line-tab - -This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. -1 tab to separate them and a new long long long long long long long long long long long long long long long long paragraph on 1 line. - -= 2-paragraphs-line - -This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. -A new long long long long long long long long long long long long long long long long paragraph on 1 line. - -= ampersand-text-flow - -An ampersand & in the text flow is escaped as an html entity. - -= ampersand-uri - -There is an http://validator.w3.org/check?uri=http://www.w3.org/&verbose=1[ampersand] in the URI. - -= asterisk-near-text - -This is *an asterisk which should stay as is. - -= asterisk - -This is * an asterisk which should stay as is. - -= backslash-escape - -\ backslash -` backtick -* asterisk -_ underscore -{} curly braces -[] square brackets -() parentheses -# hash mark -+ plus sign -- minus sign (hyphen) -. dot -! exclamation mark - -= blockquote-added-markup - -____ - -= heading level 1 - -paragraph -____ - - -= blockquote-line-2-paragraphs - -____ -A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line. -and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line. -____ - - -= blockquote-line - -____ -This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a blockquote. -____ - - -= blockquote-multiline-1-space-begin - -____ -A blockquote -on multiple lines -like this. -____ - - -= blockquote-multiline-1-space-end - -____ -A blockquote -on multiple lines -like this. -____ - - -= blockquote-multiline-2-paragraphs - -____ -A blockquote -on multiple lines -like this. -But it has -two paragraphs. -____ - - -= blockquote-multiline - -____ -A blockquote -on multiple lines -like this -____ - - -= blockquote-nested-multiplereturn-level1 - -____ -This is the first level of quoting. -________ -This is nested blockquote. -________ - -Back to the first level. -____ - - -= blockquote-nested-multiplereturn - -____ -This is the first level of quoting. -________ -This is nested blockquote. -________ - -____ - - -= blockquote-nested-return-level1 - -____ -This is the first level of quoting. -________ -This is nested blockquote. -Back to the first level. -________ - -____ - - -= blockquote-nested - -____ -This is the first level of quoting. -________ -This is nested blockquote. -________ - -____ - - -= code-1-tab - -[source] ----- -10 PRINT HELLO INFINITE -20 GOTO 10 ----- - - -= code-4-spaces-escaping - -[source] ----- -10 PRINT < > & -20 GOTO 10 ----- - - -= code-4-spaces - -[source] ----- -10 PRINT HELLO INFINITE -20 GOTO 10 ----- - - -= em-middle-word - -as*te*risks - -= em-star - -_single asterisks_ - -= em-underscore - -_single underscores_ - -= entities-text-flow - -HTML entities are written using ampersand notation: © - -= header-level1-equal-underlined - - -= This is an H1 - - -= header-level1-hash-sign-closed - - -= This is an H1 - - -= header-level1-hash-sign-trailing-1-space - -# This is an H1 - -= header-level1-hash-sign-trailing-2-spaces - - -= this is an h1 with two trailing spaces - -A new paragraph. - -= header-level1-hash-sign - - -= This is an H1 - - -= header-level2-dash-underlined - - -== This is an H2 - - -= header-level2-hash-sign-closed - - -== This is an H2 - - -= header-level2-hash-sign - - -== This is an H2 - - -= header-level3-hash-sign-closed - - -=== This is an H3 - - -= header-level3-hash-sign - - -=== This is an H3 - - -= header-level4-hash-sign-closed - - -==== This is an H4 - - -= header-level4-hash-sign - - -==== This is an H4 - - -= header-level5-hash-sign-closed - - -===== This is an H5 - - -= header-level5-hash-sign - - -===== This is an H5 - - -= header-level6-hash-sign-closed - - -====== This is an H6 - - -= header-level6-hash-sign - - -====== This is an H6 - - -= horizontal-rule-3-dashes-spaces - -''' - -= horizontal-rule-3-dashes - -''' - -= horizontal-rule-3-stars - -''' - -= horizontal-rule-3-underscores - -''' - -= horizontal-rule-7-dashes - -''' - -= img-idref-title - -image:http://www.w3.org/html/logo/img/mark-word-icon.png[HTML5] - -= img-idref - -image:http://www.w3.org/html/logo/img/mark-word-icon.png[HTML5] - -= img-title - -image:http://www.w3.org/html/logo/img/mark-word-icon.png[HTML5] - -= img - -image:http://www.w3.org/html/logo/img/mark-word-icon.png[HTML5] - -= inline-code-escaping-entities - -We love `<code> and &` for everything - -= inline-code-with-visible-backtick - -`We love `code` for everything` - -= inline-code - -`We love `code` for everything` - -= line-break-2-spaces - -A first sentence -and a line break. - -= line-break-5-spaces - -A first sentence -and a line break. - -= link-automatic - -This is an automatic link http://www.w3.org/[http://www.w3.org/] - -= link-bracket-paranthesis-title - -http://www.w3.org/[W3C] - -= link-bracket-paranthesis - -http://www.w3.org/[W3C] - -= link-idref-angle-bracket - -http://www.w3.org/[World Wide Web Consortium] - -= link-idref-implicit-spaces - -http://www.w3.org/[World Wide Web Consortium] - -= link-idref-implicit - -http://www.w3.org/[w3c] - -= link-idref-space - -http://www.w3.org/[World Wide Web Consortium] - -= link-idref-title-next-line - -http://www.w3.org/[World Wide Web Consortium] -"Discover W3C" - -= link-idref-title-paranthesis - -http://www.w3.org/[World Wide Web Consortium] - -= link-idref-title-single-quote - -http://www.w3.org/[World Wide Web Consortium] - -= link-idref-title - -http://www.w3.org/[World Wide Web Consortium] - -= link-idref - -http://www.w3.org/[World Wide Web Consortium] - -= list-blockquote - -* -a list containing a blockquote -____ -this the blockquote in the list -____ - - -= list-code-1-space - -* -a -[source] ----- -b ----- - - -= list-code - -* -a list containing a block of code -[source] ----- -10 PRINT HELLO INFINITE -20 GOTO 10 ----- - - -= list-multiparagraphs-tab - -* -This is a list item with two paragraphs. Lorem ipsum dolor -sit amet, consectetuer adipiscing elit. Aliquam hendrerit -mi posuere lectus. -Vestibulum enim wisi, viverra nec, fringilla in, laoreet -vitae, risus. Donec sit amet nisl. Aliquam semper ipsum -sit amet velit. -* -Suspendisse id sem consectetuer libero luctus adipiscing. - -= list-multiparagraphs - -* -This is a list item with two paragraphs. Lorem ipsum dolor -sit amet, consectetuer adipiscing elit. Aliquam hendrerit -mi posuere lectus. -Vestibulum enim wisi, viverra nec, fringilla in, laoreet -vitae, risus. Donec sit amet nisl. Aliquam semper ipsum -sit amet velit. -* -Suspendisse id sem consectetuer libero luctus adipiscing. - -= ordered-list-escaped - -1. ordered list escape - -= ordered-list-inner-par-list - - -1. -1 -1. inner par list -1. -2 - -= ordered-list-items-random-number - - -1. list item 1 -1. list item 2 -1. list item 3 - -= ordered-list-items - - -1. list item 1 -1. list item 2 -1. list item 3 - -= paragraph-hard-return - -This is a paragraph -on multiple lines -with hard return. - -= paragraph-line - -This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. - -= paragraph-trailing-leading-spaces - -This is a paragraph with a trailing and leading space. - -= paragraph-trailing-tab - -This is a paragraph with 1 trailing tab. - -= paragraphs-2-leading-spaces - -This is a paragraph with 2 leading spaces. - -= paragraphs-3-leading-spaces - -This is a paragraph with 3 leading spaces. - -= paragraphs-leading-space - -This is a paragraph with 1 leading space. - -= paragraphs-trailing-spaces - -This is a paragraph with a trailing space. - -= strong-middle-word - -as**te**risks - -= strong-star - -*double asterisks* - -= strong-underscore - -*double underscores* - -= unordered-list-items-asterisk - -* list item 1 -* list item 2 -* list item 3 - -= unordered-list-items-dashsign - -* list item 1 -* list item 2 -* list item 3 - -= unordered-list-items-leading-1space - -* list item 1 -* list item 2 -* list item 3 - -= unordered-list-items-leading-2spaces - -* list item 1 -* list item 2 -* list item 3 - -= unordered-list-items-leading-3spaces - -* list item 1 -* list item 2 -* list item 3 - -= unordered-list-items-plussign - -* list item 1 -* list item 2 -* list item 3 - -= unordered-list-paragraphs - -* -list item in paragraph -* -another list item in paragraph - -= unordered-list-unindented-content - -* This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a list. -* and yet another long long long long long long long long long long long long long long long long long long long long long long line. - -= unordered-list-with-indented-content - -* This is a list item -with the content on -multiline and indented. -* And this another list item -with the same principle. - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= autolink-no-bracket - -http://a.com[http://a.com] - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= utf8 - -€ - -= autolink-no-bracket - -http://a.com[http://a.com] - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ - -= fenced-code-block - -[source] ----- -a ----- - - -= link-idref-implicit-no-bracket - -link:b[a] - -= utf8 - -€ \ No newline at end of file diff --git a/markdown-to-asciidoc/src/test/resources/testsuite.md b/markdown-to-asciidoc/src/test/resources/testsuite.md deleted file mode 100644 index f8497038..00000000 --- a/markdown-to-asciidoc/src/test/resources/testsuite.md +++ /dev/null @@ -1,799 +0,0 @@ -``` -summary(cars$dist) -summary(cars$speed) -``` - -# 2-paragraphs-hard-return-spaces - -This is a first paragraph, -on multiple lines. - -This is a second paragraph. -There are spaces in between the two. - -# 2-paragraphs-hard-return - -This is a first paragraph, -on multiple lines. - -This is a second paragraph -which has multiple lines too. - -# 2-paragraphs-line-returns - -A first paragraph. - - - -A second paragraph after 3 CR (carriage return). - -# 2-paragraphs-line-spaces - -This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. - -A few spaces and a new long long long long long long long long long long long long long long long long paragraph on 1 line. - -# 2-paragraphs-line-tab - -This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. - -1 tab to separate them and a new long long long long long long long long long long long long long long long long paragraph on 1 line. - -# 2-paragraphs-line - -This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. - -A new long long long long long long long long long long long long long long long long paragraph on 1 line. - -# ampersand-text-flow - -An ampersand & in the text flow is escaped as an html entity. - -# ampersand-uri - -There is an [ampersand](http://validator.w3.org/check?uri=http://www.w3.org/&verbose=1) in the URI. - -# asterisk-near-text - -This is \*an asterisk which should stay as is. - -# asterisk - -This is * an asterisk which should stay as is. - -# backslash-escape - -\\ backslash -\` backtick -\* asterisk -\_ underscore -\{\} curly braces -\[\] square brackets -\(\) parentheses -\# hash mark -\+ plus sign -\- minus sign (hyphen) -\. dot -\! exclamation mark - -# blockquote-added-markup - -> # heading level 1 -> -> paragraph - -# blockquote-line-2-paragraphs - ->A blockquote with a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line. - ->and a second very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long line. - -# blockquote-line - ->This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a blockquote. - -# blockquote-multiline-1-space-begin - -> A blockquote -> on multiple lines -> like this. - -# blockquote-multiline-1-space-end - ->A blockquote ->on multiple lines ->like this. - -# blockquote-multiline-2-paragraphs - ->A blockquote ->on multiple lines ->like this. -> ->But it has ->two paragraphs. - -# blockquote-multiline - ->A blockquote ->on multiple lines ->like this - -# blockquote-nested-multiplereturn-level1 - -> This is the first level of quoting. -> -> > This is nested blockquote. -> -> Back to the first level. - - -# blockquote-nested-multiplereturn - -> This is the first level of quoting. -> -> > This is nested blockquote. - -# blockquote-nested-return-level1 - -> This is the first level of quoting. -> > This is nested blockquote. -> Back to the first level. - - -# blockquote-nested - -> This is the first level of quoting. -> > This is nested blockquote. - - -# code-1-tab - - 10 PRINT HELLO INFINITE - 20 GOTO 10 - -# code-4-spaces-escaping - - 10 PRINT < > & - 20 GOTO 10 - -# code-4-spaces - - 10 PRINT HELLO INFINITE - 20 GOTO 10 - -# em-middle-word - -as*te*risks - -# em-star - -*single asterisks* - -# em-underscore - -_single underscores_ - -# entities-text-flow - -HTML entities are written using ampersand notation: © - -# header-level1-equal-underlined - -This is an H1 -============= - -# header-level1-hash-sign-closed - -# This is an H1 # - -# header-level1-hash-sign-trailing-1-space - - # This is an H1 - -# header-level1-hash-sign-trailing-2-spaces - -# this is an h1 with two trailing spaces -A new paragraph. - -# header-level1-hash-sign - -# This is an H1 - -# header-level2-dash-underlined - -This is an H2 -------------- - -# header-level2-hash-sign-closed - -## This is an H2 ## - -# header-level2-hash-sign - -## This is an H2 - -# header-level3-hash-sign-closed - -### This is an H3 ### - -# header-level3-hash-sign - -### This is an H3 - -# header-level4-hash-sign-closed - -#### This is an H4 #### - -# header-level4-hash-sign - -#### This is an H4 - -# header-level5-hash-sign-closed - -##### This is an H5 ##### - -# header-level5-hash-sign - -##### This is an H5 - -# header-level6-hash-sign-closed - -###### This is an H6 ###### - -# header-level6-hash-sign - -###### This is an H6 - -# horizontal-rule-3-dashes-spaces - -- - - - -# horizontal-rule-3-dashes - ---- - -# horizontal-rule-3-stars - -*** - -# horizontal-rule-3-underscores - -___ - -# horizontal-rule-7-dashes - -------- - -# img-idref-title - -![HTML5][h5] - -[h5]: http://www.w3.org/html/logo/img/mark-word-icon.png "HTML5 for everyone" - -# img-idref - -![HTML5][h5] - -[h5]: http://www.w3.org/html/logo/img/mark-word-icon.png - -# img-title - -![HTML5](http://www.w3.org/html/logo/img/mark-word-icon.png "HTML5 logo for everyone") - -# img - -![HTML5](http://www.w3.org/html/logo/img/mark-word-icon.png) - -# inline-code-escaping-entities - -We love ` and &` for everything - -# inline-code-with-visible-backtick - -``We love `code` for everything`` - -# inline-code - -``We love `code` for everything`` - -# line-break-2-spaces - -A first sentence -and a line break. - -# line-break-5-spaces - -A first sentence -and a line break. - -# link-automatic - -This is an automatic link - -# link-bracket-paranthesis-title - -[W3C](http://www.w3.org/ "Discover w3c") - -# link-bracket-paranthesis - -[W3C](http://www.w3.org/) - -# link-idref-angle-bracket - -[World Wide Web Consortium][w3c] - -[w3c]: - -# link-idref-implicit-spaces - -[World Wide Web Consortium][] - -[World Wide Web Consortium]: http://www.w3.org/ - -# link-idref-implicit - -[w3c][] - -[w3c]: http://www.w3.org/ - -# link-idref-space - -[World Wide Web Consortium] [w3c] - -[w3c]: http://www.w3.org/ - -# link-idref-title-next-line - -[World Wide Web Consortium][w3c] - -[w3c]: http://www.w3.org/ - "Discover W3C" - -# link-idref-title-paranthesis - -[World Wide Web Consortium][w3c] - -[w3c]: http://www.w3.org/ (Discover w3c) - -# link-idref-title-single-quote - -[World Wide Web Consortium][w3c] - -[w3c]: http://www.w3.org/ 'Discover w3c' - -# link-idref-title - -[World Wide Web Consortium][w3c] - -[w3c]: http://www.w3.org/ "Discover w3c" - -# link-idref - -[World Wide Web Consortium][w3c] - -[w3c]: http://www.w3.org/ - -# list-blockquote - -* a list containing a blockquote - - > this the blockquote in the list - -# list-code-1-space - -* a - - b - - -# list-code - -* a list containing a block of code - - 10 PRINT HELLO INFINITE - 20 GOTO 10 - -# list-multiparagraphs-tab - -* This is a list item with two paragraphs. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. Aliquam hendrerit - mi posuere lectus. - - Vestibulum enim wisi, viverra nec, fringilla in, laoreet - vitae, risus. Donec sit amet nisl. Aliquam semper ipsum - sit amet velit. - -* Suspendisse id sem consectetuer libero luctus adipiscing. - -# list-multiparagraphs - -* This is a list item with two paragraphs. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. Aliquam hendrerit - mi posuere lectus. - - Vestibulum enim wisi, viverra nec, fringilla in, laoreet - vitae, risus. Donec sit amet nisl. Aliquam semper ipsum - sit amet velit. - -* Suspendisse id sem consectetuer libero luctus adipiscing. - -# ordered-list-escaped - -1\. ordered list escape - -# ordered-list-inner-par-list - -1. 1 - - - inner par list - -2. 2 - - -# ordered-list-items-random-number - -1. list item 1 -8. list item 2 -1. list item 3 - -# ordered-list-items - -1. list item 1 -2. list item 2 -3. list item 3 - -# paragraph-hard-return - -This is a paragraph -on multiple lines -with hard return. - -# paragraph-line - -This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph on 1 line. - -# paragraph-trailing-leading-spaces - - This is a paragraph with a trailing and leading space. - -# paragraph-trailing-tab - -This is a paragraph with 1 trailing tab. - -# paragraphs-2-leading-spaces - - This is a paragraph with 2 leading spaces. - -# paragraphs-3-leading-spaces - - This is a paragraph with 3 leading spaces. - -# paragraphs-leading-space - - This is a paragraph with 1 leading space. - -# paragraphs-trailing-spaces - -This is a paragraph with a trailing space. - -# strong-middle-word - -as**te**risks - -# strong-star - -**double asterisks** - -# strong-underscore - -__double underscores__ - -# unordered-list-items-asterisk - -* list item 1 -* list item 2 -* list item 3 - - -# unordered-list-items-dashsign - -- list item 1 -- list item 2 -- list item 3 - -# unordered-list-items-leading-1space - - * list item 1 - * list item 2 - * list item 3 - -# unordered-list-items-leading-2spaces - - * list item 1 - * list item 2 - * list item 3 - -# unordered-list-items-leading-3spaces - - * list item 1 - * list item 2 - * list item 3 - -# unordered-list-items-plussign - -+ list item 1 -+ list item 2 -+ list item 3 - -# unordered-list-paragraphs - -* list item in paragraph - -* another list item in paragraph - -# unordered-list-unindented-content - -* This a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long paragraph in a list. -* and yet another long long long long long long long long long long long long long long long long long long long long long long line. - -# unordered-list-with-indented-content - -* This is a list item - with the content on - multiline and indented. -* And this another list item - with the same principle. - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# autolink-no-bracket - -http://a.com - - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# utf8 - -€ - -# autolink-no-bracket - -http://a.com - - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - -# fenced-code-block - -``` -a -``` - -# link-idref-implicit-no-bracket - -[a] - -[a]: b - - -# utf8 - -€ - diff --git a/markdownToAsciidoc/README.adoc b/markdownToAsciidoc/README.adoc new file mode 100644 index 00000000..c2903423 --- /dev/null +++ b/markdownToAsciidoc/README.adoc @@ -0,0 +1,31 @@ += Markdown to AsciiDoc converter + +A small, lightweight converter for Markdown to http://www.asciidoc.org[AsciiDoc] written in Java, and using Javascript. + +It's a fork from https://github.com/asciidocfx/MarkdownToAsciidoc/tree/master[Github] + +We added Graal dependences to run JS without using Java 8 JVM compiler. + +== Usage + +To use the library, call the following: + +.Synchronous way +[source,java] +---- +String result = MarkdownToAsciidoc.convert("# Tittle"); +---- + +.Asynchronous way +[source,java] +---- +MarkdownToAsciidoc.convert("# Tittle", r -> { + System.out.println(r); +}); +---- + +.Path way +[source,java] +---- +Path outputPath = Paths.get("C:\\output.asciidoc"); +MarkdownToAsciidoc.convert("# Tittle", outputPath); +---- \ No newline at end of file diff --git a/markdownToAsciidoc/pom.xml b/markdownToAsciidoc/pom.xml new file mode 100644 index 00000000..ace6f4e7 --- /dev/null +++ b/markdownToAsciidoc/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + + io.github.Riduidel.aadarchi + system + 0.1.12-SNAPSHOT + + MarkdownToAsciidoc + Aadarchi : Markdown to Asciidoc + + + + org.graalvm.js + js + 22.0.0 + + + org.graalvm.js + js-scriptengine + 22.0.0 + + + + + \ No newline at end of file diff --git a/markdownToAsciidoc/src/main/java/com/kodcu/asciidocfx/ConversionException.java b/markdownToAsciidoc/src/main/java/com/kodcu/asciidocfx/ConversionException.java new file mode 100644 index 00000000..777303a8 --- /dev/null +++ b/markdownToAsciidoc/src/main/java/com/kodcu/asciidocfx/ConversionException.java @@ -0,0 +1,12 @@ +package com.kodcu.asciidocfx; + +import javax.script.ScriptException; + +/** + * Created by usta on 15.03.2015. + */ +public class ConversionException extends RuntimeException { + public ConversionException(Exception e) { + super(e); + } +} diff --git a/markdownToAsciidoc/src/main/java/com/kodcu/asciidocfx/MarkdownToAsciidoc.java b/markdownToAsciidoc/src/main/java/com/kodcu/asciidocfx/MarkdownToAsciidoc.java new file mode 100644 index 00000000..23cd03b0 --- /dev/null +++ b/markdownToAsciidoc/src/main/java/com/kodcu/asciidocfx/MarkdownToAsciidoc.java @@ -0,0 +1,114 @@ +package com.kodcu.asciidocfx; + + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import java.io.*; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +/** + * Created by usta on 15.03.2015. + */ +public class MarkdownToAsciidoc { + + private static final ScriptEngineManager engineManager = new ScriptEngineManager(); + private static final ScriptEngine engine = engineManager.getEngineByName("graal.js"); + + static { + + try (InputStream markedStream = MarkdownToAsciidoc.class.getResourceAsStream("/marked.js"); + InputStream markedExtensionStream = MarkdownToAsciidoc.class.getResourceAsStream("/marked-extension.js"); + InputStreamReader markedIn = new InputStreamReader(markedStream, "UTF-8"); + InputStreamReader markedExtensionIn = new InputStreamReader(markedExtensionStream, "UTF-8"); + BufferedReader markedReader = new BufferedReader(markedIn); + BufferedReader markedExtensionReader = new BufferedReader(markedExtensionIn);) { + + String markedScript = markedReader.lines().collect(Collectors.joining("\n")); + String markedExtensionScript = markedExtensionReader.lines().collect(Collectors.joining("\n")); + + engine.eval(markedScript); + engine.eval(markedExtensionScript); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static String convert(String markdown) { + try { + engine.put("markdown", markdown); + return (String) engine.eval("markdownToAsciidoc(markdown)"); + } catch (Exception e) { + throw new ConversionException(e); + } + } + + public static String convert(Path markdownPath) { + try { + List markdownContent = Files.readAllLines(markdownPath); + String markdown = String.join("\n", markdownContent); + engine.put("markdown", markdown); + return (String) engine.eval("markdownToAsciidoc(markdown)"); + } catch (Exception e) { + throw new ConversionException(e); + } + } + + public static void convert(Path markdownPath, Path asciidocPath, StandardOpenOption... openOption) { + + try { + String markdownContent = convert(markdownPath); + Files.write(asciidocPath, markdownContent.getBytes(Charset.forName("UTF-8")), openOption); + } catch (IOException e) { + throw new ConversionException(e); + } + } + + public static void convert(File markdownFile, File asciidocFile, StandardOpenOption... openOption) { + convert(markdownFile.toPath(), asciidocFile.toPath(), openOption); + } + + public static void convert(Path markdownPath, Consumer resultCallback) { + + CompletableFuture.runAsync(() -> { + resultCallback.accept(convert(markdownPath)); + }); + + } + + public static String convert(File markdownFile) { + return convert(markdownFile.toPath()); + } + + public static void convert(File markdownFile, Consumer resultCallback) { + CompletableFuture.runAsync(() -> { + resultCallback.accept(convert(markdownFile)); + }); + } + + public static void convert(String markdown, Consumer resultCallback) { + CompletableFuture.runAsync(() -> { + resultCallback.accept(convert(markdown)); + }); + } + + public static void convert(String markdown, Path asciidocPath, StandardOpenOption... openOption) { + try { + String markdownContent = convert(markdown); + Files.write(asciidocPath, markdownContent.getBytes(Charset.forName("UTF-8")), openOption); + } catch (IOException e) { + throw new ConversionException(e); + } + } + + public static void convert(String markdown, File asciidocFile, StandardOpenOption... openOption) { + convert(markdown, asciidocFile.toPath(), openOption); + } +} diff --git a/markdownToAsciidoc/src/main/resources/marked-extension.js b/markdownToAsciidoc/src/main/resources/marked-extension.js new file mode 100644 index 00000000..1fb50e01 --- /dev/null +++ b/markdownToAsciidoc/src/main/resources/marked-extension.js @@ -0,0 +1,126 @@ +var md2AscRenderer = new marked.Renderer(); + +md2AscRenderer.heading = function (text, level) { + return "\n" + repeatStuff("=", level) + " " + text + "\n"; +}; +md2AscRenderer.hr = function () { + return "\n'''\n"; +}; + +md2AscRenderer.list = function (body, ordered) { + body = body.replace(/(\r\n|\r|\n|\t)/, ""); + + var include = body.match(/include::.*?\[.*?\]/ig); + if (include) { + return body.replace(/\$list-start\$/g, "\n\n"); + } + + var symbol = ordered ? ". " : "* "; + return body.replace(/\$list-start\$/g, "\n" + symbol); +}; + +md2AscRenderer.listitem = function (text) { + return '$list-start$' + text.replace(/(\r\n|\r|\n)/, "").trim(); +}; + +function replaceTags(text, tag, first, second) { + var match = text.match(new RegExp("<" + tag + ">(.*?)<\/" + tag + ">", "ig")) || []; + match.forEach(function (item) { + text = text.replace(item, item.replace("<" + tag + ">", first).replace("", second)); + }); + return text; +} + +md2AscRenderer.paragraph = function (text) { + text = replaceTags(text, "u", "+++", "+++"); + text = replaceTags(text, "sub", "~", "~"); + text = replaceTags(text, "sup", "^", "^"); + + // if ise hatalı + //return "\n[%hardbreaks]"; + return "\n" + text + "\n"; +}; + +md2AscRenderer.table = function (header, body) { + var headerContent = "\n[width=\"100%\",options=\"header\"]"; + var start = "\n|===="; + var end = "\n|====\n"; + return headerContent + start + header + body + end; +}; + +md2AscRenderer.tablerow = function (content) { + return "\n" + content; +}; + +md2AscRenderer.tablecell = function (content, flags) { + return "| " + content + " "; +}; + +md2AscRenderer.blockquote = function (quote) { + return "\n\n[quote]\n____" + quote + "\n____\n\n"; +}; + +md2AscRenderer.code = function (code, lang, escaped) { + if (!lang) { + return "\n\n----\n" + code + "\n----\n\n" + } + return "\n\n[source," + lang + "]\n----\n" + code + "\n----\n\n"; +}; + +md2AscRenderer.codespan = function (text) { + //text = text.replace(/\*/g, "\\*"); + text = text.replace(/\*\*/g, "{asterisk}{asterisk}"); + if ((text.match(/#/g) || "").length % 2 == 1) + text = text.replace(/#/g, "\\#"); + + return "`" + text + "`"; +}; + +md2AscRenderer.strong = function (text) { + return '**' + text + '**'; +}; + +md2AscRenderer.em = function (text) { + return '__' + text + '__'; +}; + +md2AscRenderer.br = function (text) { + return text + ' +\n'; +}; + +md2AscRenderer.del = function (text) { + return '+++' + text + '+++'; +}; + +md2AscRenderer.link = function (href, title, text) { + var relative = !href.match(/(https?|ftp|irc|mailto|email).*/); + var markupFile = href.match(/.*\.(asc|asciidoc|adoc|md|markdown|ad)$/ig); + + return "\n" + ( relative ? (markupFile ? "include::" : "link:") : "") + href + "[" + text + "]\n"; +}; + +md2AscRenderer.image = function (href, title, text) { + var alt = text ? "alt=" + text + (title ? "," : "") : ""; + var imageTitle = title ? "title=" + title : ""; + return "\nimage::" + href + "[" + alt + imageTitle + "]\n"; +}; + +function markdownToAsciidoc(input) { + var result = ""; + try { + var result = marked(input, {renderer: md2AscRenderer}); + } + catch (e) { + throw e; + } + return result; +} + +function repeatStuff(s, n) { + var a = []; + while (a.length < n) { + a.push(s); + } + return a.join(''); +} + diff --git a/markdownToAsciidoc/src/main/resources/marked.js b/markdownToAsciidoc/src/main/resources/marked.js new file mode 100644 index 00000000..9f2ae1b4 --- /dev/null +++ b/markdownToAsciidoc/src/main/resources/marked.js @@ -0,0 +1,1123 @@ +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ + +var window = {}; + +;(function() { + + /** + * Block-Level Grammar + */ + + var block = { + newline: /^\n+/, + code: /^( {4}[^\n]+\n*)+/, + fences: noop, + hr: /^( *[-*_]){3,} *(?:\n+|$)/, + heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, + nptable: noop, + blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, + list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, + def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, + table: noop, + paragraph: /^((?:[^\n]+\n?(?!hr|heading|blockquote|tag|def))+)\n*/, + text: /^[^\n]+/ + }; + + block.bullet = /(?:[*+-]|\d+\.)/; + block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; + block.item = replace(block.item, 'gm') + (/bull/g, block.bullet) + (); + + block.list = replace(block.list) + (/bull/g, block.bullet) + ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') + ('def', '\\n+(?=' + block.def.source + ')') + (); + + block.blockquote = replace(block.blockquote) + ('def', block.def) + (); + + block._tag = '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; + + block.html = replace(block.html) + ('comment', //) + ('closed', /<(tag)[\s\S]+?<\/\1>/) + ('closing', /])*?>/) + (/tag/g, block._tag) + (); + + block.paragraph = replace(block.paragraph) + ('hr', block.hr) + ('heading', block.heading) + ('blockquote', block.blockquote) + ('tag', '<' + block._tag) + ('def', block.def) + (); + + /** + * Normal Block Grammar + */ + + block.normal = merge({}, block); + + /** + * GFM Block Grammar + */ + + block.gfm = merge({}, block.normal, { + fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, + paragraph: /^/ + }); + + block.gfm.paragraph = replace(block.paragraph) + ('(?!', '(?!' + + block.gfm.fences.source.replace('\\1', '\\2') + '|' + + block.list.source.replace('\\1', '\\3') + '|') + (); + + /** + * GFM + Tables Block Grammar + */ + + block.tables = merge({}, block.gfm, { + nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, + table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ + }); + + /** + * Block Lexer + */ + + function Lexer(options) { + this.tokens = []; + this.tokens.links = {}; + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.gfm) { + if (this.options.tables) { + this.rules = block.tables; + } else { + this.rules = block.gfm; + } + } + } + + /** + * Expose Block Rules + */ + + Lexer.rules = block; + + /** + * Static Lex Method + */ + + Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); + }; + + /** + * Preprocessing + */ + + Lexer.prototype.lex = function(src) { + src = src + .replace(/\r\n|\r/g, '\n') + .replace(/\t/g, ' ') + .replace(/\u00a0/g, ' ') + .replace(/\u2424/g, '\n'); + + return this.token(src, true); + }; + + /** + * Lexing + */ + + Lexer.prototype.token = function(src, top, bq) { + var src = src.replace(/^ +$/gm, '') + , next + , loose + , cap + , bull + , b + , item + , space + , i + , l; + + while (src) { + // newline + if (cap = this.rules.newline.exec(src)) { + src = src.substring(cap[0].length); + if (cap[0].length > 1) { + this.tokens.push({ + type: 'space' + }); + } + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + cap = cap[0].replace(/^ {4}/gm, ''); + this.tokens.push({ + type: 'code', + text: !this.options.pedantic + ? cap.replace(/\n+$/, '') + : cap + }); + continue; + } + + // fences (gfm) + if (cap = this.rules.fences.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'code', + lang: cap[2], + text: cap[3] + }); + continue; + } + + // heading + if (cap = this.rules.heading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[1].length, + text: cap[2] + }); + continue; + } + + // table no leading pipe (gfm) + if (top && (cap = this.rules.nptable.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i].split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // hr + if (cap = this.rules.hr.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'hr' + }); + continue; + } + + // blockquote + if (cap = this.rules.blockquote.exec(src)) { + src = src.substring(cap[0].length); + + this.tokens.push({ + type: 'blockquote_start' + }); + + cap = cap[0].replace(/^ *> ?/gm, ''); + + // Pass `top` to keep the current + // "toplevel" state. This is exactly + // how markdown.pl works. + this.token(cap, top, true); + + this.tokens.push({ + type: 'blockquote_end' + }); + + continue; + } + + // list + if (cap = this.rules.list.exec(src)) { + src = src.substring(cap[0].length); + bull = cap[2]; + + this.tokens.push({ + type: 'list_start', + ordered: bull.length > 1 + }); + + // Get each top-level item. + cap = cap[0].match(this.rules.item); + + next = false; + l = cap.length; + i = 0; + + for (; i < l; i++) { + item = cap[i]; + + // Remove the list item's bullet + // so it is seen as the next token. + space = item.length; + item = item.replace(/^ *([*+-]|\d+\.) +/, ''); + + // Outdent whatever the + // list item contains. Hacky. + if (~item.indexOf('\n ')) { + space -= item.length; + item = !this.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether the next list item belongs here. + // Backpedal if it does not belong in this list. + if (this.options.smartLists && i !== l - 1) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull !== b && !(bull.length > 1 && b.length > 1)) { + src = cap.slice(i + 1).join('\n') + src; + i = l - 1; + } + } + + // Determine whether item is loose or not. + // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ + // for discount behavior. + loose = next || /\n\n(?!\s*$)/.test(item); + if (i !== l - 1) { + next = item.charAt(item.length - 1) === '\n'; + if (!loose) loose = next; + } + + this.tokens.push({ + type: loose + ? 'loose_item_start' + : 'list_item_start' + }); + + // Recurse. + this.token(item, false, bq); + + this.tokens.push({ + type: 'list_item_end' + }); + } + + this.tokens.push({ + type: 'list_end' + }); + + continue; + } + + // html + if (cap = this.rules.html.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: this.options.sanitize + ? 'paragraph' + : 'html', + pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', + text: cap[0] + }); + continue; + } + + // def + if ((!bq && top) && (cap = this.rules.def.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.links[cap[1].toLowerCase()] = { + href: cap[2], + title: cap[3] + }; + continue; + } + + // table (gfm) + if (top && (cap = this.rules.table.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i] + .replace(/^ *\| *| *\| *$/g, '') + .split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // top-level paragraph + if (top && (cap = this.rules.paragraph.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'paragraph', + text: cap[1].charAt(cap[1].length - 1) === '\n' + ? cap[1].slice(0, -1) + : cap[1] + }); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + // Top-level should never reach here. + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'text', + text: cap[0] + }); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return this.tokens; + }; + + /** + * Inline-Level Grammar + */ + + var inline = { + escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, + autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, + url: noop, + tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, + link: /^!?\[(inside)\]\(href\)/, + reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, + nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, + strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, + em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, + code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, + br: /^ {2,}\n(?!\s*$)/, + del: noop, + text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; + + inline.link = replace(inline.link) + ('inside', inline._inside) + ('href', inline._href) + (); + + inline.reflink = replace(inline.reflink) + ('inside', inline._inside) + (); + + /** + * Normal Inline Grammar + */ + + inline.normal = merge({}, inline); + + /** + * Pedantic Inline Grammar + */ + + inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ + }); + + /** + * GFM Inline Grammar + */ + + inline.gfm = merge({}, inline.normal, { + escape: replace(inline.escape)('])', '~|])')(), + url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, + del: /^~~(?=\S)([\s\S]*?\S)~~/, + text: replace(inline.text) + (']|', '~]|') + ('|', '|https?://|') + () + }); + + /** + * GFM + Line Breaks Inline Grammar + */ + + inline.breaks = merge({}, inline.gfm, { + br: replace(inline.br)('{2,}', '*')(), + text: replace(inline.gfm.text)('{2,}', '*')() + }); + + /** + * Inline Lexer & Compiler + */ + + function InlineLexer(links, options) { + this.options = options || marked.defaults; + this.links = links; + this.rules = inline.normal; + this.renderer = this.options.renderer || new Renderer; + this.renderer.options = this.options; + + if (!this.links) { + throw new + Error('Tokens array requires a `links` property.'); + } + + if (this.options.gfm) { + if (this.options.breaks) { + this.rules = inline.breaks; + } else { + this.rules = inline.gfm; + } + } else if (this.options.pedantic) { + this.rules = inline.pedantic; + } + } + + /** + * Expose Inline Rules + */ + + InlineLexer.rules = inline; + + /** + * Static Lexing/Compiling Method + */ + + InlineLexer.output = function(src, links, options) { + var inline = new InlineLexer(links, options); + return inline.output(src); + }; + + /** + * Lexing/Compiling + */ + + InlineLexer.prototype.output = function(src) { + var out = '' + , link + , text + , href + , cap; + + while (src) { + // escape + if (cap = this.rules.escape.exec(src)) { + src = src.substring(cap[0].length); + out += cap[1]; + continue; + } + + // autolink + if (cap = this.rules.autolink.exec(src)) { + src = src.substring(cap[0].length); + if (cap[2] === '@') { + text = cap[1].charAt(6) === ':' + ? this.mangle(cap[1].substring(7)) + : this.mangle(cap[1]); + href = this.mangle('mailto:') + text; + } else { + text = escape(cap[1]); + href = text; + } + out += this.renderer.link(href, null, text); + continue; + } + + // url (gfm) + if (!this.inLink && (cap = this.rules.url.exec(src))) { + src = src.substring(cap[0].length); + text = escape(cap[1]); + href = text; + out += this.renderer.link(href, null, text); + continue; + } + + // tag + if (cap = this.rules.tag.exec(src)) { + if (!this.inLink && /^/i.test(cap[0])) { + this.inLink = false; + } + src = src.substring(cap[0].length); + out += this.options.sanitize + ? escape(cap[0]) + : cap[0]; + continue; + } + + // link + if (cap = this.rules.link.exec(src)) { + src = src.substring(cap[0].length); + this.inLink = true; + out += this.outputLink(cap, { + href: cap[2], + title: cap[3] + }); + this.inLink = false; + continue; + } + + // reflink, nolink + if ((cap = this.rules.reflink.exec(src)) + || (cap = this.rules.nolink.exec(src))) { + src = src.substring(cap[0].length); + link = (cap[2] || cap[1]).replace(/\s+/g, ' '); + link = this.links[link.toLowerCase()]; + if (!link || !link.href) { + out += cap[0].charAt(0); + src = cap[0].substring(1) + src; + continue; + } + this.inLink = true; + out += this.outputLink(cap, link); + this.inLink = false; + continue; + } + + // strong + if (cap = this.rules.strong.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.strong(this.output(cap[2] || cap[1])); + continue; + } + + // em + if (cap = this.rules.em.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.em(this.output(cap[2] || cap[1])); + continue; + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.codespan(escape(cap[2], true)); + continue; + } + + // br + if (cap = this.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.br(); + continue; + } + + // del (gfm) + if (cap = this.rules.del.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.del(this.output(cap[1])); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + src = src.substring(cap[0].length); + out += escape(this.smartypants(cap[0])); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return out; + }; + + /** + * Compile Link + */ + + InlineLexer.prototype.outputLink = function(cap, link) { + var href = escape(link.href) + , title = link.title ? escape(link.title) : null; + + return cap[0].charAt(0) !== '!' + ? this.renderer.link(href, title, this.output(cap[1])) + : this.renderer.image(href, title, escape(cap[1])); + }; + + /** + * Smartypants Transformations + */ + + InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/--/g, '\u2014') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); + }; + + /** + * Mangle Links + */ + + InlineLexer.prototype.mangle = function(text) { + var out = '' + , l = text.length + , i = 0 + , ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); + } + out += '&#' + ch + ';'; + } + + return out; + }; + + /** + * Renderer + */ + + function Renderer(options) { + this.options = options || {}; + } + + + + /** + * Parsing & Compiling + */ + + function Parser(options) { + this.tokens = []; + this.token = null; + this.options = options || marked.defaults; + this.options.renderer = this.options.renderer || new Renderer; + this.renderer = this.options.renderer; + this.renderer.options = this.options; + } + + /** + * Static Parse Method + */ + + Parser.parse = function(src, options, renderer) { + var parser = new Parser(options, renderer); + return parser.parse(src); + }; + + /** + * Parse Loop + */ + + Parser.prototype.parse = function(src) { + this.inline = new InlineLexer(src.links, this.options, this.renderer); + this.tokens = src.reverse(); + + var out = ''; + while (this.next()) { + out += this.tok(); + } + + return out; + }; + + /** + * Next Token + */ + + Parser.prototype.next = function() { + return this.token = this.tokens.pop(); + }; + + /** + * Preview Next Token + */ + + Parser.prototype.peek = function() { + return this.tokens[this.tokens.length - 1] || 0; + }; + + /** + * Parse Text Tokens + */ + + Parser.prototype.parseText = function() { + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this.next().text; + } + + return this.inline.output(body); + }; + + /** + * Parse Current Token + */ + + Parser.prototype.tok = function() { + switch (this.token.type) { + case 'space': { + return ''; + } + case 'hr': { + return this.renderer.hr(); + } + case 'heading': { + return this.renderer.heading( + this.inline.output(this.token.text), + this.token.depth, + this.token.text); + } + case 'code': { + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); + } + case 'table': { + var header = '' + , body = '' + , i + , row + , cell + , flags + , j; + + // header + cell = ''; + for (i = 0; i < this.token.header.length; i++) { + flags = { header: true, align: this.token.align[i] }; + cell += this.renderer.tablecell( + this.inline.output(this.token.header[i]), + { header: true, align: this.token.align[i] } + ); + } + header += this.renderer.tablerow(cell); + + for (i = 0; i < this.token.cells.length; i++) { + row = this.token.cells[i]; + + cell = ''; + for (j = 0; j < row.length; j++) { + cell += this.renderer.tablecell( + this.inline.output(row[j]), + { header: false, align: this.token.align[j] } + ); + } + + body += this.renderer.tablerow(cell); + } + return this.renderer.table(header, body); + } + case 'blockquote_start': { + var body = ''; + + while (this.next().type !== 'blockquote_end') { + body += this.tok(); + } + + return this.renderer.blockquote(body); + } + case 'list_start': { + var body = '' + , ordered = this.token.ordered; + + while (this.next().type !== 'list_end') { + body += this.tok(); + } + + return this.renderer.list(body, ordered); + } + case 'list_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.token.type === 'text' + ? this.parseText() + : this.tok(); + } + + return this.renderer.listitem(body); + } + case 'loose_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.tok(); + } + + return this.renderer.listitem(body); + } + case 'html': { + var html = !this.token.pre && !this.options.pedantic + ? this.inline.output(this.token.text) + : this.token.text; + return this.renderer.html(html); + } + case 'paragraph': { + return this.renderer.paragraph(this.inline.output(this.token.text)); + } + case 'text': { + return this.renderer.paragraph(this.parseText()); + } + } + }; + + /** + * Helpers + */ + + function escape(html, encode) { + return html; + } + + function unescape(html) { + return html.replace(/&([#\w]+);/g, function(_, n) { + n = n.toLowerCase(); + if (n === 'colon') return ':'; + if (n.charAt(0) === '#') { + return n.charAt(1) === 'x' + ? String.fromCharCode(parseInt(n.substring(2), 16)) + : String.fromCharCode(+n.substring(1)); + } + return ''; + }); + } + + function replace(regex, opt) { + regex = regex.source; + opt = opt || ''; + return function self(name, val) { + if (!name) return new RegExp(regex, opt); + val = val.source || val; + val = val.replace(/(^|[^\[])\^/g, '$1'); + regex = regex.replace(name, val); + return self; + }; + } + + function noop() {} + noop.exec = noop; + + function merge(obj) { + var i = 1 + , target + , key; + + for (; i < arguments.length; i++) { + target = arguments[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } + } + } + + return obj; + } + + + /** + * Marked + */ + + function marked(src, opt, callback) { + if (callback || typeof opt === 'function') { + if (!callback) { + callback = opt; + opt = null; + } + + opt = merge({}, marked.defaults, opt || {}); + + var highlight = opt.highlight + , tokens + , pending + , i = 0; + + try { + tokens = Lexer.lex(src, opt) + } catch (e) { + return callback(e); + } + + pending = tokens.length; + + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); + } + + var out; + + try { + out = Parser.parse(tokens, opt); + } catch (e) { + err = e; + } + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) return done(); + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { + return --pending || done(); + } + return highlight(token.text, token.lang, function(err, code) { + if (err) return done(err); + if (code == null || code === token.text) { + return --pending || done(); + } + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); + } + + return; + } + try { + if (opt) opt = merge({}, marked.defaults, opt); + return Parser.parse(Lexer.lex(src, opt), opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/chjj/marked.'; + if ((opt || marked.defaults).silent) { + return '

An error occured:

'
+                    + escape(e.message + '', true)
+                    + '
'; + } + throw e; + } + } + + /** + * Options + */ + + marked.options = + marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; + }; + + marked.defaults = { + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: false, + smartLists: false, + silent: false, + highlight: null, + langPrefix: 'lang-', + smartypants: false, + headerPrefix: '', + renderer: new Renderer, + xhtml: false + }; + + /** + * Expose + */ + + marked.Parser = Parser; + marked.parser = Parser.parse; + + marked.Renderer = Renderer; + + marked.Lexer = Lexer; + marked.lexer = Lexer.lex; + + marked.InlineLexer = InlineLexer; + marked.inlineLexer = InlineLexer.output; + + marked.parse = marked; + + if (typeof module !== 'undefined' && typeof exports === 'object') { + module.exports = marked; + } else if (typeof define === 'function' && define.amd) { + define(function() { return marked; }); + } else { + this.marked = marked; + } + +}).call(function() { + return this || (typeof window !== 'undefined' ? window : global); + }()); diff --git a/maven-metadata-inferer/pom.xml b/maven-metadata-inferer/pom.xml index 655b4866..5eb7a479 100644 --- a/maven-metadata-inferer/pom.xml +++ b/maven-metadata-inferer/pom.xml @@ -1,11 +1,9 @@ - + 4.0.0 io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT maven-metadata-inferer Aadarchi : Maven metadata inferer @@ -44,11 +42,10 @@ ${project.version} test
- - org.json - json - 20230618 + com.fasterxml.jackson.core + jackson-databind + 2.15.2 @@ -66,8 +63,7 @@ Download popular artifacts - - ${project.build.directory}/generated/resources/mvnrepository/artifacts.json + @@ -87,8 +83,14 @@ good --> false + true + true mvnrepository.json + + 10000 + + 10 diff --git a/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenEnhancer.java b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenEnhancer.java index 990ed50e..879f014b 100644 --- a/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenEnhancer.java +++ b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenEnhancer.java @@ -1,7 +1,11 @@ package org.ndx.aadarchi.inferer.maven; +import java.util.Map; + import org.ndx.aadarchi.base.enhancers.ModelElementKeys; +import com.fasterxml.jackson.core.type.TypeReference; + public interface MavenEnhancer { /** * URL of the maven pom the model element represents. @@ -29,4 +33,7 @@ public interface MavenEnhancer { * When set, this allows users to enter a list of profiles names separated by ";" */ String AGILE_ARCHITECTURE_MAVEN_ADDITIONAL_PROFILES = ModelElementKeys.PREFIX+"maven.profiles"; + + String AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES = ModelElementKeys.PREFIX+"maven.technologies"; + TypeReference> AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES_TYPE = new TypeReference>() {}; } diff --git a/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenPomDecorator.java b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenPomDecorator.java index b4d553d2..211af614 100644 --- a/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenPomDecorator.java +++ b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenPomDecorator.java @@ -1,14 +1,10 @@ package org.ndx.aadarchi.inferer.maven; import java.util.Arrays; -import java.util.HashSet; -import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.Set; -import java.util.TreeSet; import java.util.function.BiFunction; import java.util.logging.Logger; import java.util.stream.Collectors; @@ -17,22 +13,18 @@ import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Default; import javax.inject.Inject; -import javax.inject.Named; import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemException; import org.apache.commons.vfs2.FileSystemManager; -import org.apache.maven.model.Dependency; import org.apache.maven.model.IssueManagement; import org.apache.maven.model.Scm; import org.apache.maven.project.MavenProject; -import org.json.JSONObject; import org.ndx.aadarchi.base.enhancers.ModelElementKeys; +import org.ndx.aadarchi.inferer.maven.technologies.TechnologyDecorator; import com.pivovarit.function.ThrowingFunction; import com.pivovarit.function.ThrowingPredicate; -import com.structurizr.model.Component; -import com.structurizr.model.Container; import com.structurizr.model.Element; @Default @@ -42,7 +34,7 @@ public class MavenPomDecorator { @Inject FileSystemManager fileSystemManager; - @Inject @Named(MvnRepositoryArtifactsProducer.MVNREPOSITORY_ARTIFACTS) JSONObject mvnRepositoryArtifacts; + @Inject TechnologyDecorator technologyDecorator; public static void decorateRecursively(MavenProject project, BiFunction, Boolean> consumer) { decorateRecursively(project, new LinkedList(), consumer); @@ -72,7 +64,7 @@ public void decorate(Element element, MavenProject mavenProject) { decorateJavaSource(element, mavenProject); decorateJavaPackage(element, mavenProject); decorateMavenProperties(element, mavenProject); - decorateTechnology(element, mavenProject); + technologyDecorator.decorateTechnology(element, mavenProject); Optional.ofNullable(mavenProject.getDescription()).stream() .forEach(description -> element.setDescription(description.replaceAll("\n", " "))); } @@ -177,98 +169,4 @@ private String findFirstPackageLevelInPath(FileObject root, FileObject current) .toString() .replace('/', '.').replace('\\', '.'); } - - protected static String technologyWithVersionFromProperty(MavenProject mavenProject, String technology, String... propertyNames) { - return technology + Stream.of(propertyNames) - .flatMap(p -> new HashSet(Arrays.asList(p, p.replace('.', '-'), p.replace('-', '.'))).stream()) - .filter(p -> mavenProject.getProperties().containsKey(p)) - .map(p -> mavenProject.getProperties().get(p)) - .map(text -> " "+text) - .findFirst() - .orElse("") - ; - } - - /** - * TODO replace that with usage of {@link #mvnRepositoryArtifacts} - * @param project - * @return - */ - public static Set doDecorateTechnology(MavenProject project) { - Set technologies = new LinkedHashSet(); - switch (project.getPackaging()) { - case "ear": - technologies.add("Java"); - technologies.add("ear"); - break; - case "war": - technologies.add("Java"); - technologies.add("war"); - case "jar": - // If there is a java version property, use it to detect Java version - technologies.add(MavenPomDecorator.technologyWithVersionFromProperty(project, "Java", "java.version", "maven.compiler.target")); - break; - case "pom": - break; - default: - logger.warning(String.format( - "Maven component %s uses packaging %s which we don't know. Please submit a bug to aadarchi-documentation-system to have this particular packaging correctly handled", - project, project.getPackaging())); - } - for (Dependency dependency : (List) project.getDependencies()) { - switch (dependency.getGroupId()) { - case "org.apache.maven": - if("maven-plugin-api".equals(dependency.getArtifactId())) { - technologies.add("maven-plugin"); - } - break; - case "io.quarkus": - technologies.add(MavenPomDecorator.technologyWithVersionFromProperty(project, "Quarkus", "quarkus.platform.version")); - break; - case "org.springframework": - technologies.add("Spring"); - break; - case "org.apache.camel": - technologies.add(MavenPomDecorator.technologyWithVersionFromProperty(project, "Apache Camel", "camel.version")); - break; - case "org.springframework.boot": - technologies.add("Spring Boot"); - break; - case "com.google.gwt": - technologies.add("GWT"); - break; - case "javax.enterprise": - if("cdi-api".equals(dependency.getArtifactId())) { - technologies.add("CDI"); - } - break; - } - } - return technologies; - } - - /** - * @param element element for which we want the technologies - * @param project - * @return a string giving details about important project infos - */ - public void decorateTechnology(Element element, MavenProject project) { - // TODO replace simple set with something more complex - // Maybe a set of artifact objects - Set technologies = new TreeSet(); - decorateRecursively(project, (p, l) -> { - technologies.addAll(MavenPomDecorator.doDecorateTechnology(p)); - // We should explore all parent poms - return true; - }); - String technologiesText = technologies.stream().collect(Collectors.joining(",")); - if(element instanceof Component) { - ((Component) element).setTechnology(technologiesText); - } else if(element instanceof Container) { - ((Container) element).setTechnology(technologiesText); - } - // TODO add a property to element containing the technologies artifact ids - // For later being able to give some details - } - } diff --git a/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenTechnologiesDocumentationEnhancer.java b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenTechnologiesDocumentationEnhancer.java new file mode 100644 index 00000000..9426a257 --- /dev/null +++ b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MavenTechnologiesDocumentationEnhancer.java @@ -0,0 +1,80 @@ +package org.ndx.aadarchi.inferer.maven; + +import java.util.Map; +import java.util.stream.Collectors; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Default; +import javax.inject.Inject; +import javax.inject.Named; + +import org.ndx.aadarchi.base.AgileArchitectureSection; +import org.ndx.aadarchi.base.OutputBuilder; +import org.ndx.aadarchi.base.OutputBuilder.HandledFormat; +import org.ndx.aadarchi.base.enhancers.ModelElementAdapter; +import org.ndx.aadarchi.inferer.maven.technologies.MvnRepositoryArtifact; +import org.ndx.aadarchi.inferer.maven.technologies.MvnRepositoryArtifactsProducer; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.structurizr.model.StaticStructureElement; + +/** + * An enhancer which generates in development environment some text about the + * notable dependencies + */ +@Default @ApplicationScoped +public class MavenTechnologiesDocumentationEnhancer extends ModelElementAdapter { + @Inject @Named(MvnRepositoryArtifactsProducer.MVNREPOSITORY_ARTIFACTS) Map mvnRepositoryArtifacts; + ObjectMapper objectMapper = new ObjectMapper(); + + @Override + public int priority() { + return 10; + } + + @Override + protected void processElement(StaticStructureElement element, OutputBuilder builder) { + if(element.getProperties().containsKey(MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES)) { + String technologies = element.getProperties().get(MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES); + // Rehydrate that to have artifacts + try { + Map dependenciesVersions = objectMapper.readValue(technologies, MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES_TYPE); + if(!dependenciesVersions.isEmpty()) { + writeDependenciesArtifacts(element, dependenciesVersions, builder); + } + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + private void writeDependenciesArtifacts(StaticStructureElement element, Map dependenciesVersions, + OutputBuilder builder) { + String text = dependenciesVersions.entrySet().stream() + .map(entry -> Map.entry(mvnRepositoryArtifacts.get(entry.getKey()), entry.getValue())) + .map(entry -> this.toTableRow(entry.getKey(), entry.getValue())) + .collect(Collectors.joining("\n", + "[%autowidth.stretch, cols=\"1a,1a,1a,1a\"]\n|===" + + "\n|Name|Used version|Categories|Description\n\n", + "\n|===")); + builder.writeToOutput(AgileArchitectureSection.development_environment, element, this, OutputBuilder.Format.adoc, + "# Interesting dependencies\n\n" + + text); + } + + private String toTableRow(MvnRepositoryArtifact key, String version) { + StringBuilder returned = new StringBuilder() + .append("|").append(key.page).append("[").append(key.name).append("] "); + returned + .append("|").append(version==null || version.isBlank() ? "{nbsp}" : version); + if(key.versions.containsKey(version)) + returned.append(" (released ").append(key.versions.get(version)).append(")"); + returned + .append("|").append(key.categories.isEmpty() ? "{nbsp}" : key.categories.stream().collect(Collectors.joining())) + .append("|").append(key.description) + ; + return returned.toString(); + } +} diff --git a/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/technologies/MvnRepositoryArtifact.java b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/technologies/MvnRepositoryArtifact.java new file mode 100644 index 00000000..d961280a --- /dev/null +++ b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/technologies/MvnRepositoryArtifact.java @@ -0,0 +1,36 @@ +package org.ndx.aadarchi.inferer.maven.technologies; + +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MvnRepositoryArtifact { + public final String name; + public final String coordinates; + public String description; + public List categories; + public List tags; + public Map versions; + public String page; + + @JsonCreator + public MvnRepositoryArtifact(@JsonProperty("name") String name, + @JsonProperty("coordinates") String coordinates, + @JsonProperty("description") String description, + @JsonProperty("page") String page, + @JsonProperty("categories") List categories, + @JsonProperty("tags") List tags, + @JsonProperty("versions") Map versions + ) { + super(); + this.name = name; + this.coordinates = coordinates; + this.page = page; + this.description = description; + this.categories = categories; + this.tags = tags; + this.versions = versions; + } +} diff --git a/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MvnRepositoryArtifactsProducer.java b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/technologies/MvnRepositoryArtifactsProducer.java similarity index 55% rename from maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MvnRepositoryArtifactsProducer.java rename to maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/technologies/MvnRepositoryArtifactsProducer.java index 401b15a4..cbd20ab0 100644 --- a/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/MvnRepositoryArtifactsProducer.java +++ b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/technologies/MvnRepositoryArtifactsProducer.java @@ -1,7 +1,8 @@ -package org.ndx.aadarchi.inferer.maven; +package org.ndx.aadarchi.inferer.maven.technologies; import java.io.IOException; import java.io.InputStream; +import java.util.Map; import java.util.logging.Logger; import javax.enterprise.context.ApplicationScoped; @@ -9,23 +10,29 @@ import javax.inject.Named; import org.apache.commons.io.IOUtils; -import org.json.JSONObject; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; public class MvnRepositoryArtifactsProducer { private static final Logger logger = Logger.getLogger(MvnRepositoryArtifactsProducer.class.getName()); public static final String MVNREPOSITORY_ARTIFACTS = "mvnRepositoryArtifactsMap"; + /** * @see https://stleary.github.io/JSON-java/index.html * @return a JSONObject containing all popular artifacts * @throws IOException */ - @Produces @ApplicationScoped @Named(MVNREPOSITORY_ARTIFACTS) JSONObject createMvnRepositoryArtifacts() throws IOException { + @Produces @ApplicationScoped @Named(MVNREPOSITORY_ARTIFACTS) Map createMvnRepositoryArtifacts() throws IOException { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, false); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); logger.info( String.format("Loading mvnrepository popular artifacts from %s", getClass().getClassLoader().getResource("mvnrepository.json"))); try(InputStream input = getClass().getClassLoader().getResourceAsStream("mvnrepository.json")) { - String text = IOUtils.toString(input, "UTF-8"); - return new JSONObject(text); + return objectMapper.readValue(input, new TypeReference>() {}); } } } diff --git a/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/technologies/TechnologyDecorator.java b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/technologies/TechnologyDecorator.java new file mode 100644 index 00000000..69527e74 --- /dev/null +++ b/maven-metadata-inferer/src/main/java/org/ndx/aadarchi/inferer/maven/technologies/TechnologyDecorator.java @@ -0,0 +1,159 @@ +package org.ndx.aadarchi.inferer.maven.technologies; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Default; +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.maven.model.Dependency; +import org.apache.maven.project.MavenProject; +import org.ndx.aadarchi.inferer.maven.MavenEnhancer; +import org.ndx.aadarchi.inferer.maven.MavenPomDecorator; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.structurizr.model.Component; +import com.structurizr.model.Container; +import com.structurizr.model.Element; + +/** + * Component dedicated to technology decoration. + * Given a maven pom and an element, it will detect interesting technologies, + * add them to the element when possible, + * and add them to documentation when possible + */ +@Default +@ApplicationScoped +public class TechnologyDecorator { + @Inject @Named(MvnRepositoryArtifactsProducer.MVNREPOSITORY_ARTIFACTS) Map mvnRepositoryArtifacts; + + ObjectMapper objectMapper = new ObjectMapper(); + + /** + * @param element element for which we want the technologies + * @param project + * @return a string giving details about important project infos + */ + public void decorateTechnology(Element element, MavenProject project) { + Map dependencies = new TreeMap(); + /** + * Unfortunatly, we have to make some cumbersome code to extract versions expressed in dependency management + * (or through properties) + */ + Map managedDependenciesVersions = new TreeMap(); + MavenPomDecorator.decorateRecursively(project, (mavenProject, mavenModules) -> { + if(mavenProject.getDependencyManagement()!=null) { + updateManagedDependencies(managedDependenciesVersions, mavenProject); + // Before to write that, let's replace all dependencies versions with the ones we know + for(String dependencyId : dependencies.keySet()) { + if(managedDependenciesVersions.containsKey(dependencyId)) { + dependencies.put(dependencyId, managedDependenciesVersions.get(dependencyId)); + } + } + } + dependencies.putAll(doDecorateTechnologies(mavenProject, element)); + // We should explore all parent poms + return true; + }); + try { + element.addProperty(MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES, objectMapper.writeValueAsString(dependencies)); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + private void updateManagedDependencies(Map managedDependenciesVersions, MavenProject mavenProject) { + mavenProject.getDependencyManagement().getDependencies() + .forEach(d -> managedDependenciesVersions.put(d.getGroupId()+"."+d.getArtifactId(), d.getVersion())); + for(String dependencyId : managedDependenciesVersions.keySet()) { + String version = managedDependenciesVersions.get(dependencyId); + String propertyInterpolationStart = "${"; + String propertyInterpolationEnd = "}"; + while(version.contains(propertyInterpolationStart)) { + String property = version.substring(version.indexOf( + propertyInterpolationStart)+propertyInterpolationStart.length(), + version.indexOf(propertyInterpolationEnd)); + if(mavenProject.getProperties().containsKey(property)) { + version = version.replace( + propertyInterpolationStart+property+propertyInterpolationEnd, + mavenProject.getProperties().getProperty(property)); + managedDependenciesVersions.put(dependencyId, version); + } else { + // If this property is unknown, it may well be defined in a parent pom + break; + } + } + } + } + + /** + * Decorate the given element with the given technologies by applying the following steps + *
    + *
  1. Detect technologies in dependencies
  2. + *
  3. Transform them into a set of names
  4. + *
  5. Merge that set of names with the existing technologies of element
  6. + *
+ * @param mavenProject + * @param element + * @return + */ + private Map doDecorateTechnologies(MavenProject mavenProject, Element element) { + Map dependenciesToArtifacts = ((List) mavenProject.getDependencies()).stream() + .filter(d -> mvnRepositoryArtifacts.containsKey(d.getGroupId()+"."+d.getArtifactId())) + .collect(Collectors.toMap(Function.identity(), + d -> mvnRepositoryArtifacts.get(d.getGroupId()+"."+d.getArtifactId()))); + // Now we can map dependencies to artifacts, first put the list of artifact names into technologies + List technologies = dependenciesToArtifacts.values().stream() + // We filter out all technologies tagged with "testing" to simplify things a little in technologies + .filter(a -> !a.tags.contains("testing")) + .map(a -> a.name) + .collect(Collectors.toList()); + if(!dependenciesToArtifacts.values().stream() + .filter(a -> a.tags.contains("language")) + .findAny() + .isPresent()) { + // No language lib has been found, so let's consider it a Java element! + technologies.add("Java"); + } + injectTechnologiesInElement(element, technologies); + return dependenciesToArtifacts.keySet().stream().collect(Collectors.toMap(d -> d.getGroupId()+"."+d.getArtifactId(), d -> d.getVersion()==null ? "":d.getVersion())); + } + + private void injectTechnologiesInElement(Element element, List technologies) { + // As I don't want to repeat myself, I use the rude way of the method handle + try { + Consumer setter = element instanceof Container ? + ((Container) element)::setTechnology : + element instanceof Component ? ((Component) element)::setTechnology : null; + Supplier getter = element instanceof Container ? + ((Container) element)::getTechnology : + element instanceof Component ? ((Component) element)::getTechnology : null; + if(setter!=null && getter!=null) { + String existingTechnologies = getter.get(); + List existingTechnologiesList = List.of(existingTechnologies==null || existingTechnologies.isBlank() ? new String[0] : existingTechnologies.split(",")); + Set technologiesToInsert = new TreeSet<>(); + technologiesToInsert.addAll(technologies); + // Little problem : this won't make Java appear first, maybe a solution with some kind + // of virtual artifact for the JVM and sorting based upon popularity would do the trick + technologiesToInsert.addAll(existingTechnologiesList); + String technologiesText = technologiesToInsert.stream().collect(Collectors.joining(",")); + setter.accept(technologiesText); + } + } catch (SecurityException | IllegalArgumentException e) { + // Nothing to do, because some elements of the Structurizr model don't have any technology declared + } + } +} diff --git a/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenDetailsInfererEnhancerTest.java b/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenDetailsInfererEnhancerTest.java index 9ced524c..696f3f69 100644 --- a/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenDetailsInfererEnhancerTest.java +++ b/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenDetailsInfererEnhancerTest.java @@ -44,6 +44,7 @@ public class MavenDetailsInfererEnhancerTest { .containsOnlyKeys( ModelElementKeys.ConfigProperties.BasePath.NAME, MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_COORDINATES, + MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES, ModelElementKeys.Scm.PROJECT, ModelElementKeys.ISSUE_MANAGER ); @@ -64,6 +65,7 @@ public class MavenDetailsInfererEnhancerTest { ModelElementKeys.Scm.PATH, MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_COORDINATES, MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_POM, + MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES, ModelElementKeys.Scm.PROJECT, ModelElementKeys.JAVA_SOURCES, ModelElementKeys.JAVA_PACKAGES, @@ -77,4 +79,31 @@ public class MavenDetailsInfererEnhancerTest { .contains("org.ndx.aadarchi.inferer.maven") ; } + + @Test public void bug_373_is_fixed() throws FileSystemException { + // Given + var w = new Workspace(getClass().getName(), "a test workspace"); + SoftwareSystem system = w.getModel().addSoftwareSystem("The system to decorate with maven informations"); + system.addProperty(ModelElementKeys.ConfigProperties.BasePath.NAME, basePath.getName().getPath()); + // When + enhancer.enhance(w, Arrays.asList(tested)); + // Then + // There are containers in system + Assertions.assertThat(system.getContainers()).isNotEmpty(); + // There are added containers + Container sipocDiagramGenerator = system.getContainerWithName("sipoc-diagram-generator"); + Assertions.assertThat(sipocDiagramGenerator) + .isNotNull() + ; + Assertions.assertThat(sipocDiagramGenerator.getTechnology()) + .isNotBlank() + .isEqualTo("Java"); + Container springComponentDetector = system.getContainerWithName("spring-components-detector"); + Assertions.assertThat(springComponentDetector) + .isNotNull() + ; + Assertions.assertThat(springComponentDetector.getTechnology()) + .isNotBlank() + .isEqualTo("Java"); + } } diff --git a/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenPomDecoratorTest.java b/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenPomDecoratorTest.java index 0605cbb8..4fd68336 100644 --- a/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenPomDecoratorTest.java +++ b/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenPomDecoratorTest.java @@ -37,6 +37,7 @@ public void can_decorate_software_system() { Assertions.assertThat(system.getProperties()) .containsOnlyKeys( MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_COORDINATES, + MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES, ModelElementKeys.Scm.PROJECT, ModelElementKeys.ISSUE_MANAGER ); @@ -53,11 +54,14 @@ public void can_decorate_container() { // When decorator.decorate(container, project); // Then - // Don't forget that mavenpomdecorator doesn't independently update used technologies Assertions.assertThat(container.getDescription()).isNotNull(); + Assertions.assertThat(container.getTechnology()) + .isNotNull() + .containsIgnoringCase("maven"); Assertions.assertThat(container.getProperties()) .containsOnlyKeys( MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_COORDINATES, + MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES, ModelElementKeys.Scm.PROJECT, ModelElementKeys.JAVA_SOURCES, ModelElementKeys.JAVA_PACKAGES, diff --git a/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenTechnologiesDocumentationEnhancerTest.java b/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenTechnologiesDocumentationEnhancerTest.java new file mode 100644 index 00000000..76f32594 --- /dev/null +++ b/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MavenTechnologiesDocumentationEnhancerTest.java @@ -0,0 +1,68 @@ +package org.ndx.aadarchi.inferer.maven; + +import java.util.Arrays; +import java.util.Map; + +import javax.inject.Inject; + +import org.apache.commons.vfs2.FileObject; +import org.apache.commons.vfs2.FileSystemException; +import org.apache.deltaspike.core.api.config.ConfigProperty; +import org.assertj.core.api.Assertions; +import org.assertj.core.api.InstanceOfAssertFactories; +import org.jboss.weld.junit5.EnableWeld; +import org.jboss.weld.junit5.WeldInitiator; +import org.jboss.weld.junit5.WeldSetup; +import org.junit.jupiter.api.Test; +import org.ndx.aadarchi.base.ArchitectureEnhancer; +import org.ndx.aadarchi.base.enhancers.ModelElementKeys; +import org.ndx.aadarchi.base.enhancers.ModelElementKeys.ConfigProperties.BasePath; +import org.ndx.aadarchi.base.utils.commonsvfs.FileObjectDetector; +import org.ndx.aadarchi.inferer.maven.technologies.MvnRepositoryArtifactsProducer; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.structurizr.Workspace; +import com.structurizr.model.Container; +import com.structurizr.model.SoftwareSystem; + +@EnableWeld +public class MavenTechnologiesDocumentationEnhancerTest { + @WeldSetup + public WeldInitiator weld = WeldInitiator.performDefaultDiscovery(); + + @Inject MavenTechnologiesDocumentationEnhancer tested; + @Inject MavenDetailsInfererEnhancer mavenReader; + @Inject ArchitectureEnhancer enhancer; + + @Inject @ConfigProperty(name=BasePath.NAME, defaultValue = BasePath.VALUE) FileObject basePath; + + @Test public void can_detect_dependencies_versions_declared_through_dependency_management_and_properties() throws FileSystemException, JsonMappingException, JsonProcessingException { + // Given + var w = new Workspace(getClass().getName(), "a test workspace"); + SoftwareSystem system = w.getModel().addSoftwareSystem("The system to decorate with maven informations"); + system.addProperty(ModelElementKeys.ConfigProperties.BasePath.NAME, basePath.getName().getPath()); + // When + // We emulate in-depth visit (but do not really perform it) + enhancer.enhance(w, Arrays.asList(mavenReader, tested)); + // Then + // There are containers in system + Assertions.assertThat(system.getContainers()).isNotEmpty(); + Container mavenMetadataInferer = system.getContainerWithName("maven-metadata-inferer"); + // For this container, we will try to see what versions are given for some dependencies + Assertions.assertThat(mavenMetadataInferer.getProperties()) + .containsKey(MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES); + // Now extract the dependencies + ObjectMapper objectMapper = new ObjectMapper(); + Map dependenciesVersions = objectMapper.readValue( + mavenMetadataInferer.getProperties().get(MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES) + , MavenEnhancer.AGILE_ARCHITECTURE_MAVEN_TECHNOLOGIES_TYPE); + // Yeah, i'm searching for the dependency that make that very line of code possible + // So it should not fail + Assertions.assertThat(dependenciesVersions) + .extractingByKey("org.assertj.assertj-core") + .isEqualTo("3.23.1"); + Assertions.assertThat(mavenMetadataInferer.getTechnology()).doesNotStartWith(","); + } +} diff --git a/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MvnRepositoryArtifactsProducerTest.java b/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/technologies/MvnRepositoryArtifactsProducerTest.java similarity index 53% rename from maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MvnRepositoryArtifactsProducerTest.java rename to maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/technologies/MvnRepositoryArtifactsProducerTest.java index 8f9e0993..1125e96c 100644 --- a/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/MvnRepositoryArtifactsProducerTest.java +++ b/maven-metadata-inferer/src/test/java/org/ndx/aadarchi/inferer/maven/technologies/MvnRepositoryArtifactsProducerTest.java @@ -1,6 +1,6 @@ -package org.ndx.aadarchi.inferer.maven; +package org.ndx.aadarchi.inferer.maven.technologies; -import static org.junit.jupiter.api.Assertions.fail; +import java.util.Map; import javax.inject.Inject; import javax.inject.Named; @@ -9,7 +9,6 @@ import org.jboss.weld.junit5.EnableWeld; import org.jboss.weld.junit5.WeldInitiator; import org.jboss.weld.junit5.WeldSetup; -import org.json.JSONObject; import org.junit.jupiter.api.Test; @EnableWeld @@ -18,13 +17,18 @@ class MvnRepositoryArtifactsProducerTest { @WeldSetup public WeldInitiator weld = WeldInitiator.performDefaultDiscovery(); - @Inject JSONObject data; -/* + @Inject @Named(MvnRepositoryArtifactsProducer.MVNREPOSITORY_ARTIFACTS) Map data; + @Test void mvnrepository_has_some_artifacts_in() { Assertions.assertThat(data).isNotNull(); - Assertions.assertThat(data.toMap()).isNotEmpty(); - + Assertions.assertThat(data).isNotEmpty(); + Assertions.assertThat(data) + .containsKey("junit.junit") + .extractingByKey("junit.junit") + .hasFieldOrPropertyWithValue("name", "JUnit") + .hasFieldOrPropertyWithValue("coordinates", "junit.junit") + ; } -*/ + } diff --git a/model-linter/pom.xml b/model-linter/pom.xml index 54a65ea6..4f8c8a96 100644 --- a/model-linter/pom.xml +++ b/model-linter/pom.xml @@ -4,7 +4,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT model-linter Aadarchi : Model linter diff --git a/pom.xml b/pom.xml index 4b1636f1..bb7c8043 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,9 @@ - + 4.0.0 io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT pom Base module of a set of tools created to allow easy architecture documentation based upon Simon Brown work. @@ -78,7 +76,7 @@ sequence-diagram-generator sipoc-diagram-generator archetype - markdown-to-asciidoc + markdownToAsciidoc aadarchi-maven-plugin cdi-in-maven-plugin-helper structurizr-components-detector diff --git a/sequence-diagram-generator/pom.xml b/sequence-diagram-generator/pom.xml index 81d66c1f..94922446 100644 --- a/sequence-diagram-generator/pom.xml +++ b/sequence-diagram-generator/pom.xml @@ -3,7 +3,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT sequence-diagram-generator Aadarchi : Sequence diagram generator diff --git a/sipoc-diagram-generator/pom.xml b/sipoc-diagram-generator/pom.xml index 020861f9..0656152f 100644 --- a/sipoc-diagram-generator/pom.xml +++ b/sipoc-diagram-generator/pom.xml @@ -4,7 +4,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT sipoc-diagram-generator Aadarchi : SIPOC diagram generator diff --git a/spring-components-detector/pom.xml b/spring-components-detector/pom.xml index 41b6c353..aa793ab9 100644 --- a/spring-components-detector/pom.xml +++ b/spring-components-detector/pom.xml @@ -3,7 +3,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT spring-components-detector Aadarchi : Spring components detector diff --git a/structurizr-components-detector/pom.xml b/structurizr-components-detector/pom.xml index 9b92f89e..4922283a 100644 --- a/structurizr-components-detector/pom.xml +++ b/structurizr-components-detector/pom.xml @@ -3,7 +3,7 @@ io.github.Riduidel.aadarchi system - 0.1.11-SNAPSHOT + 0.1.12-SNAPSHOT structurizr-components-detector Aadarchi : Structurizr components detector