windingwind / zotero-better-notes

Everything about note management. All in Zotero.
GNU Affero General Public License v3.0
5.53k stars 188 forks source link

[Discuss] Syncing between Notes and MarkDown #147

Closed windingwind closed 1 year ago

windingwind commented 2 years ago

Hi,

These days I've received many requests about syncing/importing markdown files to a Zotero note, like #143 #141. This has been put aside for a long time and I'm planning to support the two-path syncing using a note2md(we already have)+md2note conversion.

The syncing system would automatically compare the note and MD file's versions and their modification time. The older one will be updated if it keeps unchanged since the last syncing. If both are modified, the user will be asked to merge them and choose which modification will be accepted using a git-diff style window.

Previous discussions about note2md syncing are here: #45

Welcome any suggestions!

windingwind commented 2 years ago

To avoid possible conflicions caused by the annotation/citation, there will be extra hidden text in the exported markdown file. Like this:

<!-- bn:begin:ABXZ1469 -->
comment (pdf link) (item link)
<!-- bn:end:ABXZ1469 -->

And the markdown block wrapped by these decorators will be regarded as placeholders while syncing. Different MD reader/editors may have different behaviors for these decorators. I tested on Typora and Obsidian:

IpeTek commented 2 years ago

Hi, I like to use Zettlr as my (Zettelkasten) editor. Could you please check how the sync works with that.

Also, Zettlr uses a totally app-agnostic/future proof way of linking between pages: Double brackets with an ID of the type %Y%M%D%h%m%s, [[20201116150658]]. Would it be difficult to compile a Better-notes template that would include this identifier in every note? With the feature in place I could use both apps seamlessly together.

I just found Better-n. A great invention that makes Zotero so much better. Thank you!

windingwind commented 2 years ago

Hi, @IpeTek

  1. BN’s sync is currently and will work in an app-agnostic way (rely on the Zotero App because the notes are stored in the Zotero database). The markdown format can be opened in any software; the links between notes are the relative path of the markdown files.

  2. As far as I know, Zetllr does not actually sync to Zotero. It uses the exported JSON file to get citations and the BBT plugin of Zotero does the syncing of this file. So not sure what you want with Zettlr, the sync, or something else?

This BN plugin tries to do something different: sync the note itself, rather than the citation information. This allows users to take notes while reading papers in Zotero more easily and sync them to their familiar note software later.

  1. Compiling a template of the current time is easy:

Template Name: [Text] Time

<p>${((date)=>`[[${date.getFullYear()}${String(date.getMonth()).padStart(2, '0')}${String(date.getDate()).padStart(2, '0')}${String(date.getHours()).padStart(2, '0')}${String(date.getSeconds()).padStart(2, '0')}]]`)(new Date())}</p>

The result: [[202208242210]]

davidoskky commented 2 years ago

The citations/annotations in note cannot be modified, while their corrsponding MD segments might be modified or deleted

The only idea that comes to mind is to write the citations in a yaml header and then reference them in the note as [1] [2] [3]. In this way one can move around references and even delete them but you'll still have something in the Zotero note.

Not a really good way to handle this, but maybe it can give you an additional idea on how to handle it.

windingwind commented 2 years ago

@davidoskky

Thanks for the suggestion. Actually the citation information is stored in each note item as a string, having it stored in the markdown is a good idea.