Closed brokosz closed 6 months ago
@brokosz Sorry for the late reply. I was busy recently, this feature may need some time to finish. Or if you have some free time, it's always welcome to submit a pull request.
@brokosz Hey, Sorry for disturbing. I am going to make a new release of this plugin, just wanna check whether if you are interested submit a PR of this issue. If you are interested, please let me know, and I will include this feature within new version.
@royxue I'll try, but I'm getting a bunch of compilation error and I'm not really a typescript person. Here's the function I was playing with in main.ts:
function contructTodo(lines: string[], settings: PluginSettings, fileName: string){
lines.forEach(line => {
line = line.trim();
const tags = extractTags(line, settings.defaultTags);
// Extract other fields like date, title etc from individual line
const todo = createTodo({
content: line,
tags: tags,
// other fields
});
});
}
// Modify extraction to return array of lines
function extractTitle(text: string): string[] {
const lines = text.split('\n');
return lines;
}
// Call with array
const lines = extractTitle(getCurrentLine(editor, view));
constructTodo(lines, settings, fileName);
@brokosz I think it would be better to give with some regex check, if the user selected area has '\n' which means it's including multiple lines, and then it can run with your func.
Yes, TS is annoying, better to deal it with chatgpt it would be easier
Would it be possible to change the plugin behavior to iterate through all lines selected and create a todo for each? Right now, when I select multiple lines and invoke the plugin to
Obsidian Things3 Sync: Create Things Todo
, only the first one is linked to a Things todo.Thanks!!!