Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ bin
coverage.html
**/dist
plugins/tabula.obsidian
demo/demo.gif
demo/input.csv
8 changes: 8 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ vscode-pack:
cd plugins/tabula.vscode
npm run package

demo:
cd demo && vhs demo.tape
cp demo.gif ./gh-pages/
cp demo.gif ./plugins/tabula.vim/
cp demo.gif ./plugins/tabula.vscode/
cp demo.gif ./plugins/tabula.obsidian/
cp demo.gif ./plugins/tabula.webstorm/

# Vim
vim-pack:
#!/bin/sh
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# ![Tabula](./gh-pages/icon.png) Tabula - Spreadsheet-Inspired CSV Transformation

![Tabula: save a CSV, formulas recompute in place](./demo.gif)

**Transform CSV files using familiar spreadsheet formulas from the command line.**

## 🎯 What is **Tabula**?
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.21
0.2.22
2 changes: 1 addition & 1 deletion cmd/cli/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

const VERSION = "0.2.21"
const VERSION = "0.2.22"
Binary file added demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions demo/demo.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Install VHS:
# brew install vhs

Output ../demo.gif

Require tabula

Set Theme "GruvboxDark"
Set FontSize 22
Set FontFamily "FiraCode Nerd Font Mono"
Set Width 860
Set Height 480
Set Padding 24
Set TypingSpeed 55ms
Set PlaybackSpeed 1.0
Set Shell "bash"

# Reset demo state silently before we start recording visible frames
Hide
Type "cp input.template.csv input.csv && nvim input.csv"
Enter
Sleep 300ms
Show

# Recording
Sleep 1800ms
Type 'ggg^fs'
Sleep 400ms
Type 'gf'
Sleep 1800ms
Ctrl+o
Sleep 400ms
Type 'g^jjj'
Sleep 1800ms
Type 'f1cw22'
Escape
Sleep 1800ms
Type 'kcw3'
Escape
Type ' fs'
Sleep 2800ms
6 changes: 6 additions & 0 deletions demo/input.template.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#tabula #include "script.tbl"
Product , Price , Quantity , Total
Apple , $1.20 , 10 , $12.00
Banana , $0.80 , 17 , $13.60
Pear , $2.50 , 8 , $20.00
TOTAL , , , $45.60
3 changes: 3 additions & 0 deletions demo/script.tbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fmt B2:B4,D2:D4,D5 = "$%.2f";
let D2:D4 = REF(REL(-2,0)) * REF(REL(-1,0));
let D5 = SUM(D2:D4);
Binary file added gh-pages/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 93 additions & 1 deletion gh-pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,93 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tabula - CSV Spreadsheet Language</title>
<title>
Tabula - CSV Spreadsheet Language | Transform CSV with Formulas
</title>
<meta
name="description"
content="Tabula is a command-line tool that transforms CSV files using spreadsheet formulas. Process data with familiar A1 cell references and 50+ functions, no bloat."
/>
<meta
name="keywords"
content="CSV transformation, spreadsheet formulas, command-line CSV tool, CSV processing, data processing, CSV editor, formula language, batch CSV processing, data manipulation, text processing, Git-friendly data, version control CSV, plain text data, lightweight CSV tool, shell scripting, data automation, Excel alternative, Numbers alternative, Calc alternative, Google Sheets alternative, Google Sheets formulas, markdown tables, Unix pipeline, cross-platform CSV, open source CSV tool, data cleaning, vim plugin, neovim plugin, vscode extension, obsidian plugin, webstorm plugin, opensource, free"
/>
<meta name="author" content="Pawel Blazejewski" />
<meta name="robots" content="index, follow" />
<link rel="canonical" href="https://pblazh.github.io/tabula/" />

<!-- Open Graph -->
<meta
property="og:title"
content="Tabula - Spreadsheet-Inspired CSV Transformation"
/>
<meta
property="og:description"
content="Transform CSV files using spreadsheet formulas from the command line. Lightweight, open source, Git-friendly. 50+ built-in functions, editor plugins for Vim, VS Code, Obsidian, and WebStorm."
/>
<meta property="og:type" content="website" />
<meta property="og:url" content="https://pblazh.github.io/tabula/" />
<meta
property="og:image"
content="https://pblazh.github.io/tabula/demo.gif"
/>
<meta
property="og:image:alt"
content="Tabula: save a CSV, formulas recompute in place"
/>
<meta property="og:site_name" content="Tabula" />

