PKM-er / obsidian-zotlit

A third-party project that aims to facilitate the integration between Obsidian.md and Zotero, by providing a set of community plugins for both Obsidian and Zotero.
https://zotlit.aidenlx.top
MIT License
635 stars 29 forks source link

[QA] How to add "@citekey" as alias to Literature note #150

Closed anandkumar89 closed 1 year ago

anandkumar89 commented 1 year ago

Usecase:

---
alias : @auth2023
---

refer [@auth2023] for further discussion.


This will allow connections between nodes in graphs. But I'm not sure how to achieve this.

anandkumar89 commented 1 year ago

current solution is to rename file as @citekey and manually add alias fields from side pane. But a native solution would be appreciated, e.g. template for metadata as in citations plugin

SeveNOlogy7 commented 1 year ago

Add an @ in the template for Note Filename would name the file as @auth2023. Or you can map citekey as alias, this results in

---
alias : auth2023
---

no @ before the citekey though.

Currently there's nothing like a template for metadata in this plugin.

image

anandkumar89 commented 1 year ago

Thanks, this is acceptable workaround till frontmatter is available as editable template.

FeralFlora commented 1 year ago

This would be useful if you don't have the citekey as the filename of the note.

But why would you want an alias that is identical to the actual filename? In that case, it's not really actually an alias, and it is redundant.

Anyway, I second the last comment that it would be much more straightforward if the frontmatter was part of a template, rather than being set in the plugin's settings.

anandkumar89 commented 1 year ago

... solution is to rename file as @citekey and manually add alias fields from side pane ...

My bad with incorrect use of "and", wanted @citekey as alias but ended up renaming filename as "@citekey" as can't add it as alias programatically. This is either or situation.

End goal is to be able to link to literature note [[link]] either by title or by @citekey in Obsidian.

The syntax "@citekey" could be useful if later would decide to parse a long .md file to latex other than fact that it ("@citekey") is prevalent syntax for citing within markdown community.


@aidenlx could frontmatter as template be a feasible feature request?

InvisCat commented 1 year ago

... solution is to rename file as @citekey and manually add alias fields from side pane ...

My bad with incorrect use of "and", wanted @citekey as alias but ended up renaming filename as "@citekey" as can't add it as alias programatically. This is either or situation.

End goal is to be able to link to literature note [[link]] either by title or by @citekey in Obsidian.

The syntax "@citekey" could be useful if later would decide to parse a long .md file to latex other than fact that it ("@citekey") is prevalent syntax for citing within markdown community.

@aidenlx could frontmatter as template be a feasible feature request?

+1, I need this feature too.

In addition to hoping to customize the alias item, I would also like to customize how other frontmatter content is stored. For example, I would like to keep only the first item of certain arrays (e.g. DOI, Extra) and flatten them. It would be helpful if I could have a custom frontmatter template.

Thanks @aidenlx .

aidenlx commented 1 year ago

In v1.1.0-beta.0, you can use the following

aliases: @<%= it.citekey %>

make sure to check out the document on this changes and cheatsheets