NotePlan / NotePlan/plugins

Tidy: Use params instead of JSON

Aperta
#647 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@jgclark ci sta già lavorando.

Dal 21/6/2025.

enhancement
Lingua principale
JavaScript
Stelle
204
Fork
82
Merge medio
22h 27m
PR unite (30g)
3

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.