forked from asciidoctor/asciidoctorj
-
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.
v3 migration guide for 'Asciidoctor' removed methods
Fixes asciidoctor#1201
- Loading branch information
1 parent
050b4e4
commit 5b20ad4
Showing
2 changed files
with
75 additions
and
0 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
73 changes: 73 additions & 0 deletions
73
docs/modules/guides/partials/removal-of-deprecated-methods-in-asciidoctor.adoc
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,73 @@ | ||
== Removal of deprecated methods in `org.asciidoctor.Asciidoctor` | ||
|
||
Several methods in `org.asciidoctor.Asciidoctor` that were marked as `@Deprecated` have been removed. | ||
|
||
=== Removal of methods using `Map<String,Object>` as options input | ||
|
||
To streamline the API, only methods using `Options` instances have been left in the `org.asciidoctor.Asciidoctor`. | ||
That means that the following methods are no longer available. | ||
|
||
[,java] | ||
.Removed convert methods | ||
---- | ||
String convert(String content, Map<String, Object> options); | ||
String convertFile(File file, Map<String, Object> options); | ||
void convert(Reader contentReader, Writer rendererWriter, Map<String, Object> options) throws IOException; | ||
<T> T convert(String content, Map<String, Object> options, Class<T> expectedResult); | ||
<T> T convertFile(File file, Map<String, Object> options, Class<T> expectedResult); | ||
String[] convertDirectory(Iterable<File> directoryWalker, Map<String, Object> options); | ||
String[] convertFiles(Collection<File> files, Map<String, Object> options); | ||
---- | ||
|
||
[,java] | ||
.Removed load methods | ||
---- | ||
Document load(String content, Map<String, Object> options); | ||
Document loadFile(File file, Map<String, Object> options); | ||
---- | ||
|
||
For each of the methods above there's an equivalent using `org.asciidoctor.Options`. | ||
Use those when migrating to v3.0.0. | ||
|
||
=== Removal of methods using `OptionsBuilder` as options input | ||
|
||
Likewise to the methods seen in the previous section, the following methods are also no longer available. | ||
|
||
[,java] | ||
.Removed convert methods | ||
---- | ||
String convert(String content, OptionsBuilder options); | ||
String convertFile(File file, OptionsBuilder options); | ||
void convert(Reader contentReader, Writer rendererWriter, OptionsBuilder options) throws IOException; | ||
<T> T convert(String content, OptionsBuilder options, Class<T> expectedResult); | ||
<T> T convertFile(File file, OptionsBuilder options, Class<T> expectedResult); | ||
String[] convertDirectory(Iterable<File> directoryWalker, OptionsBuilder options); | ||
String[] convertFiles(Collection<File> files, OptionsBuilder options); | ||
---- | ||
|
||
For each of the methods above there's an equivalent using `org.asciidoctor.Options.Options`. | ||
Use those when migrating to v3.0.0. | ||
|
||
=== Removal of methods `readDocumentHeader` | ||
|
||
All implementations of `Asciidoctor::readDocumentHeader` have been removed because the same feature can be obtained using `load` with the `parse_header_only` option. | ||
|
||
[,java] | ||
.Using load to obtain Document header | ||
---- | ||
Options options = Options.builder().option("parse_header_only", true).build(); | ||
Document document = asciidoctor.loadFile(documentHeaders, options); | ||
List<Author> authors = document.getAuthors(); | ||
RevisionInfo revisionInfo = document.getRevisionInfo(); | ||
String doctitle = document.getDoctitle(); | ||
Title structuredDoctitle = document.getStructuredDoctitle(); | ||
---- | ||
|
||
As a consequence, class `org.asciidoctor.ast.DocumentHeader` has been also removed. |