<commit_before>asciidoctor-java-integration
============================
:asciidoc-url: http://asciidoc.org
:asciidoctor-url: http://asciidoctor.org
:issues-url: https://github.com/asciidoctor/asciidoctor-java-integration/issues

image:https://travis-ci.org/asciidoctor/asciidoctor-java-integration.png?branch=master["Build Status", link="https://travis-ci.org/asciidoctor/asciidoctor-java-integration"]

The +asciidoctor-java-integration+ is the official means of using {asciidoctor-url}[Asciidoctor] to render all your {asciidoc-url}[AsciiDoc] documentation using Java instead of Ruby.

== Installation

Since +asciidoctor-java-integration+ is a standard jar file, the only thing you should do is add library into classpath.

[source, xml]
.Dependency declaration in Maven
----
...
<dependencies>
  <dependency>
    <groupId>org.asciidoctor</groupId>
    <artifactId>asciidoctor-java-integration</artifactId>
    <version>${asciidoctor.version}</version>                   <1>
    ...
  </dependency>
</dependencies>
...
----

[source, groovy]
.Dependency declaration in Gradle
----
...
dependencies {
  compile('org.asciidoctor:asciidoctor-java-integration:${asciidoctor.version}') {
		transitive = false
	}
}
...
+----

<1> As this library tracks the version of asciidoctor, you can use which every version of asciidoctor you prefer.

== Usage

The core interface of +asciidoctor-java-integration+ is +Asciidoctor+ interface. It provides two methods for rendering asciidoc content, +render+ and +renderFile+. Both of them returns a string with rendered content.

.Method description
[cols="1,2" options="header"]
|===
|Name
|Description

|+render+
|Parse the AsciiDoc content into a Document and render it to the specified backend format.

|+renderFile+
|Parse the content of AsciiDoc file into a Document and render it to the specified backend format.
|===

Also a factory method is provided to create an instance of +Asciidoctor+ interface.

[source, java]
.Creation of Asciidoctor interface
----<commit_msg>Adds explanation on how to register asciidoctor-java-integration in Gradle.<commit_after>asciidoctor-java-integration
============================
:asciidoc-url: http://asciidoc.org
:asciidoctor-url: http://asciidoctor.org
:issues-url: https://github.com/asciidoctor/asciidoctor-java-integration/issues

image:https://travis-ci.org/asciidoctor/asciidoctor-java-integration.png?branch=master["Build Status", link="https://travis-ci.org/asciidoctor/asciidoctor-java-integration"]

The +asciidoctor-java-integration+ is the official means of using {asciidoctor-url}[Asciidoctor] to render all your {asciidoc-url}[AsciiDoc] documentation using Java instead of Ruby.

== Installation

Since +asciidoctor-java-integration+ is a standard jar file, the only thing you should do is add library into classpath.

[source, xml]
.Dependency declaration in Maven
----
...
<dependencies>
  <dependency>
    <groupId>org.asciidoctor</groupId>
    <artifactId>asciidoctor-java-integration</artifactId>
    <version>${asciidoctor.version}</version>                   <1>
    ...
  </dependency>
</dependencies>
...
----

[source, groovy]
.Dependency declaration in Gradle
----
...
dependencies {
	compile('org.asciidoctor:asciidoctor-java-integration:${asciidoctor.version}') {  <1>
		transitive = false
	}	
}
...
----

<1> As this library tracks the version of asciidoctor, you can use which every version of asciidoctor you prefer.

== Usage

The core interface of +asciidoctor-java-integration+ is +Asciidoctor+ interface. It provides two methods for rendering asciidoc content, +render+ and +renderFile+. Both of them returns a string with rendered content.

.Method description
[cols="1,2" options="header"]
|===
|Name
|Description

|+render+
|Parse the AsciiDoc content into a Document and render it to the specified backend format.

|+renderFile+
|Parse the content of AsciiDoc file into a Document and render it to the specified backend format.
|===

Also a factory method is provided to create an instance of +Asciidoctor+ interface.

[source, java]
.Creation of Asciidoctor interface
----
{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.0021983390327308255, 'mean_word_length': 4.563858695652174, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5674741', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1237, 'n_words': 369}