NotePlan / NotePlan/plugins

Tidy: Use params instead of JSON

Open
#647 0 comments 0 reactions 1 assignee View on GitHub

@jgclark is already working on this.

Since Jun 21, 2025.

enhancement
Dominant language
JavaScript
Stars
204
Forks
82
Avg merge
22h 27m
Merged PRs (30d)
3

Description

I find the JSON in many of the Tidy commands (esp "Remove Section...") mess things up and either don't work or cause the command to fail. I think having links, quote marks and emojis inside the JSON often keep it from working.

I would like to ask you to think about keeping JSON as the first param for backwards compat but also add individual parameters for each to use if you prefer. This will make xcallbacks and template commands more easy to understand and more reliable.

So for example:

export async function removeSectionFromRecentNotes(params: string = ''): Promise<void> {

would become:

export async function removeSectionFromRecentNotes(
  params: string = '',
  numDaysParam?: number,
  runSilentlyParam?: boolean,
  matchTypeParam?: MatchType,
  sectionHeadingParam?: string,
): Promise<void> {

I would suggest having Cursor create a generic helper similar to your overrideSettingsWithEncodedTypedArgs() but that allows for either JSON or an array of parameters so that you can use it in any of the commands that use JSON params.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.