Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c404740bf1 | ||
|
|
23c72721ad | ||
|
|
67b5698a16 | ||
|
|
6662eb6e9d | ||
|
|
d712b615d1 | ||
|
|
393fd48d2f | ||
|
|
e5aea526cd | ||
|
|
83d3ee5a50 | ||
|
|
fec017886f | ||
|
|
6ee11e2876 | ||
|
|
4ba4b962e5 | ||
|
|
71710a4ba6 | ||
|
|
f8bc0d38e7 |
@@ -3,11 +3,11 @@
|
||||
:version: 1.0.0
|
||||
:hardbreaks:
|
||||
|
||||
image:https://travis-ci.org/Swagger2Markup/markup-document-builder.svg?branch=master["Build Status", link="https://travis-ci.org/Swagger2Markup/markup-document-builder"] image:https://coveralls.io/repos/Swagger2Markup/markup-document-builder/badge.svg["Coverage Status", link="https://coveralls.io/r/Swagger2Markup/markup-document-builder"] image:https://api.codacy.com/project/badge/grade/c56a372454164f21b1b2eec8eb48b370["Codacy code quality", link="https://www.codacy.com/app/robwin/markup-document-builder"] image:https://api.bintray.com/packages/swagger2markup/Maven/markup-document-builder/images/download.svg[link="https://bintray.com/swagger2markup/Maven/markup-document-builder/_latestVersion"] image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"] image:https://img.shields.io/badge/Twitter-rbrtwnklr-blue.svg["Twitter", link="https://twitter.com/rbrtwnklr"]
|
||||
image:https://travis-ci.org/Swagger2Markup/markup-document-builder.svg?branch=master["Build Status", link="https://travis-ci.org/Swagger2Markup/markup-document-builder"] image:https://coveralls.io/repos/Swagger2Markup/markup-document-builder/badge.svg["Coverage Status", link="https://coveralls.io/r/Swagger2Markup/markup-document-builder"] image:https://api.codacy.com/project/badge/grade/c56a372454164f21b1b2eec8eb48b370["Codacy code quality", link="https://www.codacy.com/app/robwin/markup-document-builder"] image:https://api.bintray.com/packages/swagger2markup/Maven/io.github.swagger2markup%3Amarkup-document-builder/images/download.svg[link="https://bintray.com/swagger2markup/Maven/io.github.swagger2markup%3Amarkup-document-builder/_latestVersion"] image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"] image:https://img.shields.io/badge/Twitter-rbrtwnklr-blue.svg["Twitter", link="https://twitter.com/rbrtwnklr"]
|
||||
|
||||
== Overview
|
||||
|
||||
This project is a Markup document builder (AsciiDoc and Markdown). The primary goal of this project is to simplify the creation of Markup documents. The builder is used by https://github.com/RobWin/swagger2markup[swagger2markup].
|
||||
This project is a Markup document builder (AsciiDoc, Markdown and ConfluenceWiki). The primary goal of this project is to simplify the creation of Markup documents. The builder is used by https://github.com/RobWin/swagger2markup[swagger2markup].
|
||||
|
||||
The project requires at least JDK 7.
|
||||
|
||||
|
||||
@@ -18,4 +18,8 @@
|
||||
=== Version 0.1.5
|
||||
* Added SECTION_TITLE_LEVEL4
|
||||
|
||||
== Version 1.0.0
|
||||
== Version 1.1.0
|
||||
* Changed bold to ** and italic to __ so that special chars in the text are possible
|
||||
|
||||
== Version 1.1.1
|
||||
* Added a method to add page breaks.
|
||||
@@ -7,12 +7,12 @@ buildscript {
|
||||
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
|
||||
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.11'
|
||||
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
|
||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
|
||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
|
||||
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.0"
|
||||
}
|
||||
}
|
||||
description = 'A Markup (Markdown, AsciiDoc) document builder'
|
||||
version = '1.0.0'
|
||||
version = '1.1.1-SNAPSHOT'
|
||||
group = 'io.github.swagger2markup'
|
||||
|
||||
apply plugin: 'java'
|
||||
|
||||
@@ -8,10 +8,10 @@ Date buildTimeAndDate = new Date()
|
||||
ext {
|
||||
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
|
||||
buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
|
||||
projectUrl = 'https://github.com/RobWin/markup-document-builder'
|
||||
licenseUrl = 'https://github.com/RobWin/markup-document-builder/blob/master/LICENSE.txt'
|
||||
scmUrl = 'https://github.com/RobWin/markup-document-builder.git'
|
||||
issuesUrl = 'https://github.com/RobWin/markup-document-builder/issues'
|
||||
projectUrl = 'https://github.com/Swagger2Markup/markup-document-builder'
|
||||
licenseUrl = 'https://github.com/Swagger2Markup/markup-document-builder/blob/master/LICENSE.txt'
|
||||
scmUrl = 'https://github.com/Swagger2Markup/markup-document-builder.git'
|
||||
issuesUrl = 'https://github.com/Swagger2Markup/markup-document-builder/issues'
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
@@ -97,8 +97,9 @@ bintray {
|
||||
publish = true //If version should be auto published after an upload
|
||||
publications = ['mavenJava']
|
||||
pkg {
|
||||
repo = 'maven'
|
||||
name = 'swagger2markup'
|
||||
repo = 'Maven'
|
||||
name = 'io.github.swagger2markup:markup-document-builder'
|
||||
userOrg = 'swagger2markup'
|
||||
websiteUrl = projectUrl
|
||||
issueTrackerUrl = issuesUrl
|
||||
vcsUrl = scmUrl
|
||||
|
||||
@@ -245,7 +245,14 @@ public interface MarkupDocBuilder {
|
||||
* @return this builder
|
||||
*/
|
||||
MarkupDocBuilder paragraph(String text);
|
||||
|
||||
|
||||
/**
|
||||
* Insert a page break
|
||||
*
|
||||
* @return this builder
|
||||
*/
|
||||
MarkupDocBuilder pageBreak();
|
||||
|
||||
/**
|
||||
* Builds a block of {@code text} with specified {@code style}.
|
||||
*
|
||||
|
||||
@@ -30,8 +30,8 @@ public enum AsciiDoc implements Markup {
|
||||
TITLE("="),
|
||||
DOCUMENT_TITLE("= "),
|
||||
LITERAL("`"),
|
||||
BOLD("*"),
|
||||
ITALIC("_"),
|
||||
BOLD("**"),
|
||||
ITALIC("__"),
|
||||
LIST_ENTRY("* "),
|
||||
CROSS_REFERENCE_START("<<"),
|
||||
CROSS_REFERENCE_END(">>"),
|
||||
|
||||
@@ -96,6 +96,12 @@ public class AsciiDocBuilder extends AbstractMarkupDocBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder pageBreak() {
|
||||
documentBuilder.append(newLine).append("<<<").append(newLine);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder block(String text, final MarkupBlockStyle style, String title, MarkupAdmonition admonition) {
|
||||
if (admonition != null)
|
||||
|
||||
@@ -135,6 +135,12 @@ public final class ConfluenceMarkupBuilder extends AbstractMarkupDocBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder pageBreak() {
|
||||
documentBuilder.append(newLine).append("<div style='page-break-before:always;'></div>").append(newLine);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder block(String text, final MarkupBlockStyle style, String title, MarkupAdmonition admonition) {
|
||||
|
||||
|
||||
@@ -103,7 +103,13 @@ public class MarkdownBuilder extends AbstractMarkupDocBuilder {
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder pageBreak() {
|
||||
documentBuilder.append(newLine).append("***").append(newLine);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder block(String text, final MarkupBlockStyle style, String title, MarkupAdmonition admonition) {
|
||||
if (admonition != null)
|
||||
|
||||
@@ -91,6 +91,7 @@ public class MarkupDocBuilderTest {
|
||||
.block("Literal", MarkupBlockStyle.LITERAL, null, MarkupAdmonition.NOTE)
|
||||
.block("Sidebar", MarkupBlockStyle.SIDEBAR, null, MarkupAdmonition.TIP)
|
||||
.block("Passthrough", MarkupBlockStyle.PASSTHROUGH, null, MarkupAdmonition.WARNING)
|
||||
.pageBreak()
|
||||
.table(tableCells)
|
||||
.tableWithColumnSpecs(tableColumns, tableCells)
|
||||
.sectionTitleLevel1("Section Level 1b")
|
||||
@@ -160,6 +161,7 @@ public class MarkupDocBuilderTest {
|
||||
.block("Literal", MarkupBlockStyle.LITERAL, null, MarkupAdmonition.NOTE)
|
||||
.block("Sidebar", MarkupBlockStyle.SIDEBAR, null, MarkupAdmonition.TIP)
|
||||
.block("Passthrough", MarkupBlockStyle.PASSTHROUGH, null, MarkupAdmonition.WARNING)
|
||||
.pageBreak()
|
||||
//.table(tableCells)
|
||||
.tableWithColumnSpecs(tableColumns, tableCells)
|
||||
.sectionTitleLevel1("Section Level 1b")
|
||||
@@ -230,6 +232,7 @@ public class MarkupDocBuilderTest {
|
||||
.block("Literal", MarkupBlockStyle.LITERAL, null, MarkupAdmonition.NOTE)
|
||||
.block("Sidebar", MarkupBlockStyle.SIDEBAR, null, MarkupAdmonition.TIP)
|
||||
.block("Passthrough", MarkupBlockStyle.PASSTHROUGH, null, MarkupAdmonition.WARNING)
|
||||
.pageBreak()
|
||||
.table(tableCells)
|
||||
.tableWithColumnSpecs(tableColumns, tableCells)
|
||||
.sectionTitleLevel1("Section Level 1b")
|
||||
|
||||
@@ -93,6 +93,8 @@ Passthrough
|
||||
++++
|
||||
|
||||
|
||||
<<<
|
||||
|
||||
[options="", cols=""]
|
||||
|===
|
||||
|Row 1 \| Column 1|Row 1 \| Column 2|Row 1 \| Column 3
|
||||
@@ -113,9 +115,9 @@ Passthrough
|
||||
=== Section Level 2b
|
||||
text line +
|
||||
`Literal text line` +
|
||||
*Bold text line* +
|
||||
_Italic text line_ +
|
||||
*bold*_italic_regular +
|
||||
**Bold text line** +
|
||||
__Italic text line__ +
|
||||
**bold**__italic__regular +
|
||||
|
||||
* Entry1
|
||||
* Entry2
|
||||
|
||||
@@ -77,6 +77,8 @@ Passthrough
|
||||
{html}
|
||||
|
||||
|
||||
<div style='page-break-before:always;'></div>
|
||||
|
||||
|Row 1 \| Column 1|Row 1 \| Column 2|Row 1 \| Column 3|
|
||||
|Row 2 \| Column 1|Row 2 \| Column 2|Row 2 \| Column 3|
|
||||
|
||||
|
||||
@@ -82,6 +82,8 @@ Warning :
|
||||
Passthrough
|
||||
|
||||
|
||||
***
|
||||
|
||||
|Header1||Header3|
|
||||
|---|---|---|
|
||||
|Row 1 \| Column 1|Row 1 \| Column 2|Row 1 \| Column 3|
|
||||
|
||||
Reference in New Issue
Block a user