https://github.com/forge/asciidoctorj-addon
AsciidoctorJ add-on for Forge 2
https://github.com/forge/asciidoctorj-addon
Last synced: 12 months ago
JSON representation
AsciidoctorJ add-on for Forge 2
- Host: GitHub
- URL: https://github.com/forge/asciidoctorj-addon
- Owner: forge
- Created: 2015-06-17T22:42:38.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-31T04:22:56.000Z (over 10 years ago)
- Last Synced: 2025-01-21T08:44:31.283Z (about 1 year ago)
- Language: Java
- Homepage: https://github.com/asciidoctor/asciidoctorj
- Size: 145 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.asciidoc
Awesome Lists containing this project
README
== asciidoctorj-addon
:idprefix: id_
image:https://travis-ci.org/forge/asciidoctorj-addon.svg?branch=master["Build Status", link="https://travis-ci.org/forge/asciidoctorj-addon"]
This addon provides *standalone* functionality, and *exports services* for use in other addons.
=== Depends on
[options="header"]
|===
|Addon |Exported |Optional
|resources
|yes
|no
|===
== Setup
This Addon requires the following installation steps.
=== Add configuration to pom.xml
To use this addon, you must add it as a dependency in the *pom.xml* of your `forge-addon` classified artifact:
[source,xml]
----
org.jboss.forge.addon
asciidoctorj-addon
forge-addon
${version}
----
== Features
AsciidocFileResource for Asciidoc files::
Allows easy manipulation of asciidoc data
+
[source,java]
----
@Inject private ResourceFactory factory;
...
AsciidocFileResource resource = factory.createResource(AsciidocFileResource.class, new File("document.adoc"));
Document document = resource.getDocument();
Section section = (Section) document.blocks().get(1);
// More info in https://github.com/asciidoctor/asciidoctorj#jruby-wrapping-classes
...
----
+
[TIP]
====
If your addon uses a container that does not support "@Inject" annotations, services such as the `ResourceFactory` may also be
accessed via the `AddonRegistry`:
----
Imported imported = addonRegistry.getServices(ResourceFactory.class);
ResourceFactory factory = imported.get();
----
====