advanced-tables-obsidian icon indicating copy to clipboard operation
advanced-tables-obsidian copied to clipboard

JS API to trigger table format for the entire file

Open HyperEpsilon opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. When I'm filling out complex templates involving variable width data being inserted into a table, the table is not formatted correctly

Describe the solution you'd like I would love a way to hook into the plugin using JS and trigger the "Advanced Tables: Format all tables in this file" functionality

Example

const at = app.plugins.plugins['advanced-tables'].api;
at.formatAllTablesInFile();

Describe alternatives you've considered Currently I just have to put my cursor into the table and press tab, though this is a pain to do on mobile

Additional context Several other plugins have methods of accessing their API

// Breadcrumbs
const bc = app.plugins.plugins.breadcrumbs.api

// DataView
const dv = app.plugins.plugins.dataview.api

// Templater
const tp = app.plugins.plugins['templater-obsidian'].templater.current_functions_object

HyperEpsilon avatar Feb 09 '23 23:02 HyperEpsilon