Skip to content

A tool to convert pdf or jpg to md with latex syntax via MathPix

Notifications You must be signed in to change notification settings

dennisangemi/tomkd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tomkd

Tool scritto in bash per convertire immagini jpg o documenti pdf in markdown; viene sfruttato il servizio CLI di MathPix (non open, con un piano gratuito).

Questo tool è stato utilizzato per generare la maggior parte delle pagine di questo sito powered by Material for MkDocs. Leggi qui il caso d'uso.

Set up

  1. Download the bash script
    wget "https://raw.githubusercontent.com/dennisangemi/tomkd/main/tomkd"
  2. Move it to /usr/local/bin
    sudo mv ./tomkd /usr/local/bin
  3. Make it executable
    sudo chmod +x /usr/local/bin/tomkd

Getting started

Requirements

  • imagemagick
  • mpx (MathPix CLI)
  • pandoc

Signup to MathPix and then login to your MathPix account running

mpx login

Usage

Mandatory options

-i for the input file. It can be .jpg or .pdf

tomkd -i compito.jpg

Optional

-o for the output (it must be .md)

tomkd -i compito.pdf -o YYYY-MM-DD.md

-t for the tag

tomkd -i compito.pdf -o YYYY-MM-DD.md -t "Questo è il mio tag"

Output

The output consists of:

  • markdown file
  • input file moved to a specific folder based on the extension of the file (e.g. pdf/input.pdf or images/input.jpg)
  • images included in the input file organized in an images/ directory.

Build

If you want to build the tool from the repo, downloat this repo and then run

sudo ./build

This is the same of setup but in this way you can use your own modified

Credit

Dennis Angemi

About

A tool to convert pdf or jpg to md with latex syntax via MathPix

Resources

Stars

Watchers

Forks

Languages