Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent arguments in Asciidoctor #7493

Closed
helfper opened this issue Jul 18, 2020 · 1 comment · Fixed by #7494
Closed

Inconsistent arguments in Asciidoctor #7493

helfper opened this issue Jul 18, 2020 · 1 comment · Fixed by #7494

Comments

@helfper
Copy link
Contributor

helfper commented Jul 18, 2020

At the moment, the handling of the arguments passed to Asciidoctor CLI is very inconsistent.

A few examples:

With no asciidocext options in the config.toml, the args passed to Asciidoctor are:

--no-header-footer --trace -

config.toml:

[markup.asciidocext]
trace = true

Asciidoctor args:

--no-header-footer --trace --trace -

config.toml:

[markup.asciidocext]
trace = false

Asciidoctor args:

--no-header-footer --trace -

config.toml:

[markup.asciidocext]
verbose = false

Asciidoctor args:

--no-header-footer -v --trace -

config.toml:

[markup.asciidocext]
verbose = true

Asciidoctor args:

--no-header-footer --trace -

It seems the implementation had two goals in mind:

  1. Allow Hugo to have different defaults from Asciidoctor CLI
  2. Minimize the arguments passed to Asciidoctor by skipping options that are already the default in Asciidoctor CLI

The problem is that to achieve this, we need two sets of default values: Hugo's and Asciidoctor's. However, the current implementation only has one set of defaults which for some options it seems to mean Hugo's defaults and for others it means Asciidoctor's defaults.

I think there are three options to solve the issue:

  1. The cleanest one would be to just have two default configs: Hugo's and Asciidoctor's, so that both goals above can be easily met
  2. Only have Hugo's defaults and don't minimize arguments - avoids the need for a second var with config defaults, but it may be too noisy in the logs while debugging
  3. Specify explicitly which options are meant to be Hugo's defaults and which ones are Asciidoctor's defaults. In this case, default values for options of type string have to either match Asciidoctor's defaults, or not be minimized and always be set explicitly; default values for options of type boolean can mean Hugo's defaults and still be minimized, because in Asciidoctor CLI, boolean flags are always false by default.

The option 3 seems to have been the aim of the current implementation, because the defaults are not exactly the same as Asciidoctor's defaults, but then it assumes that's the case when trying to minimize them.

@bep bep added this to the 0.74.3 milestone Jul 23, 2020
@bep bep closed this as completed in #7494 Jul 23, 2020
bep pushed a commit that referenced this issue Jul 23, 2020
* Fix Asciidoctor args

* Fix Asciidoctor args documentation

* Update AsciiDoc documentation

Co-authored-by: Derk Muenchhausen <[email protected]>

Fixes #7493
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants