NotePlan / NotePlan/plugins

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

オープン
#237 コメント 4 件 リアクション 0 件 担当者 1 名 GitHub で見る

@EduardMe がすでに取り組んでいます。

2022年3月8日 から。

主要言語
JavaScript
スター
204
フォーク
82
平均マージ
22時間 27分
マージ済み PR(30日)
3

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。