Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
609dcbc7d5 | ||
|
|
4e61063106 | ||
|
|
b7cad8a7c8 | ||
|
|
97b068150d | ||
|
|
c1327e6b90 | ||
|
|
68c101fced | ||
|
|
02ea0f4e54 | ||
|
|
3933836290 | ||
|
|
9471093dce | ||
|
|
15a96a7338 | ||
|
|
e6dc1b63d0 | ||
|
|
1dd8dd2d25 | ||
|
|
2657b03de0 |
20
README.adoc
20
README.adoc
@@ -1,13 +1,13 @@
|
||||
= MarkupDocBuilder
|
||||
:author: Robert Winkler
|
||||
:version: 0.1.2
|
||||
:version: 0.1.4
|
||||
:hardbreaks:
|
||||
|
||||
image:https://travis-ci.org/RobWin/markup-document-builder.svg["Build Status", link="https://travis-ci.org/RobWin/markup-document-builder"] image:https://coveralls.io/repos/RobWin/markup-document-builder/badge.svg["Coverage Status", link="https://coveralls.io/r/RobWin/markup-document-builder"] image:https://api.bintray.com/packages/robwin/maven/markup-document-builder/images/download.svg[link="https://bintray.com/robwin/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://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/RobWin/markup-document-builder/badge.svg["Coverage Status", link="https://coveralls.io/r/RobWin/markup-document-builder"] image:https://api.bintray.com/packages/robwin/maven/markup-document-builder/images/download.svg[link="https://bintray.com/robwin/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"]
|
||||
|
||||
== 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.
|
||||
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].
|
||||
|
||||
The project requires at least JDK 7.
|
||||
|
||||
@@ -33,7 +33,7 @@ The project is published in JCenter and Maven Central.
|
||||
<dependency>
|
||||
<groupId>io.github.robwin</groupId>
|
||||
<artifactId>markup-document-builder</artifactId>
|
||||
<version>0.1.2</version>
|
||||
<version>0.1.4</version>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
@@ -45,7 +45,7 @@ repositories {
|
||||
jcenter()
|
||||
}
|
||||
|
||||
compile "io.github.robwin:markup-document-builder:0.1.2"
|
||||
compile "io.github.robwin:markup-document-builder:0.1.4"
|
||||
----
|
||||
|
||||
=== Using MarkupDocBuilder
|
||||
@@ -113,3 +113,13 @@ You can generate your PDF or HTML documentation via https://github.com/asciidoct
|
||||
|
||||
image::images/asciidoc_html.jpg[asciidoc_html]
|
||||
|
||||
== License
|
||||
|
||||
Copyright 2015 Robert Winkler
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
|
||||
@@ -4,4 +4,16 @@
|
||||
* Initial version with support for AsciiDoc and Markdown
|
||||
|
||||
=== Version 0.1.1
|
||||
* Signed jar files
|
||||
* Signed jar files
|
||||
|
||||
=== Version 0.1.2
|
||||
* Removed logback from compile dependency
|
||||
|
||||
=== Version 0.1.3
|
||||
* Removed commons.io from compile dependency
|
||||
|
||||
=== Version 0.1.4
|
||||
* Fixed SECTION_TITLE_LEVEL3 in Markdown enum
|
||||
|
||||
=== Version 0.1.5
|
||||
* Added SECTION_TITLE_LEVEL4
|
||||
14
build.gradle
14
build.gradle
@@ -6,14 +6,14 @@ buildscript {
|
||||
dependencies {
|
||||
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.2'
|
||||
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.6'
|
||||
classpath 'io.spring.gradle:dependency-management-plugin:0.3.1.RELEASE'
|
||||
classpath 'io.spring.gradle:dependency-management-plugin:0.5.0.RELEASE'
|
||||
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
|
||||
classpath 'org.asciidoctor:asciidoctorj:1.5.2'
|
||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
|
||||
}
|
||||
}
|
||||
description = 'A Markup (Markdown, AsciiDoc) document builder'
|
||||
version = '0.1.2'
|
||||
version = '0.1.5'
|
||||
group = 'io.github.robwin'
|
||||
|
||||
apply plugin: 'java'
|
||||
@@ -39,16 +39,16 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'commons-io:commons-io'
|
||||
compile 'ch.qos.logback:logback-classic'
|
||||
compile 'org.slf4j:slf4j-api'
|
||||
testCompile 'junit:junit'
|
||||
testCompile 'ch.qos.logback:logback-classic'
|
||||
}
|
||||
|
||||
dependencyManagement {
|
||||
dependencies {
|
||||
"commons-io:commons-io" "2.4"
|
||||
"ch.qos.logback:logback-classic" "1.1.2"
|
||||
"junit:junit" "4.11"
|
||||
dependency "org.slf4j:slf4j-api:1.7.12"
|
||||
dependency "junit:junit:4.11"
|
||||
dependency "ch.qos.logback:logback-classic:1.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package io.github.robwin.markup.builder;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@@ -39,6 +57,10 @@ public abstract class AbstractMarkupDocBuilder implements MarkupDocBuilder {
|
||||
documentBuilder.append(markup).append(title).append(newLine);
|
||||
}
|
||||
|
||||
protected void sectionTitleLevel4(Markup markup, String title){
|
||||
documentBuilder.append(markup).append(title).append(newLine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder textLine(String text){
|
||||
documentBuilder.append(text).append(newLine);
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package io.github.robwin.markup.builder;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package io.github.robwin.markup.builder;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -18,6 +36,8 @@ public interface MarkupDocBuilder {
|
||||
|
||||
MarkupDocBuilder sectionTitleLevel3(String title);
|
||||
|
||||
MarkupDocBuilder sectionTitleLevel4(String title);
|
||||
|
||||
MarkupDocBuilder textLine(String text);
|
||||
|
||||
MarkupDocBuilder paragraph(String text);
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package io.github.robwin.markup.builder;
|
||||
|
||||
|
||||
@@ -9,7 +27,7 @@ import io.github.robwin.markup.builder.markdown.MarkdownBuilder;
|
||||
*/
|
||||
public final class MarkupDocBuilders {
|
||||
|
||||
private MarkupDocBuilders(){};
|
||||
private MarkupDocBuilders(){}
|
||||
|
||||
public static MarkupDocBuilder documentBuilder(MarkupLanguage markupLanguage){
|
||||
switch(markupLanguage){
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
package io.github.robwin.markup.builder;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package io.github.robwin.markup.builder.asciidoc;
|
||||
|
||||
|
||||
@@ -16,6 +34,7 @@ public enum AsciiDoc implements Markup {
|
||||
SECTION_TITLE_LEVEL1("== "),
|
||||
SECTION_TITLE_LEVEL2("=== "),
|
||||
SECTION_TITLE_LEVEL3("==== "),
|
||||
SECTION_TITLE_LEVEL4("===== "),
|
||||
BOLD("*"),
|
||||
ITALIC("_"),
|
||||
LIST_ENTRY("* "),
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package io.github.robwin.markup.builder.asciidoc;
|
||||
|
||||
import io.github.robwin.markup.builder.AbstractMarkupDocBuilder;
|
||||
@@ -42,6 +60,12 @@ public class AsciiDocBuilder extends AbstractMarkupDocBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder sectionTitleLevel4(String title){
|
||||
sectionTitleLevel3(AsciiDoc.SECTION_TITLE_LEVEL4, title);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder paragraph(String text){
|
||||
paragraph(AsciiDoc.HARDBREAKS, text);
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package io.github.robwin.markup.builder.markdown;
|
||||
|
||||
import io.github.robwin.markup.builder.Markup;
|
||||
@@ -13,7 +31,8 @@ public enum Markdown implements Markup {
|
||||
DOCUMENT_TITLE("# "),
|
||||
SECTION_TITLE_LEVEL1("## "),
|
||||
SECTION_TITLE_LEVEL2("### "),
|
||||
SECTION_TITLE_LEVEL3("### "),
|
||||
SECTION_TITLE_LEVEL3("#### "),
|
||||
SECTION_TITLE_LEVEL4("##### "),
|
||||
BOLD("**"),
|
||||
ITALIC("*"),
|
||||
LIST_ENTRY("* ");
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package io.github.robwin.markup.builder.markdown;
|
||||
|
||||
import io.github.robwin.markup.builder.AbstractMarkupDocBuilder;
|
||||
@@ -43,6 +61,12 @@ public class MarkdownBuilder extends AbstractMarkupDocBuilder
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder sectionTitleLevel4(String title){
|
||||
sectionTitleLevel3(Markdown.SECTION_TITLE_LEVEL4, title);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkupDocBuilder paragraph(String text){
|
||||
paragraph(Markdown.HARDBREAKS, text);
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Robert Winkler
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package io.github.robwin.markup.builder;
|
||||
|
||||
import org.junit.Before;
|
||||
|
||||
Reference in New Issue
Block a user