Templating: allow import name to be dynamic
@mikeerickson がすでに取り組んでいます。
2024年1月11日 から。
評価
この issue はまだ評価されていません。
説明
A user has created a template that dynamically imports a template based on the day of the week.
What would be ideal would be to allow this import to load a template based on the calculated day, e.g.:
const daysOfWeek = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
const today = daysOfWeek[this_date.getDay()]
const templateName = `☀️ Daily Note - ${today}`
...
<% import(`${templateName}`) -%>
This doesn't work as the code is currently written.
The string in the import statement is treated as a literal and is not interpolated.
***************************************************************************
ERROR
Method: NPTemplating.getTemplate:
Message: Template "${templateName}" Not Found or Empty
***************************************************************************
Would be nice to allow this to be dynamic so that the code above would load "☀️ Daily Note - Mon" or "☀️ Daily Note - Fri"
- 主要言語
- JavaScript
- スター
- 204
- フォーク
- 82
- 平均マージ
- 22時間 27分
- マージ済み PR(30日)
- 3
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NotePlan/plugins のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
bug
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
NotePlan/plugins の issue をすべて見る
似ている issue
-
code-quality refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100