-
-
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.
refactor(core): New package structure to support multiple extensions …
…in the future
- Loading branch information
1 parent
adb2f5f
commit 78251a7
Showing
15 changed files
with
109 additions
and
55 deletions.
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
src/main/java/org/rodnansol/asciidoctorj/CodeBlockProcessor.java
This file was deleted.
Oops, something went wrong.
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
40 changes: 40 additions & 0 deletions
40
src/main/java/org/rodnansol/asciidoctorj/javasource/CodeBlockProcessor.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,40 @@ | ||
package org.rodnansol.asciidoctorj.javasource; | ||
|
||
import org.asciidoctor.ast.Document; | ||
import org.asciidoctor.extension.PreprocessorReader; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Interface describes a block processor blueprint that can handle different attributes from the 'javasource' include macro. | ||
* | ||
* @author nandorholozsnyak | ||
* @since 0.1.0 | ||
*/ | ||
public interface CodeBlockProcessor { | ||
|
||
/** | ||
* Checks if the current instance should be active for processing or not. | ||
* | ||
* @param attributes AsciiDoc attributes coming outside. | ||
* @return <b>true</b> if the processor must be active based on the attributes, otherwise <b>false</b> | ||
*/ | ||
boolean isActive(Map<String, Object> attributes); | ||
|
||
/** | ||
* Processes the incoming source code and creates and extra block into the requested document file. | ||
* | ||
* @param extractCommand base extract command. | ||
* @param document AsciiDoc document instance. | ||
* @param reader pre-processor reader. | ||
* @param target target section. | ||
* @param attributes AsciiDoc attributes. | ||
* @throws JavaSourceCodeExtractionException when the source code can not be read or transformed. | ||
*/ | ||
void process(ExtractCommand extractCommand, | ||
Document document, | ||
PreprocessorReader reader, | ||
String target, | ||
Map<String, Object> attributes); | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...odnansol/asciidoctorj/ExtractCommand.java → ...ciidoctorj/javasource/ExtractCommand.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.rodnansol.asciidoctorj; | ||
package org.rodnansol.asciidoctorj.javasource; | ||
|
||
import java.util.Objects; | ||
|
||
|
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
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
2 changes: 1 addition & 1 deletion
2
...rj/JavaSourceCodeExtractionException.java → ...ce/JavaSourceCodeExtractionException.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
2 changes: 1 addition & 1 deletion
2
...nansol/asciidoctorj/JavaSourceHelper.java → ...idoctorj/javasource/JavaSourceHelper.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
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
2 changes: 1 addition & 1 deletion
2
src/main/resources/META-INF/services/org.asciidoctor.jruby.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 |
---|---|---|
@@ -1 +1 @@ | ||
org.rodnansol.asciidoctorj.JavaSourceExtension | ||
org.rodnansol.asciidoctorj.CustomExtensionRegistry |
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