Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanGiesberts committed Sep 14, 2023
1 parent a82e770 commit 4ff76f8
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions README.md
Expand Up @@ -2,34 +2,23 @@
This plugin for [Obsidian](https://obsidian.md) replaces markdown checkboxes `-[]` inside markdown tables with HTML checkboxes.

## Example
https://user-images.githubusercontent.com/66573865/197360507-251c2586-c11c-412c-a368-7c275ff247a2.mp4
https://github.com/DylanGiesberts/obsidian-table-checkboxes/assets/66573865/7a218dd4-2575-41e8-b615-01f97c0a9bdb

## Installing the plugin
1. Navigate to the plugins folder (Settings => Community plugins -> Click the folder icon next to 'Installed plugins')
2. Create a folder for the plugin files, like `obsidian-table-checkboxes`
3. Download `main.js` and `manifest.json` from the releases tab and drop them in `obsidian-table-checkboxes`

## Installing the plugin using BRAT

- Install the BRAT plugin
1. Open Settings -> Community Plugins
2. Disable safe mode, if enabled
3. Browse, and search for "BRAT"
4. Install the latest version of Obsidian 42 - BRAT
5. Open BRAT settings (Settings -> Obsidian 42 - BRAT)
6. Scroll to the Beta Plugin List section
7. Add Beta Plugin
8. Specify this repository: git@github.com:bithead2k/obsidian-table-checkboxes.git
9. Enable the Table HTML Checkboxes plugin (Settings -> Community Plugins)
1. Scroll to the Beta Plugin List section
2. Add Beta Plugin
3. Specify this repository: git@github.com:DylanGiesberts/obsidian-table-checkboxes.git

## How to use

- Simply enable the plugin and type a markdown checkbox inside a table. It will get converted to a HTML checkbox.
- In either live preview or view mode, (un)check the checkbox and the state will be reflected in your file.

## How it works

- Whenever a closing bracket `]` is typed, the plugin checks if it's a markdown checkbox `- []` inside of a markdown table `| - [ ] |`.
- It then changes the checkbox to HTML `<input type="checkbox" unchecked>`.
- When a HTML checkbox is clicked, the location of the table and then the cell gets identified. The plugin then changes the `unchecked` attribute to `checked`, or vice versa.

## Known issues
- Checkboxes in fully identical tables can cause issues.

Empty/duplicate cells should no longer cause issues.
- Whenever a closing bracket `]` is typed to close a checkbox, it will be replaced by an HTML checkbox `<input type="checkbox" unchecked id="...">`.
- When the checkbox is clicked in the preview, the checkbox in the file is found by its ID.
- The `checked` state of the checkbox gets toggled.

0 comments on commit 4ff76f8

Please sign in to comment.