JATS XML wysiwyg editor

Greetings to the community,

I have mostly done the work on the second version of JATS Parser, which transforms JATS XML into PHP objects:

As the work is on the finishing stage, I’m thinking about creating WYSIWYG editor. I know that PKP team is already working on it, so it would be great to hear any ideas. For now, I’m considering 2 options:

  1. Editor based on substance/texture. @axfelix, maybe you can shed some light on how to work with it?
  2. Editor based on TinyMCE. This option looks quite easy and straightforward to me. Write the data from PHP objects to TinyMCE’s HTML and save data from TinyMCE to JATS XML. Also, we can use TinyMCE’s HTML to write the data into PDF (looking at the TCPDF PHP library).
3 Likes

Hi Vitaliy,

Texture is very easy to work with, but it has no knowledge of PHP objects; it imports JATS directly.

You can integrate Texture fairly easily as we’ve done in our OJS plugin, like so: https://github.com/pkp/ojs3-markup/blob/master/templates/editor.tpl

Let me know if you have any more specific questions!

Thanks for reply @axfelix
About more questions:

  1. How to add support for additional JATS XML tags? Can you point me the example?

  2. What is the mechanism for parsing JATS XML tags? Simple selecting with JQuery? And what is the mechanism of saving HTML to JATS? As I understand, substance is a library for DOM manipulation and texture is its implementation for JATS XML. I am interested, for example, in how it deals with complex text editing tasks, like: <p>some normal text<bold>bold text<italic>at the same time bold and italic text <sup>and even superscipt</sup></italic></bold</p>.

Hi Vitaliy,

  1. Texture is currently built around a subset of JATS called JATS4M by the Substance maintainers, documented here: https://github.com/substance/dar. New tags and pull requests will be considered by them, but they’d prefer that importers be written to coerce other flavours of JATS into this format as long as Texture is officially prerelease.

  2. The Substance code has changed a lot since I last tried to do any meaningful work on it, but you might start here: https://github.com/substance/substance/blob/develop/dom/DOMElement.js

Did you manage to include the WYSIWYG Editor? Or is this project on hold?

Planning to make a new release of JATS Parser plugin next month. It will include JATS XML to PDF automatic convertion (apart from JATS to HTML). You can view the example on our site: https://e-medjournal.com/index.php/psp/article/view/93?download=pdf

Then the DOCX to JATS converter is planned. And only after this WYSIWYG TinyMCE-based editor.

Hi,
We run a small journal with just a two ember team, its a cultural journal that publishes issues on a quarterly basis, however, the work constantly keeps getting delayed due to the publishing cycle and we were looking to streamline the workflow. We landed on OJS3 and out of the box it seems to fulfil most of our needs, except this;

  1. It will really be helpful, if the authors can be presented with a text-editor at the submission step, where they can have an option of pasting their text. Most of the articles published in our journal do not have much citations (they are more journalistic in nature). They have images and captions, so it would be much easier for them to submit it in this way, and they can also choose to upload a pdf to detail the exact location of images, captions etc. This seems to be a long standing request and it is surprising that an advanced system such as OJS3 does not provide this.

  2. Sometime, the submissions we receive do not quite fit the issue we have in mind, but we still want to publish the articles. In our existing framework, we created a blog section to do the same, however it does not do much justice to the submissions. So, will it be possible to publish standalone articles, and generate a feed of those on a page/section of the front end? How does one go about that?

Would be grateful for a quick response. I am fairly into coding myself, so a few directions would be helpful.

I have read the documentation as well as the forum, and the submission requirement seems not to be answered anywhere, except for the conversion of DOCX to XML using the OTS, which is a great method, but we feel its not really relevant for the publication we have (we do not really need something like that at the moment)

If you are asking about JATS Parser plugin, it has already features of transforming JATS XML to HTML and to PDF. The next step is planned on autumn and is for DOCX to JATS XML transformation. Online editor will be a last step and will appear not earlier than in 2019. And as you can see, JATS is a pivotal format in all kinds of transformation.

If you have some coding experience, integrating TinyMCE and saving the content in HTML is not very hard.

Hi Vitaliy,
Thanks for responding so quickly. I have been reading your posts and really love the work you have put in for the parser.

I am fine with integrating the TinyMCE and saving the HTML content, have done it in some previous projects too. It would be helpful to know, what files/modules to edit and if the submitted HTML text will still have the same revision process. In other words, where should I be looking to simply add the tinyMCE field in the submissions stage, in python-django, for example, I have extended the existing models by adding new fields, and it has been easy to pull the content and show it on front-end too.
So where should I begin, so as to not break the system. Could I instead try to use the Texture for the users to submit the text?

Thanks you once again.

Best.

Please could you also let me know a bit about publishing standalone articles? as in not part of an issue, but function more like a blog.

Thanks much.

The link to a project that integrates the Texture editor to OJS 3: https://github.com/kaschioudi/ojs3-markup
Basically, in the code you can find possible ways of implementing a text editor to OJS (I’m not an expert in this).

We have news articles that a published like a simple OJS article but in a separate section.

Thanks Vitaliy,

I will get cracking on this, will update when I have something working.

Best.

Hi all,

By the way, I’ve recently split the OTS and Texture integrations into separate plugins – the Texture integration now lives at https://github.com/asmecher/texture. This is currently under development so I can’t promise it’ll be bug-free.

Regards,
Alec Smecher
Public Knowledge Project Team