Skip to main content

A JupyterLab extension to convert plaintext files to jupyter notebooks

Project description

jupyter-plainb

Github Actions Status

A JupyterLab extension to convert plaintext files to Jupyter notebooks

Installation

pip install jupyter-plainb

Requirements

  • JupyterLab >= 4.0.0

Usage

Right-click menu

Select a .py or .md file in the file browser → right-click → Convert to Notebook submenu → pick a parser.

If a .ipynb with the same base name already exists, a confirmation dialog asks before overwriting.

Auto-convert on startup

Add plainTextNotebookConfig to jupyter_config.json (or JupyterLite's jupyter-lite.json):

{
  "jupyter-config-data": {
    "plainTextNotebookConfig": {
      "rules": [
        { "dir": "percent", "parser": "parsePy" },
        { "dir": "sphinx_gallery", "parser": "parseSphinxGallery" },
        { "dir": "markdown", "parser": "parseClassicMd" },
        { "dir": "myst", "parser": "parseMystMd" }
      ]
    }
  }
}

Each rule watches a directory and converts matching files on JupyterLab startup (skips files that already have a .ipynb sibling).

Supported formats

Parser Menu label File type Format
parsePy Percent format (.py) .py Jupytext percent
parseSphinxGallery Sphinx Gallery (.py) .py Sphinx-Gallery
parseClassicMd Classic Markdown (.md) .md Standard markdown — fenced code blocks become code cells
parseMystMd MyST Notebook (.md) .md MyST-NB {code-cell} directives

Uninstall

pip uninstall jupyter-plainb

Contributing

See CONTRIBUTING.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_plainb-0.1.1-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_plainb-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: jupyter_plainb-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for jupyter_plainb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9dfcda2a2a6cc45f5906ff37d1d68ad3b0a10a7b2a84f59949a6e8246fec8309
MD5 1e8ae6e0cded33530b665cb58bf199df
BLAKE2b-256 0b553f701cef0e51c9953adba3d99ecb2228f1cb5f4a3ba7171f1c6177dc681b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page