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

FOP plugin #5

Merged
merged 1 commit into from
Feb 15, 2019
Merged

FOP plugin #5

merged 1 commit into from
Feb 15, 2019

Conversation

dubinsky
Copy link
Contributor

Thank you, @rototor, for all the hard work making JEuclid work with current libraries and JDKs!
I need JEuclid's FOP plugin in my project.
Turns out that local copy of the original sources of the plugin just works using your JEuclid artifact!
In case I am not the last person using the FOP plugin, maybe it can be distributed side-by-side with the core?

Changes:

  • restored as-is original Java sources of the FOP plugin;
  • did not restore ServiceLoader provider-configuration files under META-INF/services;
    with them, plugin would be auto-configured for all FOP runs;
    now it can be configured for a specific FopFactory using
    new class JEuclidFopFactoryConfigurator's configure() method;
  • restored plugin's src/site/site.xml file;
  • restored and cleaned up plugin's POM;
  • packaging as an artifact that depends on the JEuclid core, not including it in the plugin JAR;
  • re-added plugin module to the main POM and brought FOP version up-to-date.

- restored as-is original Java sources of the FOP plugin;
- did not restore ServiceLoader provider-configuration files under META-INF/services;
  with them, plugin would be auto-configured for all FOP runs;
  now it can be configured for a specific FopFactory using
  new class JEuclidFopFactoryConfigurator.configure();
- restored plugin's src/site/site.xml file;
- restored and cleaned up plugin's POM;
- re-added plugin module to the main POM and brought FOP version up-to-date.
@rototor
Copy link
Owner

rototor commented Feb 15, 2019

Looks good to me, I'll try to release this to maven central soon, but I am currently very busy, so it can take a week till I find time.

@rototor rototor merged commit c9c8ea9 into rototor:master Feb 15, 2019
@rototor
Copy link
Owner

rototor commented Feb 24, 2019

FYI: I just released version 3.1.14 with the FOP plugin. It should show up soon on maven central.

@dubinsky
Copy link
Contributor Author

It's there, so I can now remove local copy from my DocBook Gradle plugin!
Thank you very much!

@philipru
Copy link
Contributor

Hi, I just tried to use the jeuclid-fop-3.1.14.jar and jeuclid-core-3.1.14.jar from de.rototor.jeuclid with FOP 2.3 but the MathML is not rendered and I get warnings like the following:

WARNING: Unknown formatting object "{http://www.w3.org/1998/Math/MathML}math"
encountered (a child of fo:instream-foreign-object}

I'm using XSL-FO like this:

<fo:instream-foreign-object>
<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mstyle displaystyle="true">
    <mi>a</mi>
    <mo>=</mo>
    <msup>
      <mi>b</mi>
      <mn>2</mn>
    </msup>
    <mo>+</mo>
    <mi>c</mi>
  </mstyle>
</math>
</fo:instream-foreign-object>

The MathML renders if I use FOP 2.2 and the unforked jeuclid-fop-3.1.9.jar from net.sourceforge.jeuclid but I need to use FOP 2.3 and batik 1.10. Do you have any ideas why it wouldn't work?

Many thanks
Philip

@dubinsky
Copy link
Contributor Author

I just tried to use the jeuclid-fop-3.1.14.jar and jeuclid-core-3.1.14.jar from de.rototor.jeuclid with FOP 2.3 but the MathML is not rendered and I get warnings like the following:

WARNING: Unknown formatting object "{http://www.w3.org/1998/Math/MathML}math"
encountered (a child of fo:instream-foreign-object}

The MathML renders if I use FOP 2.2 and the unforked jeuclid-fop-3.1.9.jar from net.sourceforge.jeuclid but I need to use FOP 2.3 and batik 1.10. Do you have any ideas why it wouldn't work?

FOP plugin is not enabled by default; as mentioned in this pull requests's original description,
to enable it you need to call JEuclidFopFactoryConfigurator.configure() for your FopFactory.
See https://github.com/rototor/jeuclid/blob/master/jeuclid-fop/src/main/java/net/sourceforge/jeuclid/fop/plugin/JEuclidFopFactoryConfigurator.java

If you want to document this better, please create a pull request ;)

@philipru
Copy link
Contributor

Thanks so much! I should have seen that. It works perfectly now.

Cheers
Philip

@dubinsky
Copy link
Contributor Author

Thanks so much! I should have seen that. It works perfectly now.

You may still want to make a pull request documenting this for the next person :)

@philipru
Copy link
Contributor

Sure. Just to confirm, do you mean I should edit the README.md file?

@dubinsky
Copy link
Contributor Author

@philipru

Just to confirm, do you mean I should edit the README.md file?

You should edit (or add) a file that you would have seen the instructions in had they been there :)
Hopefully the next person will see them there.

@timbsng
Copy link

timbsng commented Nov 18, 2019

@philipru can you please go a bit more in detail for a novice on what you did?

Coming from http://jeuclid.sourceforge.net/jeuclid-fop/ , they state all the 'installation' requires is copying jeuclid-core-x.x.x.jar and jeuclid-fop-x.x.x.jar into the fop's /lib directory.
How does the installation of this fork differ to these instructions? Where did you put JEuclidFopFactoryConfigurator.configure()?

Thank you so much in advance!

@philipru
Copy link
Contributor

philipru commented Nov 18, 2019 via email

@timbsng
Copy link

timbsng commented Nov 21, 2019

Thank you!
Just to be sure, this means it will only work with my own Java application? Up to now I've only been using the fop CLI.

@philipru
Copy link
Contributor

philipru commented Nov 21, 2019 via email

@dubinsky
Copy link
Contributor Author

dubinsky commented Dec 1, 2019

@philipru thank you for updating the README!

@dubinsky
Copy link
Contributor Author

dubinsky commented Dec 1, 2019

@philipru for my Gradle DocBook plugin I coded an integration between FOP and MathJax
that can be used independently of DocBook (or Gradle);
this is completely off-topic here, so if you want to play with it, you can talk to me
in https://github.com/dubinsky/podval-docbook-gradle or over email :)

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.

4 participants