mk2data

Translate table markdown to table data

License

License

Categories

Categories

Data
GroupId

GroupId

com.yo1000
ArtifactId

ArtifactId

mk2data
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

mk2data
Translate table markdown to table data
Project URL

Project URL

https://github.com/yo1000/mk2data
Source Code Management

Source Code Management

https://github.com/yo1000/mk2data

Download mk2data

How to add to project

<!-- https://jarcasting.com/artifacts/com.yo1000/mk2data/ -->
<dependency>
    <groupId>com.yo1000</groupId>
    <artifactId>mk2data</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.yo1000/mk2data/
implementation 'com.yo1000:mk2data:1.1.0'
// https://jarcasting.com/artifacts/com.yo1000/mk2data/
implementation ("com.yo1000:mk2data:1.1.0")
'com.yo1000:mk2data:jar:1.1.0'
<dependency org="com.yo1000" name="mk2data" rev="1.1.0">
  <artifact name="mk2data" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.yo1000', module='mk2data', version='1.1.0')
)
libraryDependencies += "com.yo1000" % "mk2data" % "1.1.0"
[com.yo1000/mk2data "1.1.0"]

Dependencies

compile (5)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib jar 1.3.61
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.61
org.jetbrains.kotlin : kotlin-reflect jar 1.3.61
com.vladsch.flexmark : flexmark jar 0.60.2
com.vladsch.flexmark : flexmark-ext-tables jar 0.60.2

test (5)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.5.2
org.junit.jupiter : junit-jupiter-engine jar 5.5.2
org.junit.jupiter : junit-jupiter-params jar 5.5.2
org.assertj : assertj-core jar 3.14.0
com.h2database : h2 jar 1.4.199

Project Modules

There are no modules declared in this project.

🚗 mk2data

Translate table markdown to table data.

Dependencies

<dependency>
    <groupId>com.yo1000</groupId>
    <artifactId>mk2data</artifactId>
    <version>1.1.0</version>
</dependency>

Examples

Details refer to src/test/kotlin/com/yo1000/mk2data/MarkdownTest.kt

for Kotlin

dataSource.connection.use {
    MarkdownUtils.setup(it, """
        | ID   | Name    | age | BLooD   | Birth_Date
        |------|---------|-----|---------|------------
        | '10' | 'Alice' | 20  | 'A'     | 2000-03-05
        | '20' | 'Bob'   | 18  |         | 2002-01-02
        [owners]
        
        | id     | name     | category | owners_id
        |--------|----------|----------|-----------
        | '1000' | 'Max'    | 'dogs'   | '10'
        | '1001' | 'Bella'  | 'dogs'   | '10'
        | '1002' |          | 'dogs'   | '10'
        | '1003' | null     | 'dogs'   | '10'
        | '1004' | NULL     | 'dogs'   | '10'
        | '1005' | ''       | 'dogs'   | '10'
        | '1006' | 'null'   | 'dogs'   | '10'
        | '2000' | 'Tama'   | 'cats'   | '20'
        | '9000' |          | 'dogs'   | null
        [pets]
    """)
    
    MarkdownUtils.expect(it, """
        | ID   | Name    | age | BLooD   | Birth_Date
        |------|---------|-----|---------|------------
        | '10' | 'Alice' | 20  | 'A'     | 2000-03-05
        | '20' | 'Bob'   | 18  |         | 2002-01-02
        [owners]
        
        | id     | name     | category | owners_id
        |--------|----------|----------|-----------
        | '1000' | 'Max'    | 'dogs'   | '10'
        | '1001' | 'Bella'  | 'dogs'   | '10'
        | '1002' |          | 'dogs'   | '10'
        | '1003' | null     | 'dogs'   | '10'
        | '1004' | NULL     | 'dogs'   | '10'
        | '1005' | ''       | 'dogs'   | '10'
        | '1006' | 'null'   | 'dogs'   | '10'
        | '2000' | 'Tama'   | 'cats'   | '20'
        | '9000' |          | 'dogs'   | null
        [pets]
    """)
}

for Java13+

try (Connection conn = dataSource.getConnection()) {
    MarkdownUtils.setup(conn, """
        | ID   | Name    | age | BLooD   | Birth_Date
        |------|---------|-----|---------|------------
        | '10' | Alice   | 20  | 'A'     | 2000-03-05
        | '20' | Bob     | 18  |         | 2002-01-02
        [owners]
        
        | id     | name     | category | owners_id
        |--------|----------|----------|-----------
        | '1000' | 'Max'    | dogs     | 10
        | '1001' | 'Bella'  | dogs     | 10
        | '1002' |          | dogs     | 10
        | '1003' | null     | dogs     | 10
        | '1004' | NULL     | dogs     | 10
        | '1005' | ''       | dogs     | 10
        | '1006' | 'null'   | dogs     | 10
        | '2000' | 'Tama'   | cats     | 20
        | '9000' |          | dogs     | null
        [pets]
    """);

    MarkdownUtils.expect(conn, """
        | ID   | Name    | age | BLooD   | Birth_Date
        |------|---------|-----|---------|------------
        | '10' | Alice   | 20  | 'A'     | 2000-03-05
        | '20' | Bob     | 18  |         | 2002-01-02
        [owners]
        
        | id     | name     | category | owners_id
        |--------|----------|----------|-----------
        | '1000' | 'Max'    | dogs     | 10
        | '1001' | 'Bella'  | dogs     | 10
        | '1002' |          | dogs     | 10
        | '1003' | null     | dogs     | 10
        | '1004' | NULL     | dogs     | 10
        | '1005' | ''       | dogs     | 10
        | '1006' | 'null'   | dogs     | 10
        | '2000' | 'Tama'   | cats     | 20
        | '9000' |          | dogs     | null
        [pets]
    """);
}

Versions

Version
1.1.0
1.0.0
0.3.1
0.3.0
0.2.0
0.1.0