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

Abierto
#237 4 comentarios 0 reacciones 1 asignado Ver en GitHub

@EduardMe ya está trabajando en esto.

Desde el 8/3/2022.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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

Lenguaje dominante
JavaScript
Estrellas
204
Forks
82
Merge medio
22 h 27 min
PR fusionados (30 d)
3

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NotePlan/plugins

Todos los issues de NotePlan/plugins

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.