Skip to content

About

A Redmine plugin that renders Jupyter notebook (`.ipynb`) previews inline — directly on issue pages, wiki pages

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Redmine Notebook Preview

A Redmine plugin that renders Jupyter notebook (.ipynb) previews inline — directly on issue pages, wiki pages, and documents, without leaving Redmine.

EXPERIMENTAL — opt-in: This plugin is not part of the production core. Expect defects, incomplete features, performance limits and breaking changes. Do not install it if you require production-level stability and support. Keep evaluation within the documented deployment flow.

Features

  • Inline previews of .ipynb attachments on issues, wiki pages, and documents
  • Wiki macro {{notebook_preview(filename.ipynb)}} for embedding previews in wiki content
  • LaTeX formulas in notebook previews are rendered by the separate redmine_cbots_latex plugin.
  • Cache management — previews are generated once and cached; admins can purge the cache from the plugin settings page
  • Report export — usable in cosmoSys reports exported to PDF, ODT and DOCX; LaTeX formulas are converted to images
  • Permission-aware — regenerate button is only shown to users with edit rights

Requirements

  • Redmine 6.x
  • redmine_cbots_latex is a required plugin dependency, not an optional enhancement. Notebook Preview will refuse to load if it is missing; it also provides MathJax and static formula rendering.
  • Python 3 with nbconvert installed and accessible to the Redmine process
  • A writable directory for the preview cache

Installation

1. Copy the plugin

git clone https://github.com/cosmobots/redmine_notebook_preview \
  plugins/redmine_notebook_preview

Instala primero redmine_cbots_latex en plugins/redmine_cbots_latex. redmine_notebook_preview comprueba esta dependencia obligatoria al cargar y genera un error si no está instalada.

2. Install nbconvert

The plugin delegates conversion to jupyter nbconvert. Install it in a virtual environment:

python3 -m venv /opt/nbconvert-env
/opt/nbconvert-env/bin/pip install nbconvert nbformat jupyter_core matplotlib

3. Restart Redmine

Restart your Redmine process to load the plugin.

4. Configure the plugin

Go to Administration → Plugins → Notebook Preview → Configure and set:

Setting Description
Jupyter binary path Full path to the jupyter binary, e.g. /opt/nbconvert-env/bin/jupyter
Cache directory Writable directory for cached HTML previews, e.g. /var/cache/redmine/notebook_preview

Usage

Automatic previews on issues

Attach a .ipynb file to any issue. The preview will appear automatically below the issue description.

Wiki macro

Embed a preview of a notebook attached to the current wiki page:

{{notebook_preview(analysis.ipynb)}}

Regenerating a preview

If a preview fails or becomes stale, users with edit rights will see a Regenerate preview button below the preview area.

Cache management

Admins can purge all cached previews at once from Administration → Plugins → Notebook Preview → Configure.

Report export (PDF, ODT, DOCX)

When a page that uses {{notebook_preview(...)}} is exported to PDF, ODT or DOCX (for example a cosmoSys report), the preview is included as static HTML:

  • Images are embedded as plain base64 data URIs.
  • LaTeX formulas are converted to PNG images by redmine_cbots_latex, because exporters cannot run MathJax. This uses matplotlib's mathtext, so it needs matplotlib in the same virtual environment as jupyter (see installation). It covers the common subset of LaTeX (fractions, roots, sums, Greek letters, sub/superscripts). Environments such as align or matrix are not supported and stay as text. If matplotlib is missing, formulas also stay as text.

Previews cached before this behaviour existed must be regenerated (purge the cache from the plugin settings page).


Notes

Air-gapped deployments: MathJax is loaded from a CDN for LaTeX rendering. In environments without internet access, mathematical notation will not render. To support air-gapped deployments, configure redmine_cbots_latex to load MathJax locally.


Uninstalling

bundle exec rake redmine:plugins:migrate NAME=redmine_notebook_preview VERSION=0 RAILS_ENV=production

Then delete the plugin folder and restart Redmine.



Production configuration

Use persistent storage for Redmine files and the preview cache. Configure JUPYTER_BIN for the Python environment containing nbconvert and matplotlib, and NOTEBOOK_CACHE_DIR for a directory writable by the Redmine process. The included Dev Container is for development, not a production deployment.

License and contact

This plugin is distributed under GNU GPL v3; see LICENSE.txt. For questions about this plugin, contact cosmobots.eu@gmail.com.

About

A Redmine plugin that renders Jupyter notebook (`.ipynb`) previews inline — directly on issue pages, wiki pages

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages