Open ioanniswd opened 4 years ago
Hi @ioanniswd I can see the problem in indentation, is that what you are talking about or am I missing and something else?
I don't think there is any problem at all until the notes are filtered one by one (happens with copy
and I guess also search
(haven't tested this yet)), except for the bullets (which don't look good IMO, anyway).
If you look at the .md
file as if it was written manually: wouldn't you indent the next line so that it looks more natural? And if you add sub-lists (this is what I usually do), you have to indent them to be parsed as separate lists (and not just items of the top-level list).
Yes, the indentation and the bullets are the issue when it comes to show
.
Also, in copy
, we currently treat a multi line note as separate notes:
$ stup copy --to tomorrow --from today
About to copy notes from Friday May 01, 2020 to Saturday May 02, 2020 for category personal
- Multi
>>> Copy this note [y,n,q,a]?: n
line
>>> Copy this note [y,n,q,a]?: n
note
>>> Copy this note [y,n,q,a]?: n
- Single line note
>>> Copy this note [y,n,q,a]?: n
Ok, this needs a little work to think of the best approach to deal with.
The fact that each note starts with a dash might be helpful to be able to group distinguish multiline notes via a regex.
I will think about possible solutions. If anyone thinks of something let's add it here for discussion.
PS: I really appreciate your contributions @ioanniswd @tiosgz, thank you very much
I haven't found a way to do this using one regex-ed line, but I think this could work
arr=()
read
through the file
-
, append it to the arrayarr=()
while IFS='' read line
do
if [[ "$line" =~ (^- ) ]]; then
arr+=( "$line" )
else
last=$((${#arr[*]} - 1))
arr[$last]+="\n$line"
fi
done < $notes_file
Will find all the credits if you want (though it'd mean filtering ~20 tabs)
@tiosgz I think it'll work. I can check that tomorrow and get back to you. If you already started or you want to work on this let me know to avoid conflict.
Will find all the credits if you want (though it'd mean filtering ~20 tabs)
:laughing: no, I don't
If you already started or you want to work on this let me know to avoid conflict.
I don't plan doing this, because (as I know myself) I would never get it done.
Mentioned in this issue comment by @tiosgz :
Applies to both
add
andcopy
commands.