NotePlan / NotePlan/plugins

In-line/refreshable templates (data-view v1)

Ouverte
#237 4 commentaires 0 réactions 1 personne assignée Voir sur GitHub

@EduardMe y travaille déjà.

Depuis le 8/3/2022.

Langage dominant
JavaScript
Étoiles
204
Forks
82
Merge moyen
22 h 27 min
PR mergées (30 j)
3

Description

someone could embed template code like this:
```Template
some np.Template code here
```
and then when NP sees that code block, it passes it to np.Templates to execute/"render" it (and refreshes it on demand). Whatever the return value is gets rendered by NotePlan in-line. It is important for the formatting to clearly indicate that this is not just user-typed text (hence why I like the code block formatting here).

Screen Shot 2022-03-08 at 1 06 47 PM

I was thinking that it would trigger a re-draw on:

  • note load
  • code block edit
  • refresh button/menu press (initially could be on note ... overflow menu, but at some point a circular refresh arrow on the block itself would be nice)

It would have some indication of what it was last refreshed (here I put it in the top of the code block next to the title, but it could be bottom right or whatever)

Note: @mikeerickson said: Another FYI, any time you execute a template to render, any JavaScript code you have between tags will be executed.

You will have access to any:

  • NotePlan API command
  • Any methods defined in globals.js
  • Any methods you have supplied to in your own plugins located in methods object or variables located in data object

So, basically using any template you can do d LOT LOT LOT LOT more than existing templates

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.