farling42 / obsidian-import-json

Plug-in for Obsidian.md which will create Notes from JSON files
MIT License
85 stars 5 forks source link

a wish to use several JSON file + Template pairings from a macro #30

Closed seed78 closed 3 months ago

seed78 commented 1 year ago

Hi, I am a fan of using this plugin. I use it frequently to import bibliography from Zotero. I wonder whether it is possible to add the following two features.

  1. Is it possible to assign a hotkey for this plugin?
  2. This is related to my routine of using Zotero in the following steps.
    • I export my new bibliography in BetterBibTeX JSON file
    • From this same JSON file source, I need to use two different TEMPLATE files to import into two kinds of Notes that I need.
    • Each kind of Note uses the respective Destination Folder in Vault. As you can see from this procedure, I need to indicate the respective TEMPLATE files and Destination Folder in Vault for each kind of Note that I need from the same JSON file. These needs lots of clicking and switch between windows.

A feature in my wish list for my point 2: Is it possible to indicate more than one template fileTEMPLATE files and its paired Destination Folder in Vault in order to import from the same JSON file?

I summarize my wish as the following:

  1. Setup a "parallel import" workflow Same JSON file source ---> template 1 ----> Folder 1 ---> template 2 ----> Folder 2 ---> template N ---> Folder N
  2. Save this workflow as a workflow file
  3. can assign a HotKey for the indicated workflow

The outcome of my wish is that as long as I export a JSON file, I simply use a HotKey for a particular workflow and then I will have more than one Note imported in the indicated folder simultaneously.

Thanks again for considering this.

gbraad commented 1 year ago

Hotkey is important as I do not use the app ribbon bar (hidden).

farling42 commented 1 year ago

Support for assigning a hotkey has been added in 0.28.0

farling42 commented 6 months ago

Obsidian runs a normal web browser (electron). Due to security concerns, web browsers are unable to access information about the location of a file, it can only access the contents of a file. This prevents this plugin from being able to remember the location of your source files.

See https://github.com/farling42/obsidian-import-json/issues/66 which is an Enhancement Request to support accessing files within a Vault

Truncated commented 3 months ago

My vision for this enhancement (carried over with example schema from https://github.com/farling42/obsidian-import-json/discussions/73) would include:

This notional example is not elegant at all - it's pretty much three separate templates just mashed into one file. Depending on the method actually employed to identify the "active" value from the supplied list, I'm sure it could be easily refined to provide if statements or something similar for just the details that need to be different.

Example template `Field containing the data` = `editionTwoFutureLogPages, editionTwoIndexPages, pages` ``` {{#with editionTwoIndexPages}} tags: - 'Indicies' Page: {{page}} Date: {{@importDataRoot.startDate}} Image: '__attachments/{{image.id}}.jpg' {{/with}} {{#with editionTwoFutureLogPages}} tags: - 'Future Logs' Page: {{page}} Date: {{@importDataRoot.startDate}} Image: '__attachments/{{image.id}}.jpg' {{/with}} {{#with pages}} tags: - '{{collections}}' Page: {{page}} Date: {{date}} Image: '__attachments/{{image.id}}.jpg' {{/with}} ```
farling42 commented 3 months ago

Batch processing has been added in version 0.37.0 It should allow multiple parses of the data to be handled in one go.