Available for beta testing: Markdown export of notes

13
  • edited March 1, 2022
    Darren:
    When I drag and drop the highlight/note annotation out of Zotero it into another app I get the highlighted text or annotation only- there is no citation information.
    As noted earlier in this thread, direct dragging of annotations doesn't perform Markdown export, but it's planned. This thread is about Markdown export of notes.

    If you're not seeing annotations.noteTemplates, you're not using a current beta. And all the more so if you're not getting a Markdown option at all when exporting a note from the items list.

    But templates are optional, and don't currently do anything related to item metadata.
  • distillman:

    Good to know that this is being planned. Excellent. :)

    I am using the beta version of Zotero 6.0-beta.2+8d8170583. Is this the latest version? I check often for updates in the pull-down help menu under "Check for Updates ...". Currently it shows that it is up-to-date on my Mac.
  • Darren: Zotero 6.0-beta.2+8d8170583 includes note templates. If you think they're missing, take a screenshot of how you're checking, upload it somewhere (e.g., Dropbox or Google Drive), and provide a link in a new thread, along with a Report ID.
  • distillman: Will do. Thank you as always for all your help. :)
  • edited March 1, 2022
    @erazlogo: No, it doesn't. Again, Shift is just equivalent to the Quick Copy citation mode — i.e., Cmd-Shift-A — and has no effect for export or note formats. You can just do a regular drag.
    @dstillman a regular drag does not get me a link back to pdf. The shift-drag does. Here is another post mentioning the same feature:
    https://forums.zotero.org/discussion/comment/399889#Comment_399889
  • distillman: Just to follow up. I once again tried searching for the template on a different Mac and found it. :)

    On the website (https://www.zotero.org/support/note_templates) it says to search for "annotations.noteTemplates". But it seems to actually be "extensions.zotero.annotations.noteTemplates.highlight". My computer programming skills are only very basic, so I was confused. My apologies.
  • @erazlogo: A regular drag of a note with an annotation to a plain-text text field will include a Markdown link back to the attachment's parent item and PDF:
    # Annotations
    (3/1/2022, 3:39:20 PM)

    “Cosmic rays (CR) are the most ubiquitous population of charged relativistic particles in the universe” ([pdf](zotero://open-pdf/library/items/NB5RJ5M3?page=1&annotation=T392GN8X)) ([Chefranov et al., 2022, p. 1](zotero://select/library/items/MJ5E7RM9))
    That's the entire feature described in this thread, so I promise you it works. If this feature required Shift, I would've said so in my initial post here.

    If you're seeing something different, disable any third-party plugins, and if it's still not working start a new thread with the exact output you're getting with and without Shift.
  • edited April 25, 2022
    I have been testing what @dstillman explains, that it is enough to drag-and-drop and the note will retain the backlinks. Indeed, if I drag it to Windows Notepad all the links are visible, but if I take it to Obsidian they are not.

    @erazlogo, the problem is in the Obsidian configuration: You will need to disable the Setup > Editor > "Auto convert HTML" option and everything will work perfectly, as Dan explains...

    Thank you so much Dan!
  • edited March 2, 2022
    I understand how to add notes from here https://www.zotero.org/support/pdf_reader#adding_annotations_to_notes.

    But, I cannot export notes. Please, how can I export annotation and note?

    I check the file menu, but I cannot see how to export my annotation.
  • @shmuhammad: I explain it in the first post of this thread.
  • @dstillman

    Sorry, I saw it I am new user. I am not sure what zotero://select and zotero://open-pdf means.

    I put on browser and try to open, it ask me to select app to open, I select obsidian and nothing shows.

    So, I am confuse what to do.

    Thank you
  • @shmuhammad: If you right click the note you want to export in Zotero, there should be a menu item called "Export Note...".

    Within the markdown file, there will then be "zotero://select" and "zotero://open-pdf" links after each annotation. If you click on them (and choose Zotero as the program to open them with, since Obsidian doesn't know what do do with them), Zotero will select the corresponding item (i.e. the one to which the note belongs) or open the corresponding PDF.
  • Hi @al3xbr thank you for the help. I now understand and it works.


  • edited March 7, 2022
    Hi everyone,
    I love using the beta on a daily basis it's super nice

    Below a memo/notebook usecase :
    - using a collection named "notebook" in zotero
    - subcollection 1 : "diaries" - like in a ethnographic perspective (cf. Malinowski etc.)
    - subcollection 2 : specific themed notebook (let's say "cinema notebook/notes")
    - subcollection 3 : random themed t
    - all of the three above have only independent notes; no parent items

    What happens when exporting from "export collection..." contextual menu:
    - I got only one md file named as the parent folder "notebook"
    - more important, If I am correct, the subcollection notes have not been exported
    - being specific, I got only the few notes I wrote in "notebook" before creating the subcollection (that is the parent collection, before realizing I would separate my notebooks). So, if want the notes from the subcollection I have to repeat the process.

    Other observation
    - when exporting from right click after having mouse selected all notes (more than one), the md file tittle is "exported elements" ; while when doing it from "export collection..." (right click contextual menu from the collection, not the mouse selection right?) the tittle is named as the collection. So there might be space for preferences: do one would like to name the exported file as the collection name when exporting a selection of more than one note?

    Some suggestions:
    - enable recursivity (récursivité) so exporting notes in a collection would include the notes from the sub-collections
    - some options/preferences :
    1) export all independent notes compiled in one md file named as the parent collection - seems to be the case now
    2) export each indpt note as a separate file, named as the first line of the note
    3) a mix of 1 and 2 as a way to keep collection tree structure: could be all note as a md file with the creation of a new note named as the parent folder (smth like that)

    Other remarks
    - I used zettlr to open the file
    - I use zettlr, obsidian and others apps mainly for compiling weekly and monthly reports of my notes.... but didn't burry libreoffice yet (no sir).
    - related issue was previously mentioned as for naming the exported file in the case of exporting one note only; here would be something similar for more than one.
    - It may also refer to how notes are separated; or appear as separated between each other's (maybe that's a matter of format preference in zettlr, a divider, etc.)
    - Bottom line is how you find again you notes in your zettlrs strucutre, or obsidian, or even just file explorer (besides all search features, tags, regexp, etc.)
    - ...bottom line 2 is how to deal with collection information. Also, what if an independent note exists in more than one collection and you want to have this info in the export? In the case above, my notes could also appear in a saved search for "independent notes written this week".

    PS: Sorry if missed something already there, I used some previous md plugin before but lost track of what we can do from it after the recent the last updates some weeks ago.
  • edited March 7, 2022
    @warguelles Thank you so much! The drag-and-drop madness was driving me crazy!
    @erazlogo, the problem is in the Obsidian configuration: You will need to disable the Setup > Editor > "Auto convert HTML" option and everything will work perfectly, as Dan explains...
    @dstillman It appears to be an Obsidian preference, sorry for the bother & thanks for the explanation.

    And I now can drag annotations directly from the PDF view with all the links included. This is totally awesome. Thank you thank you!
  • For unknown reasons, the drag-and-drop doesn't work for me (the link is not retained, no matter to Obsidian or Typora).
    Is there any specific configuration I need to set on Zotero?
    I'm using the version 6.0-beta.6+ef82becf0.

  • @liamma: Test with a regular plain-text editor like TextEdit or Notepad.

    If you're having trouble, start a new thread and provide a Debug ID for a drag to a regular text editor that doesn't work, along with the details of what you're getting.
  • Great thanks to the programmers! So happy with highlighting, annotating and snapshots (images) within Zotero now. The possibility to collect annotations from different sources in Zotero (PDFs) into one single annotation file is very nice too.

    Double click a created annotation file in Zotero allows to rearrange and overwrite all annotations within this file. Distraction free writing in a clean, separate window.

    Feature requests:
    1.) Backlinking from exported files straight to annotations within a PDF (go to page number...).
    2.) Copy URI (zotero://...page#123) by left click on a page in Zotero PDF-Reader.

    I am not a programmer, but designer. If there is a need to e. g. layout dark mode interface or modify css from light mode to dark mode, please let me know.

    Kind regards

    Piet
  • Backlinking from exported files straight to annotations within a PDF (go to page number...).
    Piet: That already exists — that's one of the main features here. See my first post in this thread.
  • Hi @dstillman,

    Thank you for your reply.
    Here is the the Debug ID: D373972418.

    For reference, the following is what I got by drag-and-drop:
    ```

    “Convolutional Neural Networks (CNNs) have been successfully applied to tackle problems such as image classification (He et al., 2016), semantic segmentation (J ́ egou et al., 2017) or machine translation (Gehring et al., 2016), where the underlying data representation has a grid-like structure.” (Veličković et al., 2018, p. 1)


    ```
  • @liamma: You have it set to copy notes as HTML. This thread is about Markdown. We’ve said we plan to support links back to Zotero as an option in HTML mode in a future version.
  • @dstillman , thank you so much.
    I didn't realize I had set the copy notes in HTML format.
    I have fixed it and it works well now.
    A brilliant feature!!
  • I'm really excited for this feature. What I would love is a way to automatically export the PDF annotations to markdown whenever an annotation is added/removed, and update the MD file of these annotations wherever it is saved without affecting links to other annotations within that MD file. Not sure if this is even wanted or feasible, but I went more into this idea here: https://forum.obsidian.md/t/zotero-best-practices/164/195?u=ryanwwest.
  • Hi @ryanwwest. I'm very interested in retrieval of notes too, specifically for further analysis (rather than MD). I'm thinking of importing annotations from several attachments into a single document (e.g. a Google Doc), or potentially something like Notion, so that the can be further categorised and analysed.

    We do have 'zotero-lib' https://github.com/OpenDevEd/zotero-lib which can get information via the API, including the text/details of annotations — that's very simple, as long as you have the Zotero ID/key for the annotation. However: while it is possible to retrieve all attachments of a Zotero item, it is not currently possible to retrieve all annotation associated with an attachment. I've recently posted on the zotero-dev mailing list about it, and it's a feature we would really love to have — I hope it's something that will be supported in the future. See here: https://groups.google.com/g/zotero-dev/c/ihWmv1nnwDE

    There is a work-around, in that you can retrieve a whole library, which then allows you to easily list which annotations belonging to an attachment. Unfortunately, retrieving the whole library can be time-consuming (say 10 minutes for a library that has a few 1000 items). We're looking to add incremental sync to zotero-lib, which would make the workflow more straightforward.

    If you have nodejs skills, or know people who do, we'd love contributions. :)
  • I was wondering why [Link](zotero://open-pdf/library/items/CITEKEY) does not open the related PDF. Is there any way to acchieve this?
  • @Lucasam: These URLs have nothing to do with cite keys. Zotero already generates correct URLs in Markdown export.
  • Report ID: 1300278226

    Markdown export of notes from annotations is a GREAT new feature -- thank you!
    But, both quick export and 'Export Note' resulted in the following markdown:

    “The cellular source of these peptides” ([Foo et al., 2003, p. 142](zotero://select/library/items/items)) ([pdf](zotero://open-pdf/library/items/items?page=1&annotation=26H22A6S))

    zotero://select/library/items/items -- looks like a link template rather a link to the actual item. Also, I tried testing the open-pdf link using zotero --url ... and it didn't work. The 'library/items/items' pattern is the same as in the citation link.

    When I opened the citation dialog in the note editor, it shows the right item. So, the problem seems in the markdown export code.
  • @t.winkler: That happened in unsynced libraries and was fixed in 6.0.1.
  • Sorry, I had not realized the quick update cycle. It is working now for both links.
    EXCELLENT FEATURE!
  • edited March 24, 2022
    Hello, sorry if I missed this in the conversations above. Is there a way to select several items (e.g. all items in a collection) with notes and batch export them to markdown files? I seem to miss that feature from mdnotes. I am using 6.0.1.
This discussion has been closed.