-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
102 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
group 'me.loki2302' | ||
version '1.0-SNAPSHOT' | ||
|
||
apply plugin: 'java' | ||
|
||
sourceCompatibility = 1.8 | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testCompile group: 'junit', name: 'junit', version: '4.11' | ||
compile 'org.asciidoctor:asciidoctorj:1.5.4' | ||
} |
13 changes: 13 additions & 0 deletions
13
buildSrc/src/main/java/me/loki2302/DummyExtensionRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package me.loki2302; | ||
|
||
import org.asciidoctor.Asciidoctor; | ||
import org.asciidoctor.extension.JavaExtensionRegistry; | ||
import org.asciidoctor.extension.spi.ExtensionRegistry; | ||
|
||
public class DummyExtensionRegistry implements ExtensionRegistry { | ||
@Override | ||
public void register(Asciidoctor asciidoctor) { | ||
JavaExtensionRegistry javaExtensionRegistry = asciidoctor.javaExtensionRegistry(); | ||
javaExtensionRegistry.block("dummy-buildsrc", DummyPlugin.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package me.loki2302; | ||
|
||
import org.asciidoctor.ast.AbstractBlock; | ||
import org.asciidoctor.extension.BlockProcessor; | ||
import org.asciidoctor.extension.Reader; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class DummyPlugin extends BlockProcessor { | ||
public DummyPlugin(String name, Map<String, Object> config) { | ||
super(name, new HashMap<String, Object>() {{ | ||
put("contexts", Arrays.asList(":paragraph")); | ||
put("content_model", ":simple"); | ||
}}); | ||
} | ||
|
||
@Override | ||
public Object process(AbstractBlock parent, Reader reader, Map<String, Object> attributes) { | ||
return createBlock( | ||
parent, | ||
"paragraph", | ||
String.format("I am Java extension (%s)", reader.read()), | ||
attributes, | ||
new HashMap()); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...dSrc/src/main/resources/META-INF/services/org.asciidoctor.extension.spi.ExtensionRegistry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
me.loki2302.DummyExtensionRegistry |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Sun Aug 28 17:55:49 EDT 2016 | ||
#Sat Oct 01 17:33:46 EDT 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
= Extension hello world | ||
|
||
[dummy] | ||
Hello world | ||
[dummy-inline] | ||
I am dummy-inline extension input | ||
|
||
End. | ||
[dummy-buildsrc] | ||
I am dummy-buildsrc extension input | ||
|
||
End. |