Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take into account the existence of / in tags when creating the knowledge base directory structure #85

Closed
ngirard opened this issue Apr 14, 2021 · 7 comments · Fixed by #87 or #95
Labels
bug Something isn't working

Comments

@ngirard
Copy link

ngirard commented Apr 14, 2021

As discusssed in #79, it makes sense for e.g. Obsidian users that tags contain a slash.

However, along with hierarchy = ['Tag'], this leads to the following error:

gooseberry make
✔ Clear knowledge base directory? · yes
Error: 
   0: No such file or directory (os error 2)

Location:
   /home/ngirard/sandboxes/rust/gooseberry.git/src/gooseberry/knowledge_base.rs:370

There are several possible strategies in this scenario. The first one to come to mind would be to translate parent/child1 and parent/child2 into the following directory structure:

kb_dir/
\__ parent/
    \__ child1.md
    \__ child2.md

which I'd be fine with ; but I haven gotten further thought about the alternatives.

@ngirard ngirard added the bug Something isn't working label Apr 14, 2021
Ninjani added a commit that referenced this issue Apr 14, 2021
@Ninjani
Copy link
Member

Ninjani commented Apr 14, 2021

The first one to come to mind would be to translate parent/child1 and parent/child2 into the following directory structure:

This ended up being pretty easy to implement but will likely come back to bite me when I get around to adding Windows support in #55 :p

@ngirard
Copy link
Author

ngirard commented Apr 14, 2021

Thank you very much !

will likely come back to bite me when I get around to adding Windows support

Hopefully replacing all / with std::path::MAIN_SEPARATOR would be enough...?

@Ninjani
Copy link
Member

Ninjani commented Apr 14, 2021

Good point, I've done that now and hopefully that'll be the end of it.

@ngirard
Copy link
Author

ngirard commented Apr 14, 2021

Do you feel ready to merge the branch, so I can take advantage of it ?

@Ninjani
Copy link
Member

Ninjani commented Apr 14, 2021

I've merged it now, but would like to add some more documentation to the README before making a new release

@Ninjani
Copy link
Member

Ninjani commented Apr 14, 2021

I'm reopening this because I want to add a configuration option to set the nested tag character instead of hard-coding it as "/" - for instance in org-mode this would be " : ".

@Ninjani Ninjani reopened this Apr 14, 2021
@ngirard
Copy link
Author

ngirard commented Apr 14, 2021

Thanks !
And sorry for not contributing to the docs :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants