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

Adds Journey Plugin #141

Merged
merged 1 commit into from Feb 1, 2021
Merged

Adds Journey Plugin #141

merged 1 commit into from Feb 1, 2021

Conversation

akaalias
Copy link
Contributor

@akaalias akaalias commented Jan 31, 2021

Hi @lishid!

I've created this plugin to find the connection between two notes in the vault. Check out this discussion on the forum for details and a demo video: https://forum.obsidian.md/t/new-plugin-journey-find-the-story-between-your-notes/12153

Let me know what you think and hope we can get this into the community soon :)

Thank you so much,

Alexis

@lishid
Copy link
Collaborator

@lishid lishid commented Feb 1, 2021

Very nice!

https://github.com/akaalias/obsidian-journey-plugin/blob/9bfd7b6ccc36ab2c7e51a22e2f6e3eb5fac8353f/src/main.ts#L50
Seems like you're parsing the files yourself manually!

What you'd ideally want to do is use our pre-indexed link graph directly by accessing the linking information in MetadataCache.
https://github.com/obsidianmd/obsidian-api/blob/b06b55f1b3a673a4b8bf10e8ca6b823981b9cc8b/obsidian.d.ts#L1475

Otherwise, looks great!

@akaalias
Copy link
Contributor Author

@akaalias akaalias commented Feb 1, 2021

Hi @lishid and thank you for your notes.

So, I've looked at the resolvedLinks which I think makes sense to use but it seems like my current npm obsidian-lib does not have that API exposed.

Check it out: The running instance MetaDatCache has the property no problemo:

Screenshot 2021-02-01 at 17 49 33

When I try the same in my IDE, I get this:

Screenshot 2021-02-01 at 17 49 15

How about we release the plugin as-is and figure out this refactor in the coming days? There are so many members on the forum who would love to try it out and I'd love to hear their feedback and improve the plugin.

Let me know!

@lishid lishid merged commit 6fb52d7 into obsidianmd:master Feb 1, 2021
@lishid
Copy link
Collaborator

@lishid lishid commented Feb 1, 2021

Sure yeah.

As for the declarations, just run npm update on your repo folder and it should pull in the newest definitions!

@akaalias
Copy link
Contributor Author

@akaalias akaalias commented Feb 1, 2021

Awesome, thank you. Strange... I did run npm update before I wrote my comment above – But I got no update then. Any idea why that could be?

I'll try again and keep you posted on the refactor!

Thank you again for merging, I really hope to see what stories the community finds in their vaults :)

@lishid
Copy link
Collaborator

@lishid lishid commented Feb 1, 2021

If that doesn't work, just delete the obsidian folder in your node_modules (or you can even delete the whole node_modules folder) and re-run npm install. Let me know if it works.

@akaalias
Copy link
Contributor Author

@akaalias akaalias commented Feb 3, 2021

Hi @lishid – I've deleted the obsidian folder now as well and re-ran npm install – But I still am not getting the latest version I think.

Here's the package.json that I get:

{
  "_args": [
    [
      "obsidian@https://github.com/obsidianmd/obsidian-api/tarball/master",
      "/Users/alexis/Library/Mobile Documents/27N4MQEA55~pro~writer/Documents/Notes/.obsidian/plugins/obsidian-journey-plugin"
    ]
  ],
  "_development": true,
  "_from": "obsidian@https://github.com/obsidianmd/obsidian-api/tarball/master",
  "_id": "obsidian@https://github.com/obsidianmd/obsidian-api/tarball/master",
  "_inBundle": false,
  "_integrity": "sha512-ifW0bdTx88nQ2jwEHtZp8I6DhQ5K9o+G30pwhhqIEbpSd/AJpShsu6vyGyqrZWT88khMHrbydC9fUPu4rQbpKg==",
  "_location": "/obsidian",
  "_phantomChildren": {},
  "_requested": {
    "type": "remote",
    "raw": "obsidian@https://github.com/obsidianmd/obsidian-api/tarball/master",
    "name": "obsidian",
    "escapedName": "obsidian",
    "rawSpec": "https://github.com/obsidianmd/obsidian-api/tarball/master",
    "saveSpec": "https://github.com/obsidianmd/obsidian-api/tarball/master",
    "fetchSpec": "https://github.com/obsidianmd/obsidian-api/tarball/master"
  },
  "_requiredBy": [
    "#DEV:/"
  ],
  "_resolved": false,
  "_spec": "https://github.com/obsidianmd/obsidian-api/tarball/master",
  "_where": "/Users/alexis/Library/Mobile Documents/27N4MQEA55~pro~writer/Documents/Notes/.obsidian/plugins/obsidian-journey-plugin",
  "author": "",
  "dependencies": {
    "@types/codemirror": "0.0.98"
  },
  "description": "Definitions for the latest Obsidian API (https://obsidian.md)",
  "keywords": [],
  "license": "MIT",
  "name": "obsidian",
  "types": "obsidian.d.ts",
  "version": "0.10.9"
}

@lishid
Copy link
Collaborator

@lishid lishid commented Feb 3, 2021

That's weird. I've pushed out the newest definitions hours ago already (see the version at https://github.com/obsidianmd/obsidian-api/blob/master/package.json)

Maybe you have a package-lock.json that needs cleaning? Weirdly enough, people say npm update should work and fetch it... I guess in the worst case go grab the .d.ts file manually?

@akaalias
Copy link
Contributor Author

@akaalias akaalias commented Feb 3, 2021

Removing package-lock.json worked! Thank you, will go ahead with the refactor now.

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