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] Enable citation autocomplete on mobile by adding citation dictionary export type #2672

Open
johnkingeu opened this issue Oct 10, 2023 · 8 comments

Comments

@johnkingeu
Copy link

Debug log ID

N/A

What happened?

Autocomplete of citations on mobile devices is a very welcome feature for those of us who use our iPads for writing as well as reading. However, there is a lack of software support for this. Obsidian user u/Feralflora has developed a workflow using Better Bibtex and Obsidian to accomplish this:

Mobile citation autocompletion guide using Quickadd and Various Complements

This workflow involves outputting a BibTeX file then processing it using an Obsidian QuickAdd template to produce a citation dictionary which Various Complements accesses on mobile. This is a real advance for those of us using our iPads to write. The workflow can be partially automated by using Better Bibtex's automatic export feature, but the QuickAdd template still has to be manually run whenever the database changes.

A more elegant solution would be for Better Bibtex to output the citation dictionary directly. The custom dictionary format is very simple:

`The data should be in a format like this:

inserted text, description, alias

In our case, we want to insert the citekey, and use the title as both description and alias, like so:

citekey, title, title

Yes, title twice. Why? The first instance of title is only for display in the dropdown, while the second one is a searchable alias. With this format, we can search for and autocomplete citekeys using either the citekey or the title.`

Would it be possible to add this feature to Better Bibtex? It is likely that other mobile software could be configured to use a citation dictionary, although the format might vary. A full implementation of this might use a template or GUI to configure the dictionary output, but a quick and dirty implementation to start would also be nice :-)

Repository owner deleted a comment from github-actions bot Oct 10, 2023
@retorquere
Copy link
Owner

Isn't this something that can be automated on the obsidian side? I'm particularly unkeen about doing any gui work for this, I really don't like UI work, and especially not in the transition period from Zotero 6 to 7.

@johnkingeu
Copy link
Author

I think ignore/delete the GUI comment - that could always be a future request as it is certainly not necessary. The format could just be hardcoded as it would suit most users.

Also, this request should not take precedence over Z7 work!

It may be possible to automate on the Obsidian side but:

  1. At present the dictionary conversion runs on desktop, what if the user goes straight to Obsidian mobile without using Obsidian desktop
  2. There would need to be something constantly running to check for a changed bibtex file
  3. It ignores other platforms (although you could argue that this doesn’t matter if no-one has identified anything specific)

So I think it is more elegant to have it located in BB as BB has the automatic export code. Perhaps see if anyone else is interested in this feature though?

@FeralFlora
Copy link

3. It ignores other platforms (although you could argue that this doesn’t matter if no-one has identified anything specific)

Hi, just chipping in since this is about the script I made. Regarding this point ☝️ Without a way to customize the format of the citation dictionary to autocomplete from, this is only really relevant to Obsidian users, or even more specifically, Various complements plugin users, since the citation dictionary is made according to the syntax of this plugin.

Anyway, automating the running of this script (at least on Obsidian upstart) is something that should be fairly simple to achieve in Obsidian, and something I intend to work on given the uptake of this workflow.

However, as is, this feature request is still valuable, since the script can only run in a desktop environment, as mentioned here:

At present the dictionary conversion runs on desktop, what if the user goes straight to Obsidian mobile without using Obsidian desktop

So of course, having a direct BBT option would simplify things. But again, this is very platform specific. Nevertheless, there are very few options that allow bibtex / pandoc citations on iPads (I've looked hard), so this workflow has value in that light.

The limiting factor of the script is the fs dependency, which could perhaps be eliminated by using the Obsidian API instead, but I am not sure. If so, the script could also run on mobile devices.

@retorquere
Copy link
Owner

At present the dictionary conversion runs on desktop

OK, but so does Zotero + BBT. Something is running on the desktop in any case.

I'm trying to think of something that would generalize, because I do not want to go the path of adding bespoke translators + auto-export. I can't run most Zotero translators as auto-exports, because auto-exports happen in a limited emulation of the environment Zotero translators expect. Plus there would have to be changes to the prefs GUI to manage them. I'm open to lending a hand here, I just haven't found the right solution yet.

@FeralFlora
Copy link

FeralFlora commented Oct 10, 2023

OK, but so does Zotero + BBT. Something is running on the desktop in any case.

Right, so not running on mobile is only really a problem if you:

  1. add new sources to Zotero / make changes that change a citekey
  2. open Zotero, which allows an auto-export to occur
  3. but then don't open Obsidian, so the citekey autocompletion dictionary is not updated
  4. Try to insert a citation about the newly added item on the iPad

Of course, since the script is just javascript, it could be run independently of Obsidian (with some minor modifications), which could also circumvent the problem. Either running on a timer, or based on file changes to the bibliography. I don't have experience with makefiles, but perhaps that is an option for file-change dependent running.

I'm trying to think of something that would generalize, because I do not want to go the path of adding bespoke translators + auto-export.

Doesn't seem like you could generalize this without going down that path, as far as I can tell.

@retorquere
Copy link
Owner

I'm not too worried about the path, just the part that generates the content.

@FeralFlora
Copy link

I'm not too worried about the path, just the part that generates the content.

I'm not sure what you mean by that, given what you wrote before, which seems to conflict with this sentiment. But anyway, I've documented a simple way to automatically update the citation dictionary every time Obsidian opens in the linked forum post.

@retorquere
Copy link
Owner

Yeah I think you're right. I'd still need to do GUI work for management of the auto-exports, and it would require something special in the export dialog.

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

No branches or pull requests

3 participants