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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plans to add the graph? #3

Closed
FravBox opened this issue Jan 25, 2022 · 9 comments
Closed

Any plans to add the graph? #3

FravBox opened this issue Jan 25, 2022 · 9 comments
Labels

Comments

@FravBox
Copy link

FravBox commented Jan 25, 2022

First of all thank you for making this. It's the only one I have found that will work on shared hosting. I am very appreciative 馃檹馃従

Are there any plans to add a way to share the graph view? There is another project called Pubsidian which has this, and there is also a wordpress plugin called Post Network to gather some ideas for implementation.

Thank you for considering.

@secure-77
Copy link
Owner

secure-77 commented Jan 27, 2022

Hey @FravBox,

i took a look at this but at the moment i麓am not sure how i can implement this in an easy / best way. At the end i need a JSON construct for building up the graph. I hoped that Obsidian itself stores this information (which file is linked to another file) in some file but at least i cant find this information in the vault (i checked the .obsidian folder). So maybe obsidian stores this information on another place or just build this in time.

To generate this JSON construct by itself (with PHP) seems to be a mess, because you need to search for every link to other links in the md. files and then follow this links, search again and so, this will end in a recursion process, which i dont want to do each time a md file is called / parsed.

So, i only see a few possibilities to solve this:

  1. find a way (if possible) to extract this information (who is linked to each other) from Obsidian
  2. only provide a graph for the file hierarchy and skip links between files --> but then the graph is more or less useless
  3. use a one time script / method to generate this JSON construct out of the files --> should be doable with python but then it would break / infect the idea behind the project to just host the vault "as it is", because you need a extra step to generate this graph every time you update your hosted vault.

So, if anybody has a good idea how i can better solve this, i would be glad to hear it. If i have some time i will take again a look at the Obsidian infrastructure, maybe i can find the linking information on some other place (point 1).

BR,
Sec77

@secure-77 secure-77 added the enhancement New feature or request label Jan 27, 2022
@FravBox
Copy link
Author

FravBox commented Jan 27, 2022

  1. use a one time script / method to generate this JSON construct out of the files --> should be doable with python but then it would break / infect the idea behind the project to just host the vault "as it is", because you need a extra step to generate this graph every time you update your hosted vault.

I think this may be a good compromise. You could go one step further and require a specific file be updated in order to update the graph? Alternatively, only update the graph when the count of md files in the root directory changes (one is added or removed)?

It's true it's not ideal, but I think the ability to share a slightly out-of-date graph with the public is preferred over no graph at all. Or at least it is to me, anyway.

But hopefully someone else could see this and have a better/easier solution.

Thanks again

@secure-77
Copy link
Owner

little update to this, i found a promising obsidian plugin, which can extract the file and link structure as json (https://github.com/kometenstaub/metadata-extractor)

with this, i think i found a way to automatically create the desired json file(s), so i only need to parse and display them in perlite. as soon i have some time for i will try to implement this.

@secure-77
Copy link
Owner

@FravBox good news, the implementation is almost done, just need some more adjustments and fixes because i also updated the theme, design and many other small things. But here are some preview images from my Notes :)

image

image

image

@secure-77
Copy link
Owner

secure-77 commented Feb 14, 2022

@FravBox new release is online where this is implemented, let me know what you think :)

@FravBox
Copy link
Author

FravBox commented Feb 14, 2022

I can't seem to get the graph to work on my end. Did a complete re-install of everything. I think it might just be something stupid I overlooked?

I went through the guide you've written in the readme. https://khat.us/obsidian/perlite/

edit: Looks like the plugin just isn't making a metadata.json file at all. Not sure why. The plugin is enabled and I have it set to write it every time obsidian opens.

edit2: OK I finally got the metadata.json, but still can't get the graph to work online.

@secure-77
Copy link
Owner

hey,
it seams that the php engine cant find your metadata.json because its under https://khat.us/obsidian/perlite/test/metadata.json and not in the root folder of your structure.

Please make sure the metadata.json resident in your root folder, in you case this should be the folder "Notes". You also need to "use" this top folder (Notes) as your obsidian vault to make sure the paths of the graph are correct and the graph can also be created for other folder like the folder "Demo".

Alternatively change in the helper.php the $rootDir to Notes/test. Then the Graph also should work.

BR,
Sec77

@secure-77 secure-77 reopened this Feb 14, 2022
@secure-77
Copy link
Owner

Hey @FravBox,

Since i haven麓t heard from you, I will close this issue. Please reopen this or create a new one if you need further help.

Thanks and BR,
Sec77

@FravBox
Copy link
Author

FravBox commented Mar 24, 2022

Hi! So sorry to not reply for so long. Life happened. 馃槀

Yes, it works now. Thank you so much.

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

No branches or pull requests

2 participants