Skip to content

gengyabc/obsidian-jupyter-notebook-plugin

Repository files navigation

Obsidian Jupyter Notebook Plugin

This plugin allows you to view and edit Jupyter Notebooks (.ipynb files) directly within Obsidian (https://obsidian.md).

Features

  • View Jupyter notebooks with proper cell formatting
  • Support for both code and markdown cells
  • Interactive cell editing capabilities
  • Syntax highlighting for Python code
  • Display of cell outputs including:
    • Text output
    • HTML output (sanitized)
    • Images (PNG/JPEG)
    • Error messages with traceback
  • Collapsible output cells
  • Line numbers for code cells (not good yet)
  • Integration with Obsidian's internal links

Installation

From Obsidian Community Plugins

  1. Open Settings in Obsidian
  2. Navigate to Community Plugins and disable Safe Mode
  3. Click Browse and search for "Jupyter Notebook Viewer"
  4. Install the plugin and enable it

Manual Installation

  1. Download main.js, styles.css, and manifest.json from the latest release
  2. Create a folder VaultFolder/.obsidian/plugins/obsidian-jupyter-notebook-plugin/
  3. Copy the downloaded files into this folder
  4. Restart Obsidian and enable the plugin in Settings > Community Plugins

Usage

  1. Place your .ipynb files in your Obsidian vault
  2. Click on any .ipynb file to open it in the notebook viewer
  3. Use the "Edit" button on each cell to modify its contents
  4. Click "Save" to save your changes or "Cancel" to discard them
  5. Toggle output visibility using the dropdown arrow

Note: This plugin does not run the notebook cells. It only allows you to edit and view the notebook cells and outputs.

Development

Prerequisites

  • NodeJS (v16 or higher)
  • npm or yarn

Setup

  1. Clone this repository
  2. Run npm install or yarn to install dependencies
  3. Run npm run dev to start compilation in watch mode

Building

  • npm run build creates a production build
  • Files will be generated in the root directory:
    • main.js
    • styles.css
    • manifest.json

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • cursor for the AI code assistant
    • all the code is generated by cursor, I just tell it what I want to do

About

This plugin allows you to view and edit Jupyter Notebooks (.ipynb files) directly within Obsidian

Resources

License

Stars

Watchers

Forks

Packages

No packages published