Giter Site home page Giter Site logo

cumany / ob-table-enhancer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stardusten/ob-table-enhancer

0.0 0.0 0.0 139 KB

A plugin for improving the experience of using table in Obsidian

License: GNU General Public License v3.0

JavaScript 2.17% TypeScript 95.99% CSS 1.84%

ob-table-enhancer's Introduction

Obsidian Table Enhancer

A plugin for improving the experience of using table in Obsidian.

TOC

点击这里查看中文文档。

How to Install

Please Refer: How to install Obsidian Plugins

Key Features

  1. You can click a table cell to edit it directly, and the cell being edited will be highlighted. You can press Enter or Esc or click anywhere outside the table to exit the edit mode.

  2. When editing a table cell, content in the table cell will be converted to original Markdown code, and it will be rendered when you exit the edit mode.

  3. In the table cell, you can write anything except the format conflicting with Markdown, such as |. Try to add HTML\Tags\Img to it.

    ob-plugin

  4. Use up and down arrow keys to move between cells. And tab key can be used to move between cells, while shift + tab can be used to move between cells in the opposite direction.

  5. Use left and right arrow keys to move between characters in the cell. And when your cursor is on the front of the table cell or the end of the table cell, you can use left and right arrow keys to move between cells.

  6. In any table cell, you can double-click [ to call the autocomplete function for files.

    ob-plugin

  7. When mouse float on the table cell, a toolbar will be displayed on the top side of the cell. You can use the toolbar to insert a row or column before or after the current cell. And also center\left\right align the current cell.

    ob-plugin

  8. You can write JS function in table cell, and it will be executed when you exit the edit mode. The function will receive the table cell content as a parameter, and the return value will be used as the new content of the table cell.

    ob-plugin

About running JS function in table cells

Builtin Variables

You can access the content of table using following variables easily:

  • c: Get the current column (excluding the header and the cell itself), return a character array
  • nc: Get the current column (excluding the header and the cell itself), return a number array
  • t: Get the current table (see console.log for specific content)

Builtin Functions

  • sum: Sum of a number array
  • avg: Average of a number array
  • min: Minimum of a number array
  • max: Maximum of a number array

Samples

Code Description
>>> sum(nc) Sum of all numbers in the current column
>>> sum(nc.filter(e=>e>0)) Sum of all positive numbers in the current column
>>> avg(nc) Average of the current column
>>> min(nc) Minimum of the current column
>>> c.filter(e=>e.contains('TODO')).length Sum of all cells in the current column contains TODO task

ob-table-enhancer's People

Contributors

quorafind avatar stardusten avatar

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.