<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:title"
content="Tabula - CSV Transformation with Spreadsheet Formulas"
/>
<meta
name="twitter:description"
content="Command-line CSV tool with 50+ spreadsheet functions. Process data locally, version control everything, no lock-in."
/>
<meta
name="twitter:image"
content="https://pblazh.github.io/tabula/demo.gif"
/>
<meta
name="twitter:image:alt"
content="Tabula: save a CSV, formulas recompute in place"
/>

<!-- Structured Data: SoftwareApplication -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Tabula",
"description": "A command-line tool that transforms CSV files using spreadsheet formulas. Process data with familiar A1 cell references and 50+ built-in functions.",
"url": "https://pblazh.github.io/tabula/",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "macOS, Linux, Windows",
"downloadUrl": "https://pblazh.github.io/tabula/",
"license": "https://github.com/pblazh/tabula/blob/main/LICENSE",
"softwareHelp": "https://github.com/pblazh/tabula/tree/main/doc",
"codeRepository": "https://github.com/pblazh/tabula",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"featureList": [
"Spreadsheet-style A1 cell references",
"50+ built-in functions (SUM, AVERAGE, IF, CONCATENATE, etc.)",
"Date and time functions",
"String manipulation functions",
"Logical and lookup functions",
"Markdown table support",
"Script include directive",
"Cross-platform single binary",
"Editor plugins for Vim, VS Code, Obsidian, WebStorm"
]
}
</script>
<link rel="icon" href="./favicon.ico" sizes="any" />
<link rel="icon" href="./favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="./favicon.png" />
Expand Down Expand Up @@ -124,6 +210,12 @@ <h1>
/>Tabula - CSV Spreadsheet Language
</h1>

<img
src="./demo.gif"
alt="Tabula: save a CSV, formulas recompute in place"
style="max-width: 100%; height: auto; display: block; margin: 0 auto 2rem"
/>

<h2>What is Tabula?</h2>
<p>
Tabula is a command-line tool that lets you transform and manipulate CSV
Expand Down
2 changes: 2 additions & 0 deletions plugins/tabula.vim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# ![Tabula](./icon.png) Tabula for Vim / Neovim

![Tabula: save a CSV, formulas recompute in place](./demo.gif)

