-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
FR: Update the file properties on load #24
Comments
We could even remove the
We may have a problem with the properties types. I'll take a look at this. |
I'm not sure if that is necessary to think about property types as this is all text. The only case where that might be an issue is when the api request fails or it returns some value that is unexpected. For example you expect to get a true/false to use as a boolean property but instead get "undefined" or "null". Similar function as is in the plugin for "notify-if" could be used to ensure that the values are as expected. |
Also I see that the feature has been added and I did some tests and it works really well 👍 Only one issue which I think is more with Obsidian than how the plugin works. When the api returns a list of ports as
It correctly creates the file properties as
But sadly Obsidian does not like a list of numbers being listed that plainly, it works great for text. To make it appear correctly it must appear as
When manually working with the properties in Obsidian it will automatically put " around numbers when used in lists. So maybe it is by design. |
A great enhancement to the properties feature would be allowing for writing the properties as internal links. For example this simple block queries the Shodan free InternetDB API for the file name which is an ip address and writes it as a property.
An enhancement could be implemented that would turn the ip property into an internal link (not sure if this would work from a coding perspective but some other indicator of it being an internal link would work as well)
The properties would then be as an internal link
|
I like this idea. I'll check what I can do 😄 |
Fantastic work. It works perfectly for single returns but not with list items, so for example when the show function returns a list, for example
|
I tested it with numerical lists and it worked. Didn't test it with strings (my bad). I'll have a look at it. |
Hey @elvarb, I found something and I'd like your opinion. For now My question is: should that limitation be removed? should |
The way the plugin works is that
Perhaps it would be good to have a dedicated
The use case I see with suppress is having the api request block at the top of the file that would just output into the file properties making it transparent. And another huge benefit of putting the values in the properties is that you can pull them into the markdown file by using for example the following:
|
Now I am even more lost haha. Regarding the |
But how would it work if you have a json file with a value you want to use in a property and the names are not the same. Lets say you have in the json something like "name" but you want to store that under the property "company" ? |
That would work. They don't need to have the same name. |
That means you have to use What could be changed to clarify the usage of |
I think it's not necessary to use |
I mean that you would use |
I'm not going to lie to you. I'm a little lost with what you're saying. Maybe I'm wrong but I think the way you describe things are the way they are working right now. |
Sorry about that, now with examples. The public InternetDB API shodan has for the ip 8.8.8.8 is called with
This returns the following json
Using it with Request API
Now we add properties as well
Now I want to only save the properties
Would be great to have the option of having no output at all as saving the value in the file properties and rendering them out from there inline gives much more flexibility.
|
Now I understand 😄. You are absolutely right, that's why you suggested adding the A small "problem" (to call it somehow) is that by not showing anything the literal code-block disappears and it is easy to forget that there is a code-block in the document (I say this from my own experience. I had a document full of code-blocks that didn't show anything and the only way I noticed it was when I activated source mode). Maybe I could add a counter (in the status bar) of code-blocks in the current document. Or what other idea do you have? |
Yes thats correct. Also would help when trying to walk through the json data in the show option, debug could then show both the raw json and the data you pull from it with show. That is a good point about everything being hidden, it is never good to have something like this completely invisible to the user. A counter in the status bar would be a good solution, especially if it can provide some more feedback to the user. Perhaps one small icon per code block and then have the icon color coded to indicate the results.
Would be awesome to have this as part of the plugin settings, both to enble/disable it and also to customize the colors as I think some would like to have it match the theme they are using. |
It's a good idea to implement colors for the answers. Although I don't know how easy it would be to add something like that. We've talked about so many things that I don't even know where to start haha. I'll see what I can do. |
Is your feature request related to a problem? Please describe.
I want to utilize Shodan to document what it knows about certain assets there and would like to utilize dataview and other properties tools to create the bigger picture.
Describe the solution you'd like
When an API Request block is triggered to update it should be able to update the file frontmatter with the values it returns the same way as you would format the output.
Describe alternatives you've considered
Other alternatives I have looked at is using Templater and javascript, but this plugin is a much better fit.
Additional context
Example code from the documentation
Could then be used like this as an example
The text was updated successfully, but these errors were encountered: