Conversation
|
What's the use of the template argument? I can see creating a new file from scratch only using the CLI being a valid use-case, but not for the template. |
|
Actually there is, people use different templates for different types of notes, I want to make a plugin to add the functionality to create .rnote files directly from obsidian or similar applications which will use this templates to so people dont have to setup everything. If you are interested you can look at the obsidian-xournalpp plugin |
|
yes, but why don't you just copy the template file? |
|
I guess that's what i am doing internally, I am copying bytes of template file to new file. Also at the time of making this PR i didn't knew we had a copy command so my bad. |
|
if you remove the template part I would merge the create command |
|
okay, I will edit that part out |
|
I removed the template argument from the create command |
| /// Output path of the thumbnail | ||
| output: PathBuf, | ||
| }, | ||
| /// Make a rnote file from the cli |
There was a problem hiding this comment.
Rewrite to Create a new rnote file.
| @@ -0,0 +1,36 @@ | |||
| // Creates | |||
|
|
||
| // Pass the Option through to the inner function | ||
| if let Err(e) = create_new_file(&mut engine, input_file).await { | ||
| println!("Cannot Create a file: {:?}", e); |
There was a problem hiding this comment.
return the error instead of printing it.
| println!("Cannot Create a file: {:?}", e); | ||
| return Err(e); | ||
| } else { | ||
| println!("File Created Successfully"); |
|
I removed the engine config loading and also the print statements. |
|
Thanks, did some minor adjustments and cleanup. |
This PR adds the functionality of doing two things with the
rnote-clicommand:rnote-cli create <new_note_name>rnote-cli create <new_note_name> --template-file <rnote_template_name>the template must be rnote file too.
I have added a new create crate to rnote-cli crate.
I have added the respective functions to create file with template etc.
This PR tries to solve #1399 in a different way.