Giter Club home page Giter Club logo

mdtt's Introduction

🗓️ mdtt: Markdown Table Editor TUI

Editing markdown tables can be a drag. mdtt makes it easier with a slick TUI for terminal use and vim-style keybindings. It supports output to stdout and in-place file editing.

📦 Installation

To install mdtt using Go, run:

go install github.com/szktkfm/mdtt/cmd/mdtt@latest

Or, download it:

GitHub Releases

🎬 Usage

To start editing your markdown table, simply run:

mdtt filename.md

Upon launching, mdtt will display the tables from your markdown file in a TUI.

While editing, you can utilize the following vim-like keybindings to navigate and modify your tables efficiently:

  • Navigation: Use hjkl for left, down, up, and right movements.
  • Editing: Press i to switch to insert mode and edit cell content, exit insert mode with esc or ctrl+c.
  • Row and Column Manipulation:
    • Add a new row or colymn with o, vo.
    • Delete the current row or column with dd, vd.
    • Copy the current row or column with yy, vy.
    • Paste a copied row or column with p.

For direct editing and saving changes to the same file, use:

mdtt -i filename.md

You can use piping with mdtt as shown below:

pbpaste | mdtt | pbcopy

To create a new table without an existing file, run mdtt without any arguments:

mdtt

When multiple tables are present, you will be prompted to select the table you wish to edit.

Press I to open the cell in the text editor set as your $EDITOR, allowing you to edit the cell directly within your chosen editor.

⌨️ Key Bindings

Key Action
/k Move up
/j Move down
/h Move left
/l Move right
b/pgup Page up
f/pgdn Page down
ctrl+u Half page up
ctrl+d Half page down
g/home Go to start
G/end Go to end
i Insert mode
I Open $EDITOR
esc/ctrl+c Normal mode
o/vo Add row/column
dd/vd Delete row/column
yy/vy Copy row/column
p Paste
q Quit
? Toggle help

📝 Features

  • Vim-like Keybindings: Navigate and edit tables using familiar vim commands.
  • Inplace Editing: Directly modify your original markdown files with the -i option.
  • Piping Support
  • Multi-Table Selection
  • External Editor Integration: Delegate cell editing to an external editor specified by your $EDITOR environment variable.
  • HTML in Cells: Enable rich content formatting by using HTML directly within table cells.

🙏 Acknowledgments

This project, mdtt, was inspired by mdvtbl, a tool that reads markdown from stdin, allows for table editing in a web view, and outputs to stdout.

License

MIT

mdtt's People

Contributors

szktkfm avatar

Stargazers

Bogdan Dinu avatar Ochi Daiki avatar Jacob Biehler avatar  avatar Mukunda Modell avatar  avatar kelsey avatar Sam Boysel avatar BubbleFish avatar Vera Rei avatar Peter Beck avatar Akif Feyzioğlu avatar Dino avatar  avatar FBDev avatar  avatar Darren Li avatar Luis Peralta avatar Étienne avatar Melih Sivri avatar Uğur Özyılmazel avatar Lays avatar Kingsley Yung avatar Ron Green avatar Nick Butler avatar Anton Rudeshko avatar Nogweii avatar  avatar soleblaze avatar Oliver Tzeng avatar James Lingford avatar  avatar Chema avatar Suavesito avatar John Ward avatar Akop Kesheshyan avatar Ariel Churi avatar Felix Rosencrantz avatar  avatar David Henrry Ticona avatar X-Dean avatar bea1e avatar ccoVeille avatar Tavis Ormandy avatar Shadab Zafar avatar Jef Brown avatar Eduardo Bellido Bellido avatar  avatar Kevin S Kirkup avatar Igor avatar Isa Goksu avatar  avatar

Watchers

ccoVeille avatar  avatar

Forkers

developgo

mdtt's Issues

Prompt user to save unsaved changes

If a user adds content to a table then quits- the user should be prompted to save unsaved changes to a file.
image
In the above image, changes to the table are not saved to file after editing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.