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

Đang mở
#237 4 bình luận 0 reaction 1 người được giao Xem trên GitHub

@EduardMe đang làm issue này rồi.

Từ ngày 8/3/2022.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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

Ngôn ngữ chính
JavaScript
Star
204
Fork
82
Merge trung bình
22 giờ 27 phút
Pull request đã merge (30 ngày)
3

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NotePlan/plugins

Tất cả issue của NotePlan/plugins

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.