All Projects → Steppschuh → Java Markdown Generator

Steppschuh / Java Markdown Generator

Licence: mit
Java library to generate markdown

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Java Markdown Generator

Notes
📝 Migrated to(迁移至) https://github.com/Kuangcp/Note 当前仓库已经废弃, 对应的博客网站:
Stars: ✭ 33 (-79.25%)
Mutual labels:  gradle, markdown, maven
Markdown Builder
1kb Markdown builder for Node.js
Stars: ✭ 67 (-57.86%)
Mutual labels:  builder, markdown, library
Gradle Maven Plugin
Gradle 5.x Maven Publish Plugin to deploy artifacts
Stars: ✭ 124 (-22.01%)
Mutual labels:  gradle, library, maven
Bintray Publish
Super easy way to publish your Android and Java artifacts to bintray.
Stars: ✭ 97 (-38.99%)
Mutual labels:  gradle, jar
Gradle Util Plugins
Fix for windows gradle long classpath issue. Fixes JavaExec tasks that error out with message "CreateProcess error=206, The filename or extension is too long"
Stars: ✭ 87 (-45.28%)
Mutual labels:  gradle, jar
Kotlin Mpp Standard
A standard setup for Kotlin multiplatform projects.
Stars: ✭ 92 (-42.14%)
Mutual labels:  gradle, maven
Okta Blog Archive
Okta Developer Blog
Stars: ✭ 74 (-53.46%)
Mutual labels:  gradle, maven
Liquidrefreshlayout
Liquid Refresh Layout is a simple SwipeToRefresh library that helps you easily integrate SwipeToRefresh and performs simple clean liquid animation
Stars: ✭ 114 (-28.3%)
Mutual labels:  gradle, library
React Markdown
Markdown editor (input) based on React
Stars: ✭ 98 (-38.36%)
Mutual labels:  markdown, library
Commonmark Java
Java library for parsing and rendering CommonMark (Markdown)
Stars: ✭ 1,675 (+953.46%)
Mutual labels:  markdown, library
Publiccms
现代化java cms,由天津黑核科技有限公司开发,轻松支撑千万数据、千万PV;支持静态化,服务器端包含; 目前已经拥有全球0.0002%的用户,语言支持中、繁、日、英;是一个已走向海外的成熟CMS产品
Stars: ✭ 1,750 (+1000.63%)
Mutual labels:  gradle, maven
Vlog
An in-display logging library for Android 📲
Stars: ✭ 86 (-45.91%)
Mutual labels:  library, logging
Circleci Orbs
The source code for some of the orbs published by CircleCI
Stars: ✭ 82 (-48.43%)
Mutual labels:  gradle, maven
Logsip
A simple, concise, colorful logger for Go
Stars: ✭ 94 (-40.88%)
Mutual labels:  library, logging
Liblognorm
a fast samples-based log normalization library
Stars: ✭ 81 (-49.06%)
Mutual labels:  library, logging
Xseries
Library for cross-version Minecraft Bukkit support and various efficient API methods.
Stars: ✭ 109 (-31.45%)
Mutual labels:  library, maven
Jib
🏗 Build container images for your Java applications.
Stars: ✭ 11,370 (+7050.94%)
Mutual labels:  gradle, maven
Image Comparison
Published on Maven Central and jCenter Java Library that compares 2 images with the same sizes and shows the differences visually by drawing rectangles. Some parts of the image can be excluded from the comparison. Can be used for automation qa tests.
Stars: ✭ 145 (-8.81%)
Mutual labels:  gradle, library
Android Camera2 Library
Library to use Android Camera2 api easily.
Stars: ✭ 66 (-58.49%)
Mutual labels:  gradle, library
Spotless
Keep your code spotless
Stars: ✭ 2,285 (+1337.11%)
Mutual labels:  gradle, maven

Java Markdown Generator

Travis JitPack Bintray Maven Central Codecov

Simple to use Java library to generate beautiful markdown.

Screenshot

Usage

Integration

Gradle

