| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Based on the original epubViewer plugin by Lepidus Tecnologia, which served Brazilian journals for years and was discontinued in 2025 because the Bibi reader by Satoru Matsushima was no longer maintained. The idea and the OJS integration are theirs. Reading engine replaced by epub.js by FuturePress, which is actively maintained. Developed and maintained by OJSBR — full details in the Credits & acknowledgements section.
⬇️ Install package: OJS 3.5 — or browse all Releases.
▶️ Live demo: Editora UEMG — book with an EPUB format
The epubViewer plugin embedded EPUB galleys in OJS using the Bibi reader. In 2025 Lepidus added a deprecation notice: Bibi had not been updated for years, so the plugin would no longer be maintained. It never received an OJS 3.5 release.
That left journals in a bad spot. Several of our clients had EPUB galleys already published and had upgraded to OJS 3.5 — their readers suddenly had no embedded reader at all, only a download link. Porting the old plugin would not solve it, because the problem was the reading engine, not the integration.
So we rebuilt it around epub.js, an actively maintained reader, keeping the same idea and the same place in the OJS workflow. We are making it public for the whole community, because any journal running OJS 3.5 with EPUB galleys has exactly the same problem.
In the future we intend to submit it to the official OJS Plugin Gallery, should PKP find it useful for the wider community.
| Application | Version | Branch | Release |
|---|---|---|---|
| OJS / OPS / OMP | 3.5.x | stable-3_5_0 (default) | 1.2.1.0 |
Requires PHP 8.2+.
OMP has no galleys: a publication format plus a submission file play the part that a single ArticleGalley plays in OJS, and there are no issue galleys at all. The plugin registers a different hook per application, and no core file is touched:
| Application | Hook |
|---|---|
| OJS | ArticleHandler::view::galley, IssueHandler::view::galley |
| OPS | PreprintHandler::view::galley |
| OMP | CatalogBookHandler::view |
On OMP the hook fires only after the core has validated that the publication format is available and not remote, the publication is published, the file belongs to that format, and access is open or paid — no authorization rule is reimplemented by the plugin.
epub.js renders one EPUB section per iframe. An EPUB that packs the whole book into one or two huge XHTML sections — Project Gutenberg does this — is laid out in paginated flow as a single column strip tens of thousands of pixels wide, which the browser cannot paint; with spread: 'auto' it can freeze the tab. Measured on a 211 KB section: a 99,792 px wide view, blank. The cover section of the same file, at 377 bytes, renders correctly.
EPUBs with one XHTML per chapter — what publishing tools normally produce — are unaffected.
Displays EPUB galleys inside an embedded reader, instead of forcing the reader to download the file. Works for article galleys and issue galleys in OJS, and for preprint galleys in OPS.
The reader offers:
epub.js 0.3.93 and JSZip 3.10.1 ship inside lib/. No request ever leaves for a third-party service: the reader works on closed networks and does not expose your readers to any third party. EPUB content is rendered with allowScriptedContent: false, so scripts embedded in the EPUB do not run.
Dashboard → Settings → Website → Plugins → Upload A New Plugin, or unpack into plugins/generic/ and enable it under Installed Plugins. No configuration is required.
PHPUnit (tests/*Test.php, on PKP\tests\PKPTestCase, 22 tests): EPUB detection by mimetype and by file extension on the display name or the stored path (not every upload arrives with the right mimetype), every other format left to the core, the reader page (core footer hook kept, no inline script, every URL escaped, scripts inside the book never run), the plugin class against the installed PKP, the 38 translations and the templates. From the installation root:
lib/pkp/lib/vendor/bin/phpunit --configuration lib/pkp/tests/phpunit.xml --no-coverage "$PWD/plugins/generic/epubJsViewer/tests"Cypress (cypress/tests/functional/EpubJsViewer.cy.js, run by pkp-github-actions on OJS, OMP and OPS on every push): enables the plugin. With epubPage (the path of an article, preprint or book page that offers an EPUB) it also opens the EPUB in the reader and checks paging, zoom and a visible way back — on OMP the link was once in the page at zero width. Those two fail with the hook off.
npx cypress run --config specPattern='plugins/generic/epubJsViewer/cypress/tests/functional/*.cy.js' \
--env contextPath=<context>,adminUser=<user>,adminPassword=<password>,epubPage=index.php/<context>/catalog/book/1Verified on OJS 3.5.0.3 and OMP 3.5.0.3 with published EPUB files.
Tests are kept in the repository and are not part of the release package.
Generative AI (Claude, by Anthropic) was used to write and run tests, improve the code and bring it in line with PKP standards. Every change is reviewed and tested by OJSBR, which is responsible for the published releases.
GNU GPL v3 — see LICENSE. epub.js is BSD-2-Clause; JSZip is MIT.
Baseado no plugin epubViewer original da Lepidus Tecnologia, que serviu as revistas brasileiras por anos e foi descontinuado em 2025 porque o leitor Bibi, de Satoru Matsushima, deixou de ser atualizado. A ideia e a integração com o OJS são deles. O motor de leitura foi substituído pelo epub.js, da FuturePress, que segue mantido. Desenvolvido e mantido pela OJSBR.
▶️ Demonstração: Editora UEMG — livro com formato EPUB
O epubViewer exibia composições EPUB dentro do OJS usando o leitor Bibi. Em 2025 a Lepidus incluiu um aviso de descontinuação: o Bibi estava havia anos sem atualização, e por isso o plugin deixaria de ser mantido. Ele nunca ganhou versão para o OJS 3.5.
Isso deixou revistas numa situação ruim. Vários dos nossos clientes já tinham composições EPUB publicadas e haviam atualizado para o OJS 3.5 — de uma hora para outra, seus leitores ficaram sem leitor embutido, apenas com o link de download. Portar o plugin antigo não resolveria, porque o problema estava no motor de leitura, não na integração.
Então reconstruímos o plugin em torno do epub.js, um leitor ativamente mantido, preservando a mesma ideia e o mesmo lugar no fluxo do OJS. Estamos tornando-o público para toda a comunidade, porque qualquer revista em OJS 3.5 com composições EPUB enfrenta exatamente o mesmo problema.
Futuramente, pretendemos submetê-lo à Galeria oficial de plugins do OJS, caso a PKP tenha interesse para a comunidade em geral.
| Aplicação | Versão | Branch | Release |
|---|---|---|---|
| OJS / OPS / OMP | 3.5.x | stable-3_5_0 (padrão) | 1.2.1.0 |
Requer PHP 8.2+.
O OMP não tem galley: o par formato de publicação + arquivo faz o papel que no OJS cabe a um único ArticleGalley, e não existe galley de fascículo. O plugin registra um hook diferente por aplicação, sem tocar em nenhum arquivo do core:
| Aplicação | Hook |
|---|---|
| OJS | ArticleHandler::view::galley, IssueHandler::view::galley |
| OPS | PreprintHandler::view::galley |
| OMP | CatalogBookHandler::view |
No OMP o hook só é alcançado depois de o core validar formato disponível e não remoto, publicação publicada, arquivo pertencente ao formato e acesso aberto ou compra paga — nenhuma regra de autorização é reimplementada pelo plugin.
O epub.js renderiza uma seção do EPUB por iframe. Um EPUB que empacota o livro inteiro em uma ou duas seções XHTML enormes — como faz o Project Gutenberg — é montado, em fluxo paginado, como uma tira de colunas de dezenas de milhares de pixels, que o navegador não consegue pintar; com spread: 'auto' chega a travar a aba. Medido numa seção de 211 KB: view de 99.792 px, em branco. A seção de capa do mesmo arquivo, com 377 bytes, renderiza corretamente.
EPUBs com um XHTML por capítulo — o que as ferramentas de editoração normalmente produzem — não são afetados.
Exibe composições EPUB em um leitor embutido, em vez de obrigar o leitor a baixar o arquivo. Funciona para composições de artigo e de edição no OJS, e de preprint no OPS.
O leitor oferece:
O epub.js 0.3.93 e o JSZip 3.10.1 estão embutidos em lib/. Nenhuma requisição sai para serviço de terceiro: o leitor funciona em rede fechada e não expõe o acesso dos seus leitores a ninguém. O conteúdo do EPUB é renderizado com allowScriptedContent: false, de modo que scripts embutidos no arquivo não são executados.
Painel → Configurações → Website → Plugins → Enviar um novo plugin, ou descompacte em plugins/generic/ e habilite em Plugins Instalados. Não requer configuração.
PHPUnit em tests/ (sobre PKP\tests\PKPTestCase, 22 testes) e Cypress em cypress/tests/functional/ (rodado pelo pkp-github-actions em OJS, OMP e OPS a cada push), com os comandos da seção em inglês. A suíte cobre a detecção de EPUB pelo mimetype e pela extensão, a recusa dos outros formatos, a página do leitor (hook de rodapé do núcleo, nenhum script inline, URLs escapadas, scripts do livro nunca executados), a classe do plugin contra o PKP instalado, as 38 traduções e os templates. Com epubPage, o Cypress abre o EPUB no leitor e confere paginação, zoom e o link de voltar visível.
Verificado no OJS 3.5.0.3 e no OMP 3.5.0.3 com arquivos EPUB publicados.
Os testes ficam no repositório e não fazem parte do pacote da release.
Foi usada IA generativa (Claude, da Anthropic) para escrever e rodar testes, melhorar o código e alinhá-lo aos padrões da PKP. Toda mudança é revisada e testada pela OJSBR, que responde pelas releases publicadas.
GNU GPL v3 — veja LICENSE. O epub.js é BSD-2-Clause; o JSZip, MIT.
| Back | FazBrowse Home | New Git URL |