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

WIP: Added Office plugin for Asciidoctorj #557

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mattes3
Copy link

@mattes3 mattes3 commented Mar 17, 2021

PLEASE DO NOT MERGE THIS PULL REQUEST, YET!

I need help because the one-liner that I added breaks the existing tests. Could you please have a look why this happens?

Thank you,
Matthias

@rdmueller
Copy link
Member

I tried to read and undestand the logs, but something strange happened here. So I just triggered the build again to see if it maybe was just a hickup

@rdmueller
Copy link
Member

no hickup :-(

@rdmueller
Copy link
Member

so, it seems that these tests really fail.
I ran ./gradlew test locally and checked the report.

This seems to be the root cause:

Caused by: groovy.lang.MissingMethodException: No signature of method: org.asciidoctor.jruby.internal.JRubyAsciidoctor.renderFile() is applicable for argument types: (File, LinkedHashMap) values: [/home/rdmueller/projects/clean/tmp/docToolchain/src/test/docs/simplePresentation.adoc, ...]
Possible solutions: convertFile(java.io.File, java.util.Map), convertFile(java.io.File, org.asciidoctor.Options), convertFile(java.io.File, org.asciidoctor.OptionsBuilder)
	at org.asciidoctor.gradle.AsciidoctorProxyImpl.renderFile(AsciidoctorProxyImpl.groovy:26)
	at org.asciidoctor.gradle.AsciidoctorProxy$renderFile.call(Unknown Source)
	at org.asciidoctor.gradle.AsciidoctorTask.processSingleFile(AsciidoctorTask.groovy:676)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.asciidoctor.gradle.AsciidoctorTask$_processDocumentsAndResources_closure7.doCall(AsciidoctorTask.groovy:656)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.asciidoctor.gradle.AsciidoctorTask.processDocumentsAndResources(AsciidoctorTask.groovy:651)
	... 108 more

@rdmueller
Copy link
Member

so, it seems that the plugin brings its own dependencie to asciidoctorj along.

Can you please try to specify the dependency as follows:

    asciidoctor (group: 'org.uniqueck', name: 'asciidoctorj-office-extension', version: '0.0.1-alpha') {
        exclude group: 'org.asciidoctor', module: 'asciidoctorj'
    }

this turns the tests at least to green, but I don't know if the plugin then still works.

@mattes3
Copy link
Author

mattes3 commented Mar 23, 2021

Thank you, Ralf, for analyzing this. I'll have a look at what happens now.

@rdmueller
Copy link
Member

Could you already test if the extension still works?

@mattes3
Copy link
Author

mattes3 commented Mar 23, 2021

Not yet, I was in a training the whole day. However, I made it compile and test, then I committed it.

How can I easily test it on a new document that contains the slide::/path/to/powerpointFile.pptx[slideNumber=1] syntax, without needing to build a docker image for doctoolchain?

@rdmueller
Copy link
Member

ok. I will try to test it... hold on...

@rdmueller
Copy link
Member

hm. I cloned docToolchain and added to the file src/docs/manual.adoc the following lines:

slide::Demo.pptx[slideNumber=1]

excel::Sample.xlsx[sheetName=Werte]

I then did a ./gradlew generateHTML and checked the resulting build/docs/html5/manual.html - didn't work :-(

@uniqueck
Copy link
Member

uniqueck commented Apr 2, 2021

Hi guys,

please use the version 0.0.1-alpha.2 this is the latest version. I have to invest some time to move away from bintray to maven central.

// See https://github.com/uniqueck/asciidoctorj-office-extension
// asciidoctor 'com.uniqueck:asciidoctorj-office-extension:0.0.1-alpha'
// https://mvnrepository.com/artifact/org.uniqueck/asciidoctorj-office-extension
asciidoctor (group: 'org.uniqueck', name: 'asciidoctorj-office-extension', version: '0.0.1-alpha') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
asciidoctor (group: 'org.uniqueck', name: 'asciidoctorj-office-extension', version: '0.0.1-alpha') {
asciidoctor (group: 'com.uniqueck', name: 'asciidoctorj-office-extension', version: '0.0.1-alpha.2') {

@mattes3
Copy link
Author

mattes3 commented Apr 2, 2021

Hi @uniqueck Constantin, thanks for the tip and the offer to help, appreciate this!

I tried to use the version that you suggested but unfortunately, it is not in the Maven jcenter repository. See here: https://mvnrepository.com/artifact/org.uniqueck/asciidoctorj-office-extension

Could you have a look, why this is so?

@uniqueck
Copy link
Member

uniqueck commented Apr 2, 2021

Hi @mattes3, i realize this also yesterday for my example repostiory. I don't know why this is only for this extension a problem. As a workaround I added this following to the repositories sections.

maven { url "https://dl.bintray.com/uniqueck/asciidoctorj" }

Please also accept the suggested code above, because the groupId differs between this versions.

@uniqueck
Copy link
Member

uniqueck commented Apr 2, 2021

so, it seems that the plugin brings its own dependencie to asciidoctorj along.

Can you please try to specify the dependency as follows:

    asciidoctor (group: 'org.uniqueck', name: 'asciidoctorj-office-extension', version: '0.0.1-alpha') {
        exclude group: 'org.asciidoctor', module: 'asciidoctorj'
    }

this turns the tests at least to green, but I don't know if the plugin then still works.

I check this and define it as a provided dependency.

@mattes3
Copy link
Author

mattes3 commented Apr 7, 2021

@uniqueck Hi Constantin, I have made your changes but the build still breaks. Can you have a look?

@rdmueller
Copy link
Member

    > Could not resolve all files for configuration ':asciidoctor'.
       > Could not find com.uniqueck:asciidoctorj-office-extension:0.0.1-alpha.2.
         Searched in the following locations:
           - https://jcenter.bintray.com/com/uniqueck/asciidoctorj-office-extension/0.0.1-alpha.2/asciidoctorj-office-extension-0.0.1-alpha.2.pom

@uniqueck
Copy link
Member

uniqueck commented Apr 7, 2021

This extension is now in maven central available. Please have a look at the issue #556 for more details. You have to change the groupId to de.uniqueck.asciidotorj.extensions and the first new release version is 0.1.0. The reference to bintray and jcenter can be removed. Let me know if this helps.

@mattes3
Copy link
Author

mattes3 commented Apr 8, 2021

Now the tests run fine.
Afterwards, I tried what you, Ralf, tried above:

added to the file src/docs/manual.adoc the following lines:

slide::Demo.pptx[slideNumber=1]

I then did a ./gradlew generateHTML and checked the resulting build/docs/html5/manual.html - didn't work :-( The line that I inserted did not make Asciidoctor include the image but the line simply appeared in my output HTML document.

@uniqueck, could you check if you can find out why nothing happens?

@uniqueck
Copy link
Member

uniqueck commented Apr 8, 2021

This extension needs asciidoctorj 2.1.0. I have to check if i can downgrade these dependencies. For the meanwhile you can check this working example. https://github.com/uniqueck/asciidoctorj-extension-gradle-example

@uniqueck
Copy link
Member

uniqueck commented Apr 8, 2021

@rdmueller is it for doctoolchain possible to update asciidoctorj to a version greater or equal to 2.1.0?

@rdmueller
Copy link
Member

@uniqueck - that's on my list. But not for the 1.3.x version - only for the 2.0.x which is currently under heavy developtment (ng-branch)

@rdmueller rdmueller marked this pull request as draft September 10, 2022 12:17
@rdmueller rdmueller changed the title Added Office plugin for Asciidoctorj WIP: Added Office plugin for Asciidoctorj Jan 14, 2023
@mh182
Copy link
Collaborator

mh182 commented Apr 12, 2023

We upgraded to asciidoctorj 2.5.7.

The question is if this feature is still needed/requested. Otherwise I would close the PR until someone needs it.

@mh182 mh182 linked an issue Apr 12, 2023 that may be closed by this pull request
@rdmueller
Copy link
Member

The question is if this feature is still needed/requested. Otherwise I would close the PR until someone needs it.

it is still a great feature, let's see if @uniqueck will find some time to work on it.

@uniqueck
Copy link
Member

uniqueck commented May 4, 2023

What is open? Is there a bug?

@mattes3
Copy link
Author

mattes3 commented May 5, 2023

In 2021, this was important to my clients. Now in 2023, it would still be great to have.

@mh182
Copy link
Collaborator

mh182 commented May 5, 2023

What is open? Is there a bug?

Probably nothing from the plugin side. This PR was started by @mattes3 but was blocked since docToolchain used an outdated asciidoctorj plugin. Now we upgraded to the latest asciidoctorj plugin and I wanted to know if someone is willing to stand up and finish it.

Since there is not much code (know-how) in the PR I would rather close it than people believing someone is working on the feature but in reality nothing happens.

@uniqueck
Copy link
Member

uniqueck commented May 5, 2023

So are we sure that all is working as expected?

@rdmueller
Copy link
Member

@uniqueck , no I guess nobody has tested it yet. I thought there are still things to change/implement after we've uodated the asciidoctor version.

Afaik, the powerpoint support by this plugin is better than what we currently have (works on linux). So I still think this plugin would be nice to have...

@uniqueck
Copy link
Member

uniqueck commented May 5, 2023

Ok I will check this and ask for some help if I stuck.

@uniqueck
Copy link
Member

uniqueck commented May 6, 2023

Ok I'm completely lost in this gradle stuff, where I have to declare external dependencies for my extension, so that the asciidoctorj task register thie extension and I can use the slide block macro. I thought the goal of doctoolchain ng was, make all a little bit simpler.

I tried to defined a configuration for asciidcoctorExtensions and add this configuration to dependencies with my office extension.
I the script AsciiDocBasics I added configuration 'asciidoctorExtensions', but no effect.

@uniqueck
Copy link
Member

uniqueck commented May 6, 2023

The second thing I realized, is that the PR points to the wrong target branch, or I'm wrong? I need asciidoctorj 2.x for this extension, so we have to relocate it to the ng branch.

I think we have to provide a documentation part, how someone can add an own asciidoctorj extension for dtcw.

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.

Add direct access to PPT slides using asciidoctorj-office-extension
4 participants