Testing how Lens will render an article

What’s the best way to see how (and whether) the Lens Galley plugin will render an NLM JATS XML article?

The Texture plugin isn’t available on our PKP-hosted OJS 3.1.2 journal and I’m finding that Lens has some quirky tastes about what it will and won’t successfully display. I had hoped to experiment on files locally, but Lens complains about CORS security when I try to test it on local files. It’s been a bit excruciating to upload galleys, discover that they fail to render on Lens, make adjustments, reupload, fail to render, try again, upload again…

There’s got to be an easier way, right?

Hi @horne.b,

You might check with the Lens Reader folks (or their documentation) about how to quickly/easily set up a local copy of the Lens Reader for testing/demonstration purposes. (We don’t maintain Lens Reader, we just use it.)

Thanks,
Alec Smecher
Public Knowledge Project Team

Thanks, Alec. Since I posted my comment here I’ve contacted them and have done some more searching for solutions, and the answer turns out to be ridiculously simple: dragging and dropping the local file from the local computer’s file manager onto a browser that’s already open to a Lens Reader article.

I do have one question about how the OJS Lens Reader plugin works. I know there were questions in the forums a couple of years ago about how to include video as either a figure, a cell, or an included snippet of HTML embed code. It’s simple enough to include this in an HTML galley, but I’d love to be able to embed the video in a version that’s rendered using the Lens plugin. Are there any ways to do this?

Thanks,
-Brian

Hi @horne.b,

Good spotting – I don’t think I would have tried that!

On embedding files (images, videos, etc) into the XML, OJS uses the same strategy as for HTML galleys: it looks for anything in the uploaded XML with the following formulations…

  • <someElement src="some-filename" ...>
  • <someElement href="some-filename" ...>
  • <someElement data="some-filename" ...>

It goes through all the “dependent” files for your XML galley, and looks for files that were uploaded from your computer with filenames that match (i.e. “some-filename” above). When it finds one, it’ll replace the filename in the XML with a full URL to the content within OJS.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like