Vim/Neovim plugin for [Tabula](https://github.com/pblazh/tabula) - a spreadsheet-inspired CSV transformation tool.

## Features
Expand Down
Binary file added plugins/tabula.vim/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 66 additions & 21 deletions plugins/tabula.vscode/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# ![Tabula](./icon.png) Tabula for Visual Studio Code

![Tabula: save a CSV, formulas recompute in place](./demo.gif)

VS Code extension for [Tabula](https://github.com/pblazh/tabula) - a spreadsheet-inspired CSV transformation tool.
It adds Google spreadsheet / Excel functionality for CSV and markdown files

## Features

Expand All @@ -15,42 +18,83 @@ VS Code extension for [Tabula](https://github.com/pblazh/tabula) - a spreadsheet
## Prerequisites

- **Tabula CLI** must be installed and in your `$PATH`
Download a suitable for your OS/architecture build from the [tabula web site](https://pblazh.github.io/tabula)

For example for MacOS M1/M...

```bash
# Download from GitHub Pages
curl -LO https://pblazh.github.io/tabula/bin/darwin/arm64/tabula # macOS M1/M2
chmod +x tabula
sudo mv tabula /usr/local/bin/
curl -LO https://pblazh.github.io/tabula/bin/darwin/arm64/tabula # fetch
chmod +x tabula # make it executable
sudo mv tabula /usr/local/bin/ # put into path location

```

Or build from source

## Usage

### Auto-Execution on Save
### Working with Markdown Files

- Open a CSV file in VS Code
- Add **Tabula** script directive:
**Tabula** can also process Markdown files containing tables and CSV blocks,
which makes it useful for note-taking workflows. When the active file is
Markdown, the extension automatically passes the `-m` flag to **Tabula**.

```csv
#tabula #include "process.tbl"
A,B,C
1,2,3
4,5,6
```
Supported data blocks:

- **Markdown tables** - standard pipe-delimited syntax with header and separator rows
- **CSV code blocks** - fenced code blocks tagged with `csv`

There are two ways to attach a **Tabula** script to a data block:

- Create your **Tabula** script (`process.tbl`):
- A `tabula` code block placed immediately after the table or CSV code block:

````markdown
| A | B | AB |
| -- | -- | -- |
| 10 | 30 | 40 |
| 20 | 40 | 0 |

```tabula
// Calculate sum
let D1 = "Total";
let D2 = A2 + B2 + C2;
let D3 = A3 + B3 + C3;
let C1 = A1 + B1;
let C2 = A2 + B2;
```
````

- An inline `#tabula` directive inside a CSV block (also supports `#include`):

- Save the CSV file (Ctrl+S / Cmd+S)
- **Tabula** runs automatically and updates the file!
````markdown
```csv
10, 30, 0
20, 40, 0
#tabula #include "script.tbl"
```
<!-- Tabula: can not parse: /Users/pavlo.blazhyievskyi/work/private/tabula/plugins/tabula.vscode/script.tbl: include file not found: /Users/pavlo.blazhyievskyi/work/private/tabula/plugins/tabula.vscode/script.tbl at README.md:1:2 -->

````

Save the Markdown file (Ctrl+S / Cmd+S) and **Tabula** updates the tables in place.
Any errors are written as HTML comments (`<!-- ... -->`) next to the affected
block, so they remain invisible in rendered Markdown and disappear once the
script is fixed.

See the [Tabula Markdown documentation](https://github.com/pblazh/tabula/blob/main/doc/markdown.md)
for the full specification.

### Working with CSV Files

CSV files behave like a Markdown file containing a single data block, with a
few differences:

- No `-m` flag is passed - the whole file is treated as one table
- Errors are surfaced as VS Code notifications rather than written into the file

```markdown
#tabula #include "process.tbl"
A,B,C
1,2,3
4,5,6
````

## How It Works

Expand All @@ -65,7 +109,7 @@ let D3 = A3 + B3 + C3;
Access commands via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

- **Tabula: execute** - Manually run Tabula on the active markdown file
- **Tablua: toggle auto-execution: Toggle auto-execution on Save** - Enable/disable automatic execution
- **Tabula: toggle auto-execution: Toggle auto-execution on Save** - Enable/disable automatic execution

### Configuration

Expand Down Expand Up @@ -175,7 +219,7 @@ npm run compile

## Recommended Companion Extensions

For a better CSV editing experience, do recommend installing a CSV formatting extension:
For a better CSV editing experience, we recommend installing a CSV formatting extension:
This extension provides:

- 📊 **Table view** - View CSV files in a formatted table
Expand Down Expand Up @@ -229,3 +273,4 @@ If you find this plugin useful, consider:
- ⭐ Starring the [GitHub repository](https://github.com/pblazh/tabula)
- 🐛 Reporting issues or suggesting features
- 📖 Contributing to the documentation
````
Binary file added plugins/tabula.vscode/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 17 additions & 6 deletions plugins/tabula.vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "tabula",
"displayName": "Tabula",
"description": "Tabula - CSV transformation with spreadsheet-inspired scripting language",
"version": "0.2.21",
"displayName": "Tabula — CSV & Markdown Formulas",
"description": "Run spreadsheet-style formulas inside CSV and Markdown files. Recompute on save.",
"version": "0.2.22",
"icon": "icon-128.png",
"publisher": "tabula",
"repository": {
Expand All @@ -15,16 +15,27 @@
"categories": [
"Data Science",
"Formatters",
"Notebooks",
"Other"
],
"keywords": [
"csv",
"markdown",
"tabula",
"spreadsheet",
"data"
"formulas",
"datascience",
"tables",
"notes",
"obsidian",
"excel",
"numbers",
"calc",
"notebook"
],
"activationEvents": [
"onLanguage:csv"
"onLanguage:csv",
"onLanguage:markdown"
],
"main": "./out/main.js",
"contributes": {
Expand Down Expand Up @@ -79,7 +90,7 @@
"tabula.autoExecution": {
"type": "boolean",
"default": true,
"description": "Automatically execute Tabula scripts when saving CSV files"
"description": "Automatically execute Tabula scripts when saving CSV or Markdown files"
},
"tabula.executablePath": {
"type": "string",
Expand Down
Loading
Loading