Socket
Socket
Sign inDemoInstall

mtjc

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mtjc

A script that converts basic markdown code blocks to Jupyter notebook files


Version published
Maintainers
1
Install size
1.88 MB
Created

Readme

Source

The Markdown to Jupyter Conversion tool (MTJC) is a fairly simple script that converts a markdown file with code blocks to the JSON format used by Jupyter to create Notebooks.

MTJC separates the provided markdown file into "cells", looking for headers and code blocks to split the content at. Each header and any following text, list, or whatever will be placed in the same block until either another header or a code block ("```") is encountered.

When a code block is encountered, it writes the code to a file in .temp (relative to the folder it is run in), passes it to the relevant program to run, and stores the result.

For demonstration purposes, here is a sample markdown file and the notebook output from the program as a result.

Limitations

  • Currently, this script can only process Python. I plan to change this, but as I have no use for any of the other possible languages myself, it is not high on my agenda.
  • This script assumes that all output from a Python script will be sent to stdout. It is not currently capable of processing image data such as the charts and graphs that Jupyter Notebooks are capable of displaying.
  • Code blocks are run individually. A variable set in one will not carry over to another. See issue #3 for progress.

Installation

Assuming that you have already installed npm, in the command line, type either one of the following:

NPM

npm install -g mtjc

From Source

git clone https://github.com/TheAndroidMaster/MarkdownToJupyter
cd MarkdownToJupyter
npm install

Usage

mtjc <file.md>

Or, to specify a path for the output file...

mtjc <file.md> <output.ipynb>

FAQs

Last updated on 06 Sep 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc