asciidoctor / asciidoctorj

:coffee: Java bindings for Asciidoctor. Asciidoctor on the JVM!
http://asciidoctor.org
Apache License 2.0
625 stars 173 forks source link

CLI should set :mkdirs option by default (#1241) #1244

Closed robertpanzer closed 10 months ago

robertpanzer commented 10 months ago

Thank you for opening a pull request and contributing to AsciidoctorJ!

Please take a bit of time giving some details about your pull request:

Kind of change

Description

What is the goal of this pull request?

Make the CLI set the :mkdirs option.

How does it achieve that?

Similar to the implementation of Asciidoctor it sets the option :mkdirs if the input is not read from stdin.

Are there any alternative ways to implement this?

Are there any implications of this pull request? Anything a user must know?

Issue

Fixes #1241

robertpanzer commented 10 months ago

@mojavelinux This PR should be a minimal solution for adding the mkdirs option as reported in #1241 It would generate all results directly into the target directory though, so it would at most create that target directory, but not any structure below that which would reflect the path of the documents relative to the source directory set with -R.

mojavelinux commented 10 months ago

That's fine because this is orthogonal to supporting **/*.adoc. Most uses of the CLI are to convert a single document to a specified output file or directory. That is what is needed at a minimum in order for AsciidoctorJ to be used with the Antora PDF extension.

mojavelinux commented 10 months ago

For the test, I would not recommend testing **/*.adoc. Leave that to the other PR. This PR should just test that the CLI will create the necessary directories to write the output to the specified file (singular).

mojavelinux commented 10 months ago

:tada: