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

Upgrade & refactor asciidoctor-maven-plugin config #284

Conversation

abelsromero
Copy link
Contributor

  • Bump asciidoctor-maven-plugin to v2.2.2
  • Bump AsciidoctorJ to v2.5.6
  • Bump AsciidoctorJ PDF to v2.1.6
  • Refactor configuration
    • To remove duplication
      • Added Maven properties for shared versions and paths.
      • Use common in plugins for all executions.
    • Removed unused elements
      • imagesdir attribute in html already uses default value.
      • imagesdir in pdf no longer requires to point to target (issue fixed in upstream).
    • Created single executions to convert only required files: index, toc, release-notes.
      This has the advantatge that displays errors/warning for each file as independent
      steps during maven build.
  • Other changes
    • Set source-highlighter in PDF to rouge which is current recommended.
    • Set outputFile to 'reference.pdf' for convenience.

* Bump asciidoctor-maven-plugin to v2.2.2
* Bump AsciidoctorJ to v2.5.6
* Bump AsciidoctorJ PDF to v2.1.6
* Refactor configuration
  * To remove duplication
    * Added Maven properties for shared versions and paths.
    * Use common <configuguration> in plugins for all executions.
  * Removed unused elements
    * imagesdir attribute in html already uses default value.
    * imagesdir in pdf no longer requires to point to target (issue fixed in upstream).
  * Created single executions to convert only required files: index, toc, release-notes.
    This has the advantatge that displays errors/warning for each file as independent
    steps during maven build.
* Other changes
  * Set source-highlighter in PDF to rouge which is current recommended.
  * Set outputFile to 'reference.pdf' for convenience.
@abelsromero
Copy link
Contributor Author

Build shows several errors for toc.adoc that now are easier to spot and fix. I can tackle those in another PR if this is fine.

mvn clean generate-resources -P generate-html -pl asciidoc -am
----
[INFO] --- asciidoctor-maven-plugin:2.2.2:process-asciidoc (generate-toc-html) @ asciidoc ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 3 resources
[INFO] asciidoctor: WARN: distributed/jdbc/jdbc-integraions.adoc: line 19: section title out of sequence: expected level 3, got level 4
[INFO] asciidoctor: WARN: distributed/jdbc/jdbc-integraions.adoc: line 48: section title out of sequence: expected level 3, got level 4
[INFO] asciidoctor: WARN: distributed/jdbc/jdbc-integraions.adoc: line 48: id assigned to section already in use: listener
[INFO] asciidoctor: WARN: advanced/listener.adoc: line 2: id assigned to section already in use: listener
[INFO] asciidoctor: INFO: possible invalid reference: tokens-inheritance-strategy-proportionally
[INFO] asciidoctor: INFO: possible invalid reference: tokens-inheritance-strategy-as-is
[INFO] asciidoctor: INFO: possible invalid reference: tokens-inheritance-strategy-additive
[INFO] asciidoctor: INFO: possible invalid reference: tokens-inheritance-strategy-proportionally
[INFO] asciidoctor: INFO: possible invalid reference: tokens-inheritance-strategy-as-is
[INFO] asciidoctor: INFO: possible invalid reference: tokens-inheritance-strategy-additive
[INFO] asciidoctor: INFO: possible invalid reference: tokens-inheritance-strategy-as-is
[INFO] Converted /home/asalgadr/github/bucket4j/asciidoc/src/main/docs/asciidoc/toc.adoc
----

@vladimir-bukhtoyarov vladimir-bukhtoyarov changed the base branch from master to try_new_asciidoctor August 2, 2022 19:23
@vladimir-bukhtoyarov vladimir-bukhtoyarov merged commit f133e0a into bucket4j:try_new_asciidoctor Aug 2, 2022
@vladimir-bukhtoyarov
Copy link
Collaborator

Hello @abelsromero

Thank you, all looks good, excepting that for profile generate-html-plain does not work now, because index.html and release-notes.html are empty now. This profile is used each time when I do release to generate files:

I have merged this request the to the branch try_new_asciidoctor please use it for next requests related to asciidoctor migration. If you know how to fix generate-html-plain it will be nice to provide correspondent pull-request.

@abelsromero
Copy link
Contributor Author

I have merged this request the to the branch try_new_asciidoctor please use it for next requests related to asciidoctor migration

Excellent idea 👍

Thank you, all looks good, excepting that for profile generate-html-plain does not work now, because index.html and release-notes.html are empty now. This profile is used each time when I do release to generate files:

Found it, doctype must be Inline in uppercase. In fact I think we can remove the use of doctype, it does not apply if we are building a single page HTML document(s).

This profile is used each time when I do release to generate files:

If I understand correctly, for a release the process would be:

  • Generate toc.html with generate-html
  • Generate index.html & release-notes.html with generate-html-plain
  • Manually copy and place those files under proper path: index in the root path and the other two under the version directory.

If that's the case, we can just setup a single profile "generate-html-docs" that does exactly that. Leaving index in the directory above the version one.
Also keep the PDF which I guess is a nice-to-have but is not being used to publish any content.

@vladimir-bukhtoyarov
Copy link
Collaborator

vladimir-bukhtoyarov commented Aug 3, 2022

Yes, you correctly understand release process, I do not have objections to merge html generation in one profile.

@vladimir-bukhtoyarov
Copy link
Collaborator

Thank you very much. Has been merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants