Create custom subfolders
Closed this issue · 7 comments
One of the more useful features Zotfile offers for large PDF libraries is the ability to sort files into alphabetic subfolders. The collections option within Zotero doesn't exactly accomplish this and, as noted, runs the risk of creating duplicate locations. Would it be possible to get something similar with this plugin?
This is the one thing keeping me on Zotero 6. Of course, this is a volunteer project, so what follows is just a thought as opposed to nagging. If I get time I'll look at the code and see if I can figure stuff out myself.
The simpler case (basic subdirectories) should take first priority but ideal would be able to nest things with wildcards. For example, I use the following pattern in Zotfile for subfolders:
{%j|%p}/%y{/%v %e}{/%d}{/{%f }%a}
You can approximate this with Zotero's renaming, and there's an argument that leveraging tools like grep + awk are superior to a directory structure, but I find directories intuitive for both navigating outside of Zotero + interacting with it in most cases with other software.
I am beginning to work on the feature! I will most likely cut the editor and patent wildcards for now.
@ShaneNiesen @ashprice I have added the core functionality for custom subdirectories. Check out the formatting guide and let me know if you encounter any bugs
@wileyyugioh woo! Thank you for your work!
There are a couple of features that are in Zotfile but not here:
- Nesting conditionals. This is easy to work around and hardly a core feature, but if I have something like in the above with eg. {/{%f }%a}, it doesn't work, you get eg.
/{35-40 }Smith
in your output. Rewording the pattern (eg./{%f }{%a}
) results in basically equivalent results, though, so I feel like this feature isn't really essential. - At the moment there is no way to call to editors in the wildcards. For some works, it's preferable to find work by editor; others lack authors and only have editors. I'd say this one is more important because of that last case.
I'll keep an eye out for bugs, but I haven't encountered anything yet - the features that are there have worked perfectly for my whole library.
@ashprice I have added the editor wildcards in the latest version 0.0.5b4, so please let me know if you encounter any issues
And yes, I figured most people's subdirectory path doesn't really rely too heavily on nested conditionals, so I opted to not implement the feature
Thanks! I have yet to encounter any, my whole library has been handled without issue. I'll keep an eye out.