Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Note Template] Export and sync note with citekey as title #309

Closed
bepolymathe opened this issue Jan 3, 2023 · 13 comments
Closed

[Note Template] Export and sync note with citekey as title #309

bepolymathe opened this issue Jan 3, 2023 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@bepolymathe
Copy link

Hi @windingwind

Thanks for this plugin ! And happy new year.
I happily use the syncronization of the notes between Zotero and Logseq (thanks to better-notes) but I would like the exported notes to be titled the number of "citekey" inherited from BetterBibtex. Is it possible ?

@bepolymathe bepolymathe added the help wanted Extra attention is needed label Jan 3, 2023
@windingwind
Copy link
Owner

Yes. Modify the ExportMDFilename template to fit your needs.

Let me know if you have any difficulties.

@bepolymathe
Copy link
Author

bepolymathe commented Jan 3, 2023

Ok, i think it’s somethings with <p>${topItem.citationKey ? topItem.citationKey : ""}</p> 🤔

in the ExportMDFilename... maybe like this ?

${(noteItem.getNoteTitle ? noteItem.getNoteTitle().replace(/[/\\?%*:|"<> ]/g, "-") + "-" : "")}${topItem.citationKey }.md

@windingwind
Copy link
Owner

The filename is a pure string, not an HTML element. Don’t wrap it with

.

Not sure if citation key can be get directly. I guess you should use getField?

@bepolymathe
Copy link
Author

My dream is to have something like this as result

image

@bepolymathe
Copy link
Author

I guess you should use getField?

I have to learn about this...

@windingwind
Copy link
Owner

Yes, it is possible. I’m not familiar with BBT thus not able to provide the template you beed right now. Tomorrow I will have time to test it.

Don’t worry about it. It’s easy.

@bepolymathe
Copy link
Author

Thanks for your help, I'm not a developer. In my example below, the export should be formatted with metadata which is the logseq format (a little different from classic Yaml).

image

@windingwind
Copy link
Owner

More details about the logseq yaml format would be helpful. Does logseq has any private format? Are there any general yaml features that logseq does not support?

@windingwind
Copy link
Owner

Sorry I misunderstood the md titles you mentioned here. The title refers to the first line of the exported md file, not the filename, right?

@bepolymathe
Copy link
Author

bepolymathe commented Jan 3, 2023

I was thinking well of the file name and not the first line of the file. My idea is to use the MarkDBConnect plugin which detects files with the name of the BBT citkey and indicates it in Zotero...

image

@windingwind
Copy link
Owner

Try this for your ExportMDFileName:

@${(noteItem.parentItem && noteItem.parentItem.getField("citationKey")) || noteItem.key}.md

The YAML header is defined in ExportMDFileHeader.

@bepolymathe
Copy link
Author

Thanks, it works for the file name.

For the metadata export step, if I understand correctly, I absolutely must keep the YAML at the head so that Zotero Better Notes recognizes the note by his ID and is able to synchronize it 🤔

The format recognized in Logseq for a good quality display would assume that I arrive at something like this as a header.

alias:: TITLE
tags:: [[tag1]]
type:: [[ZoteroType]]; 
source:: [[zotero]] 
date::  2022
pages:: 84
url:: [Web site](https://www...)
zotero_link:: [citekey](zotero://select/items/@citekey)
file:: ![TITLE](file:///home/bepolymathe/Zotero/storage/PQU6ZZ3C/PDF_NAME.pdf)
icon:: 📚

The question I ask myself. Could it be possible that the ID for Zotero Better Notes is included in the top file metadata in logseq ? By adding for example a line like this

BetterNotes:: noteItem.key

@anandkumar89
Copy link

anandkumar89 commented Jun 11, 2023

looking for: @citeKey/noteTitle in alias to each item-note created in zotero. Instead of noteTitle, shortTitle can also be used when available.

my use case : cite keys are easier to remember and aliases are searchable in various note taking apps (e.g. obsidian [[@citekey...]] will suggest all notes with specific aliases)

Until now I used obsidian plugins to cite literature, but that would be rendered obsolete as zotero/betternotes is sufficient for all literature note taking.

Repository owner locked and limited conversation to collaborators Aug 10, 2023
@windingwind windingwind converted this issue into discussion #618 Aug 10, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants