Code Monkey home page Code Monkey logo

metaedit's People

Contributors

bevaz avatar chhoumann avatar hepabolu avatar jaerri avatar semantic-release-bot avatar theofbonin avatar zachatoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metaedit's Issues

Excalidraw file modified by MetaEdit while drawing causes loss of data

Please see this issue raised by @zhl111 for Excalidraw #296.

@zhl111 singled out MetaEdit as the root cause of the data loss by way of elimination... i.e. turning off plugins one-by-one until only MetaEdit was left.

I haven't done detailed testing, however, my assumptions are the following:

  • It seems that while editing an Excalidraw drawing somehow MetaEdit is triggered. This could be linked to Excalidraw autosave.
  • When MetaEdit is triggered, it probably modifies the excalidraw.md file, which in turn is interpreted by Excalidraw as a trigger to reload the drawing. Note, that I monitor background file changes to allow use-cases such as editing the same file side by side in markdown mode and in drawing mode, as well as to handle file sync events, such as when using Obsidian sync.

I recommend adding the following logic to onFileModify() (and potentially other relevant functions) avoid this issue:
if (app.workspace.activeLeaf.view.getViewType()==="excalidraw") return;

Edit existing values with Edit Meta right click menu

When using the Edit Meta right click menu, it seems to only be able to overwrite the field with a new value, "Enter a new value for fieldName", rather than editing.

When editing a field with the menu, could the input's content be populated with the current value, instead of putting it in a placeholder attribute? This would allow for quick editing instead of having to retype the whole value to use it to make edits, and wouldn't hinder the current purpose.

Allow Markdown formatting for inline fields like Dataview

Hi Christian, and thanks for your efforts into this extension !

As I explained in this dataview issue report, I'm leveraging Dataview's ability to allow Markdown formatting for inline fields.
My inline fields are surrounded with backticks, such as

`Key`:: Value

Using backticks makes the keys easy to distinguish from the rest of the text, plus it's easy to parse by third-party tools (mine, especially).

I'd greatly appreciate that you aligned your parser's abilities to Dataview's one, which would allow me to benefit from your extension !

In the linked issue report, there's a bunch of comments related to how Dataview parses inline fields, which may be useful for that purpose.

Cheers

Kanban helper function throws error

When I move a card from lane to lane, the 'status' property is correctly updated, but I get the following error 3x:

MetaEdit (ERROR) 'status not found in <name of kanbanboard>'

I've checked all notes linked from the kanban board but they all have a status property in the metadata section.
It sometimes happens when I switch the kanban board from kanban view to edit view to Markdown view and back to kanban view.
It's always 3x. I had 3 cards without links, but when I removed 1, the number of errors remained 3.

I've updated to the latest Obsidian version and Kanban and MetaEdit plugin.

FR: Add Description Column to "Auto Properties" List

I personally use MetaEdit to invoke several user-input prompts when creating a new "meta note" with templater. The metadata area has several blank variable values, and this plugin invokes the prompt to fill in each of the values. Would it be possible to add a third column next to "Name" and "Values", called "Description"? It would be nice to have further details under the "Name" (in the user popup) to know exactly what I am filling out, given that I may forget exactly what the template variable is asking for after several weeks.

Search for line with keyword, and add to property

For example if my file contain:

Lorem Ipsum is simply dummy text of the printing and typesetting industry.  *FMkey*

Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 

when an unknown printer took a galley of type and scrambled it to make a type specimen book.

 It has survived not only five centuries, but also the leap into electronic typesetting, r*FMkey*

emaining essentially unchanged. It was popularised in the 1960s with the rele

ase of Letraset sheets containing Lorem Ipsum passages, *FMkey*

and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

When i trigger the command, it will auto add all the line with FMkey to a designated property (ex: KEY)

I think the property name and the key can be define in setting.

Tags for statuses?

Not sure if you accept feature requests, but here we go...

Any plans to add support for changing tags for statuses instead of a YAML/dataview key? I prefer using tags for statuses to ease searching/creating dataviews.
for example, my files' statuses are indicated using the tag #my-status/new, #my-status/to-do, #my-status/done, etc

[FR] Nested values?

Unless I'm missing something there doesn't seem to be a way to see nested YAML entries in the frontmatter.

i.e.
mood:
m1:
m2:
m3:
m4:
m5:
(not sure how to show them formatted properly but imagine indentation on the nested values)

will only show the mood value in the metaedit menu.

Cannot adjust Kanban Board Helper

Second time this has happened, I create a new Kanban board, and try to link it to a YAML Metaedit field, but when I try to click on the gear icon beside the Kanban Board Helper, nothing happens. At this stage, Kanban linked metadata changes no longer work either. Tried closing app, toggling enable/disable, restarting computer. Only seems to be solved by uninstalling entirely.

Add License

@chhoumann, your plugin has some awesome functions for interacting with the frontmatter that I would like to leverage in one of my plugins. Would you be willing to add a license to your repo so I can do so?

Thank you!

FR: auto-save new values to auto load

Loving this plug-in. Bravo!

Was thinking it would be pretty great if there were an option to save newly added values to auto-load without having to go into settings. Is that something you have planned for future updates?

BUG: Commands aren't generated on Mobile

I'm using exactly the same configuration in Desktop and Mobile, but for some strange reason the commands to the cycle properties that I have setted just doesn't work. help, please.

neewb: can one use meta edit to quick add tags?

Hi!

im not super technical (an academic) and very new to obsidian in general

after exploring obsidian for a few days i moved all my notes there and added my tags in proper YAML format ie:

---
tags: [ american,  bread]
priority: TODO
rating: 0
---

can one one use meta edit to quick add tags? ie quickly add used tags like American without having to type the whole word?
or am i missing the purpose of the plugin completely :)

thx so much !

Z

Dataview properties loose a colon

When using update and a property is defined in both yaml and as a dataview property, the dataview property looses one of the colons, thusly:

someProperty:: somevalue

the two colons become one, like this:

someProperty: someValue

Expected behaviour:
Keep the two colons.

Tested with three colons, they are also reduced to one.
If only dataview property is present, and no corresponding yaml propety is specified, everything works as expected.

[Bug] strange persistent box appears on mobile

It appears with the use of the plug-in and persists in blocking off the mobile toolbar until I restart the app.
E02CD9DE-F2A0-4494-A22C-D4DE5ADACE73

I turned off all other plug-ins and used default theme but the problem is still there.
480EF2B4-0E18-42F6-AC40-2F66139E02C4

D003DF27-4DF2-40FB-A2CC-9AA4F4A85277

I'm using an iPhone 12 Pro, software version 15.3.1.

Kanban helper function not working

I created a kanban board today in which all the lane names are the status indicators I've been using in the YAML for my blog posts (e.g. idea, braindump, mindmap, drafts, etc). I would really love the status of each linked note to update automatically when I move its card to a new lane, but for some reason I can't get it to work.

I thought at first it might be an issue with the linked notes existing before they were linked to kanban cards, but I tried making a test card and then a note from that card with status metadata, and it still didn't work.

Here's my settings for kanban helper:
screenshot_113

And here's an example of my metadata for a note in the kanban board in question:
screenshot_114

Update Subproperty

Is there a way to update a yaml subproperty via something like update("metadata.description", "test", "๐Ÿ“‚ nonhierarchical/Untitled.md") ? If not, could this be added?

Example yaml

---
metadata:
    aliases     : []
    datetime    : { created     : 2021-07-22T17:30:05-04:00 }
    description : 
    scope       : personal
    status      : { reviewed    : false }
    tags        : [NOTE/OBJECT]
    title       : Untitled
    type        : 
    uuid        : 1bd559d1-2d3d-4416-9109-082f5ebb03e6
source  :
    template: "[[๐Ÿ“ templates/๐Ÿ“„ new uri ๐Ÿ”—.md]]"
    version : 1626988597970
uri     : 
    label   : 
    data    : scheme://www.example.null
    type    : bookmark

---

Add option to eliminate duplicates when adding value to "multi" properties.

Hi,
I am new to using this plugin.
I've noticed when appending a value to a yaml property of type multi (array of values) it actually keeps duplicates.
It would be so nice if this is not the case and we can configure it to filter duplicate values out.
It will be especially useful when the plugin is used from a script.

[feature request] line break separated field for known values

Wondering if it would be possible to add the functionality to allow a line-break separated (or even comma separated, for that matter) list of known values to be inserted as known values for certain properties.

I have some known values with many, many values, so it would be nice to be able to copy and paste everything into one field rather than having to add a line every time I want to add a known value.

Thanks for this wonderful plugin!

Squar Brackets

I don't know if this is an issue or just me not understanding it correctly :

I have a dataview inline field like "[number:: 3]" and in a javascript view i am trying to increment the value by 1

I am using this code :

if (tag_type == "inline") {
  let value = await getPropertyValue(tag_name, note.file.path);
  console.log(value)
  value = value + amount;
  console.log(value)
  await update(tag_name, value, note.file.path);
}

If the field is written without any bracket like "number:: 3" it works,
if i have it written like "[number:: 3]" it doesn't.

I think it is related to how the graphical tool is displaying the values
image
It seams like is reading the opening bracket in the key and the closing in the value
image

Expand API

I love the API, it's super useful in speeding up plugin development and keeping my code nice and tidy, while I let you do the hard work. ๐Ÿ˜‰

However, there are a few gaps I think could be filled in the public API:

  • deleteProperty - this would be nice to have along with add/update
  • isYamlEmpty or removeYamlIfEmpty - this would be great to have to remove the frontmatter block entirely if the last property is removed
  • addOrUpdateProperty - This certainly isn't hard to do with the add and update methods but I feel like this is common enough that it might make sense to have it as part of the public api

These are all methods I've ended up needing to create myself (or just copy from your source ๐Ÿ˜ฌ).

Multi-value Property format

Thank you for your plugin. I really like it.
Could you also please let the user choose between 2 type of format:

Property1: [value1, value2, value3]

Currently, this upper one is default. However, could you please kindly allow user to choose if they want to use the below format also?

Property1:
 - "value 1"
 - "value 2"

Expose create property in API

Really interesting tool. I'm currently trying to add a property to my files where they don't exist and update where it does. The update works great but unfortunately I can't find anything for creating a property. Is there any way of exposing this functionality in the API?

More than one entry at a time?

I'd like to see a hotkey to "add another" so that when you finish with one, it reopens the list and you can pick another. Say, if you "shift enter" or the like, it lets you fill another one out. thank you. I appreciate this. I use this with the "Button" on top of my daily log to make input easier.

Publish API as npm package

I love the power of your underlying api, because there are no tools to edit the frontmatter by Obsidian itself. I simply want to add a field, but I don't want to reinvent the wheel. I know a plugin can access your api, but the therefore your plugin must be installed. If you could publish the core api as a npm package, it would help many other developers to interact with the frontmatter without the need of the installing of other plugins.
As an example, there is an api to interact with daily notes by liamcain: https://github.com/liamcain/obsidian-daily-notes-interface

Update a single value in a property with multiple values

I'm trying to update the second value of a propery. (2nd being the status)

tags:
  - ๐Ÿ“ฅ/๐Ÿ“˜
  - ๐Ÿ—ƒ๏ธ/๐Ÿ”ท/๐Ÿ”ด

I'm reading everywhere from last year, that such functionality could be added, but I can't find if it actually has been done.
Is there method, or at least a workaround?

automatic getActiveFile().path

Hi! I keep having to reference this, and the reference isn't on the README either, so I thought I'd make a request.

Could you add (as default) for MetaEdit to use the currently active file? Or if not default, some way to specify this without having to explicitly do this? For awhile, I was using MetaEdit via templater and dataview. But there are certain circumstances where this isn't optimal... for instance, when I pass a relative date string via frontmatter to dataview, dataview turns it into a Duration object, with no reference to the original string. So I end up having to not use either of these, and instead get the path myself.

But really shouldn't need to do this either since imo this should be implied, or if not, at the very least easy to do.

Anyways, I have 3 ways of getting this now, which really could be consolidated into 1, but I keep forgetting the code to do it, so have 3 versions of basically the same thing:

Using Templater

const { api } = this.app.plugins.plugins.metaedit
const currentFilePath = tp.config.target_file
const startDate = await api.getPropertyValue("startDate", currentFilePath)

Using Dataview

...
const currentFilePath = dv.current().file.link.path
...

Using window.app

...
const currentFilepath = window.app.workspace.getActiveFile().path
`...`

Preferably instead:

const { api } = this.app.plugins.plugins.metaedit
const startDate = await api.getPropertyValue("startDate")

or

...
const startDate = await api.getPropertyValue("startDate", api.activeFile)

or even

...
const startDate = await api.getPropertyValue("startDate", "activeFile")

Couple UX improvements

I'm using metaedit to create or change values with easy, but when I have several values it becomes a bit tense.
The reasons why this happens:

1. Entering values
After I select a value in the list with the enter key, I have to press enter key again to confirm the entry. When there are 5-6 keys, it becomes difficult, also there are no placeholders. The process can be brought to the state as implemented in templater.

2. Quick value selection
It would be nice to have a hotkey to change the value, which is on the same line as the mouse pointer. Thus in one key combination, selection, and one click enter, you can quickly make changes.

Please make a tutorials for kanban helper #documentation

It will be wonderful if you would like to make a tutorial for kanban helper. I tried for a few days to get it to work, but I am too noob. A few pictures or a GIF or a video can help a lot. Thank you for all your works again.

Add #obsidian-plugin topic to this repository #48

Hey @chhoumann, the developer of the Buttons plugin pointed me to MetaEdit when I was looking for a plugin for something to do some quick frontmatter CRUD actions. I haven't yet tried your plugin, but it looks like something I may make use of.

I wanted to suggest that you add the topic of obsidian-plugin to this repository to help others find it. I've been making use of #obsidian-plugin to see what's available, and I imagine others are, as well.

don't duplicate properties inside folders

When adding a new property which already exists inside the Frontmatter using the new folder manipulation currently the plugin adds a duplicate.

---
tags: [tag]
...
tags:
- tag1
- tag2
---

It would be nice if the plugin adds/overwrite instead of creating a duplicate.

  • adds to the existing array if property is array
  • asks for confirmation before overwriting if property is single.

[Bug] Console error generated each time a note is modified

When MetaEdit plugin is activated, console shows the following error each time a note is modified :

Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at OnFileModifyAutomatorManager.onFileModify (eval at <anonymous> (app.js:1), <anonymous>:5266:29)

I have not encountered any problem linked to this error message, but I would like to know the cause and possibly get rid of it.

Thanks !

inline tags editing is broken?

In the latest version of MetaEdit (v1.5.2 with hotfix), it seems like inline tags editing is broken

Steps to reproduce:

Just create a file with this content:

#test-tag/hiya

And then try to edit it with MetaEdit. After pressing enter, nothing happens.

MetaEdit will not change metadata of kanban note.

When the note that is created is stored in a folder, changing the column that the card is in will not update the metadata. From my testing, it needs to be in the root for metaedit to update the kanban card's metadata.

works great apart from the `tags` YAML front matter, can we get a list of tags and add multiple tags?

Hi, as with quick add this is a killer plugin @chhoumann!

i use it alot with several fields that have a 1-5 value scale. one area i struggle with is how to work with metaedit and tags

on the one hand it dosent seem to read the internal tags from obsidian only the current tags in the actual file (in the YAML format):

tags: [ cookingQ, chicken, asia ]

Also even though i define in the config to have tags as some-multi, it dosent seem to let me add more then 1 tag..

any advice on how to work with tags and meta edit?

thx!

Z

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.