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

Feature request: Export collection subtree as org subtree #39

Closed
hyiltiz opened this issue May 8, 2020 · 3 comments
Closed

Feature request: Export collection subtree as org subtree #39

hyiltiz opened this issue May 8, 2020 · 3 comments

Comments

@hyiltiz
Copy link

hyiltiz commented May 8, 2020

Say I have a collection in Zotero that goes:

.
└── Science
    ├── Biology
    ├── Chemistry
    ├── CS
    │   ├── Algorithms
    │   │   ├── Sorting
    │   │   └── Trees
    │   └── DataStructures
    └── Physics

And for the current project, I would like to export the CS subtree into a org subtree:

* CS
**  Algorithms
*** Sorting
**** Some reference 1
**** Some reference 2
*** Trees
**** Some reference 1
**** Some reference 2
*** <Others>*
**** Some reference 1
**** Some reference 2
**  DataStructures

Note: <Others> contains the reference in the Algorithms collection but in neither Sorting or Trees.

I spent an afternoon looking at my Zotero interface, then inserting each one manually into an org file with zotxt-emacs. I imagine either multiple selection and inserting multiple references [1], or direct support for exporting collections (or better, collection subtrees) would be truly awesome. I imagine exporting the collection as a json then parsing the json library may be an easy option, but I have no idea what the zotxt interface provides so I may be missing something.

[1] #16 (comment)

@egh
Copy link
Owner

egh commented May 9, 2020

Hi @hyiltiz - This sounds great, though it would require a new endpoint in zotxt to support it. I probably won't have the time to work on this, but I welcome pull requests!

In the meantime, here is a quick workaround I came up with. If you do a CSV export of your content from Zotero, that will include the zotero id. Using your preferred method of text processing (mine would probably be an emacs macro) you can turn this id (e.g. 2WCTH5N2) into [[zotero://select/items/1_2WCTH5N2][foo]]. You can then run org-zotxt-update-all-reference-links and the citation data should be updated. Hope that helps!

@hyiltiz
Copy link
Author

hyiltiz commented May 9, 2020

Thanks so much! That workaround is brief enough to be easily implemented. So org-zotxt-update-all-reference-links doesn't care the content of foo? I really liked the APA style references; I am assuming it would expand the ID into one?

EDIT: I just tried the workaround, and it works (in Debian Testing, Zotero 5.0.64, zotxt 5.1.0, Emacs 28.0.50, emacs-zotxt 20200120.1950) well. Thanks! It would be awesome if there was native support for subtree export for collections, but until then, this is quick and easy enough to defer development indefinitely :-p

@egh
Copy link
Owner

egh commented May 10, 2020

Yes, it ignores the text content of the link and only cares about the location, which is based on the zotero id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants