npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mathpix/mpx-cli

v0.4.0

Published

Document conversion for scientific documents

Downloads

25

Readme

mpx cli npm package github license

Document conversion for scientific documents.

Install

npm install -g @mathpix/mpx-cli

Usage

Sign up at https://accounts.mathpix.com and then run mpx login which will ask for your Mathpix email and password then save an authorization token to be used for any commands that require connecting to our servers such as digitizing PDF files or converting Markdown to docx or pdf files.

mpx login

Alternatively you can use a Mathpix API account by creating an API key from https://accounts.mathpix.com/ocr-api and then set the API key as an environment variable MATHPIX_OCR_API_KEY:

export MATHPIX_OCR_API_KEY=...

Or save it permanently in the mpx config file:

mpx set-api-key ...
# This will save the key in a file at
# ~/.mpx/config on Linux, macOS, or Unix
# C:\Users\USERNAME\.mpx\config on Windows

To digitize PDF's to editable Mathpix Markdown, docx, html or tex.zip:

mpx convert input-file.pdf output-file.mmd
mpx convert input-file.pdf output-file.docx
mpx convert input-file.pdf output-file.tex
mpx convert input-file.pdf output-file.html

To digitize images to editable Mathpix Markdown, docx, html or tex.zip:

mpx convert input-file.png output-file.mmd
mpx convert input-file.png output-file.docx
mpx convert input-file.jpeg output-file.tex
mpx convert input-file.jpeg output-file.html

You can also compile Markdown files without using Mathpix OCR:

mpx convert input-file.mmd output-file.docx
mpx convert input-file.mmd output-file.tex
mpx convert input-file.mmd output-file.html
mpx convert input-file.mmd output-file.pdf
mpx convert input-file.mmd output-file.pdf --pdf-method html

To view mmd files rendered into html on a local server:

mpx serve ./input-dir
mpx serve ./input-dir/example.mmd

To build a directory of mmd files into a static html site:

mpx build ./input-dir ./output-dir

The cli has built in --help that will show all commands and flags:

$ mpx --help
Usage: mpx command [options] [args]

Document conversion for scientific documents

Options:
  -V, --version                                     output the version number
  -h, --help                                        display help for command

Commands:
  build [options] [source] [destination]            build a static html site from a directory of markdown or mathpix markdown
  convert [options] <source.ext> <destination.ext>  convert files between markdown, mathpix markdown, docx, latex and pdf formats
  serve [options] <source>                          serve markdown or mathpix markdown rendered at html
  set-api-key [options] <mathpix_ocr_api_key>       save Mathpix OCR API key
  unset-api-key [options]                           remove Mathpix OCR API key
  login [options]                                   log into your Mathpix Snip account and save authorization token
  logout [options]                                  log out of your Mathpix Snip account and remove authorization token
  help [command]                                    display help for command