Skip to content

Releases: farling42/obsidian-import-json

0.37.1

19 Oct 21:13
Compare
Choose a tag to compare

What's Changed

  • Resolved bugs around undefined paramters and wrong function calling by @Myliak in #75

New Contributors

Full Changelog: 0.37.0...0.37.1

0.37.0

03 May 17:01
Compare
Choose a tag to compare
  • Provide a "Batch Mode" so that multiple parses can be made on a single file with different parameters for each pass. The file should contain a JSON array, with each element of the array being a JSON object containing any of the following fields:
    • "fieldName": "Field containing the data"
    • "noteName": "Field to use as Note name"
    • "folderName": "Name of Destination Folder in Vault"
    • "namePrefix": Note name prefix/suffix"
    • "nameSuffix": "Note name suffix"
    • "batchStep": "A name for this iteration which will be available in the handlebars file as @importBatchStep)
    • Any of the above values which are not set will be left at the values from the previous/earlier entries in the array (or the values entered into the dialog if they are not present in any array element).

0.36.3

28 Apr 14:02
Compare
Choose a tag to compare

0.36.2

14 Apr 21:51
Compare
Choose a tag to compare
  • Ensure that when accessing folders in the vault we always uses "/" as the directory separator, rather than path.sep which is the underlying O/S's preferred slash.

0.36.1

31 Mar 20:11
Compare
Choose a tag to compare
  • Update all the Obsidian-specific version files so that users know that the improvements added in 0.36.0 are actually present in their Vault.

0.36.0

30 Mar 00:39
Compare
Choose a tag to compare

Add a new way to define the note name, using some javascript:

The "Field to use as Note name" can contain @{ ...js ... } with the javascript inside the {...js...}.

The javascript should contain one or more return statements which provide the name of the note.

Two variables are available:
this points to the current record being processed for this note.
dataRoot points to the base of the JSON object that is present within the selected file.

An example would be:

@{return `${(this.state > 0) && dataRoot.pack.states.find(state => state.i === this.state)?.name || "Unknown" }-${this.name}`}

0.35.0

29 Jan 10:02
Compare
Choose a tag to compare
  • Allow the notename to be constructed from more than one field. The "Field Name" can contain either a single field name, or a more complex format with field names surrounded by "${...}", for example "${country}-${name}" (without the double-quotes).
  • Provide an additional option "Add suffix on duplicate Note Names" which will append a number to the end of a Note if its name matches the name of a Note that was created during this import (it will NOT look for existing Notes in the vault before the import was started).

Full Changelog: 0.34.0...0.35.0

0.34.0

20 Jan 23:11
Compare
Choose a tag to compare
  • Change target JS version to 2021 (instead of ES6).
  • Handle multiple slashes properly in the file's path.
  • Include vault path+filename when note creation fails.

Full Changelog: 0.33.0...0.34.0

0.33.0

07 Dec 18:36
Compare
Choose a tag to compare
  • Ignore any elements of the selected object/array which are not valid JS objects (an INFO line is added to Obsidian's log to report the ignore.)
  • Provide new variables for handlebars templates:
    -- @importSourceIndex (index/fieldname of the current row/field)
    -- @importSourceFile (File: the source file containing the CSV/JSON data [.name and .path are available])
    -- @importDataRoot (the root of the data from the source file)
    -- @importHelperFile (File: the file containing the JS handlebars helpers [.name and .path are available])
    -- @importSettings (Values from the Dialog window)
    --- @importSettings.jsonName: (string) "Field to use as Note name"
    --- @importSettings.jsonNamePath: (boolean) "Allow paths in Note name"
    --- @importSettings.jsonUrl: (string) "Specify URL to JSON data"
    --- @importSettings.folderName: (string) "Name of Destination Folder in Vault"
    --- @importSettings.topField: (string) "Field containing the data"
    --- @importSettings.notePrefix: (string) "Note name prefix"
    --- @importSettings.noteSuffix: (string) "Note name suffix"
    --- @importSettings.handleExistingNote: (integer) "How to handle existing Notes"
    --- @importSettings.forceArray: (boolean) "Each subfield is a separate note"
    --- @importSettings.multipleJSON: (boolean) "Data contains multiple JSON objects"

0.32.0

05 Dec 15:01
Compare
Choose a tag to compare

Add a new field dataRoot which contains the entire JSON file; in case you need to access something that is outside of the element currently being processed.