Create File from Template: Ask for Filename, then set both the name and the first Heading as such #541
Unanswered
Gewerd-Strauss
asked this question in
Help
Replies: 1 comment
-
The const templateTFile = tp.file.find_tfile("[[template]]");
const fileName = await tp.system.prompt("Enter file name");
await tp.file.create_new(templateTFile, fileName, false,); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a general template structure I want to create. On Execution, I want to
The rudimentary structure of the end product, upon finished template-execution is as follows:
Example for
Dwarf.md
:Now. The problem I have is that
tp.file.create_new()
for this.As I understand it, I can create a file from a template initially, instead of just inserting them post creation. I suspect that's what I am looking for, but I am not sure.
The template folder is located at
VaultRoot/002 templates
My very rudimentary first shot, which doesn't work, was this:
File 1:
Book_CreateChapter ← Template, placed in template folder
File 2:
DND_BookEntry_Template ← template, also in template-folder
Every Note also contains three tags, all of which should be chooseable by user at creation as well. However, as I suspect that to just be a permutation of what I suspect I must do for the filename fed into
create_new()
, I only mention this.What exactly am I missing here? I am not exactly experienced in the arts of this plugin, but from what I see other people do with it I am both eager to learn, (kinda jealous that I suck at it), and utterly bewildered by my apparent lack of insight here :/
Beta Was this translation helpful? Give feedback.
All reactions