You can get snapshot and release builds from JitPack:

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    compile 'com.github.Steppschuh:Java-Markdown-Generator:master-SNAPSHOT'
}

Alternatively, release builds are also available on Bintray:

repositories {
    maven { url 'http://dl.bintray.com/steppschuh/Markdown-Generator' }
}
dependencies {
    compile 'net.steppschuh.markdowngenerator:markdowngenerator:1.3.2'
}

Maven

<dependency>
  <groupId>net.steppschuh.markdowngenerator</groupId>
  <artifactId>markdowngenerator</artifactId>
  <version>1.3.2</version>
</dependency>

JAR

You can download the latest .jar files from GitHub or Bintray.

Examples

Most Markdown elements have static convenience methods in the Markdown class. You can also use their repesctive constructors, as shown below.

Emphasis

@Test
public void example() throws Exception {
    StringBuilder sb = new StringBuilder()
            .append(new Text("I am normal")).append("\n")
            .append(new BoldText("I am bold")).append("\n")
            .append(new ItalicText("I am italic")).append("\n")
            .append(new StrikeThroughText("I am strike-through"));

    System.out.println(sb);
}

Output:

I am normal
**I am bold**
_I am italic_
~~I am strike-through~~

Headings

@Test
public void example() throws Exception {
    StringBuilder sb = new StringBuilder()
            .append(new Heading("Heading with level 1", 1)).append("\n")
            .append(new Heading("Heading with level 2", 2)).append("\n")
            .append(new Heading("Heading with level 3", 3)).append("\n")
            .append(new Heading("Heading with level 4", 4)).append("\n")
            .append(new Heading("Heading with level 5", 5)).append("\n")
            .append(new Heading("Heading with level 6", 6));

    System.out.println(sb);
}

Output:

Heading with level 1
====================
Heading with level 2
--------------------
### Heading with level 3
#### Heading with level 4
##### Heading with level 5
###### Heading with level 6

Rules

@Test
public void example() throws Exception {
    System.out.println(new HorizontalRule());
    System.out.println(new HorizontalRule(20, HorizontalRule.ASTERISK));
}

Output:

---
********************

Images

@Test
public void example() throws Exception {
    String text = "I am an image";
    String url = "https://dummyimage.com/300";
    System.out.println(new Image(text, url));
}

Output:

![I am an image](https://dummyimage.com/300)

Lists

@Test
public void example() throws Exception {
    List<Object> items = Arrays.asList(
            "Items can be anything",
            new Date(0),
            1337
    );
    System.out.println(new UnorderedList<>(items));
}

Output:

- Items can be anything
- Thu Jan 01 01:00:00 CET 1970
- 1337

Tasks

@Test
public void example() throws Exception {
    List<TaskListItem> items = Arrays.asList(
            new TaskListItem("Task 1", true),
            new TaskListItem("Task 2", false),
            new TaskListItem("Task 3")
    );
    System.out.println(new TaskList(items));
}

Output:

- [x] Task 1
- [ ] Task 2
- [ ] Task 3

Tables

@Test
public void example() throws Exception {
    Table.Builder tableBuilder = new Table.Builder()
            .withAlignments(Table.ALIGN_RIGHT, Table.ALIGN_LEFT)
            .withRowLimit(7)
            .addRow("Index", "Boolean");

    for (int i = 1; i <= 20; i++) {
        tableBuilder.addRow(i, Math.random() > 0.5);
    }

    System.out.println(tableBuilder.build());
}

Output:

| Index | Boolean |
| -----:| ------- |
|     1 | false   |
|     2 | true    |
|     3 | false   |
| ~~~~~ | ~~~~~~~ |
|    18 | false   |
|    19 | true    |
|    20 | false   |

Code

@Test
public void example() throws Exception {
    String code = "// notice this new line\n" +
            "System.out.println(\"Hello\");";
    System.out.println(new CodeBlock(code, "Java"));
}

Output:

    ```Java
    // notice this new line
    System.out.println("Hello");
    ```
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].