If you open the context menu while the cursor is on a heading, there’s an option to “Rename heading”, which has the benefit of updating links to that heading. Is there a way to access that functionality via API?
I think it’s not officially available, but you can find out what’s happening there by searching app.js by renameHeading. It might be possible to access the underlying mechanism from your plugin by monkey-patching.
But as for heading numbering, I would take another approach that doesn’t hard-code them directly into notes: heading numbers can be computed/derived from the note content and can be displayed without actually modifying it.
I wonder if we could finally build a rename heading plugin, something that displays a little clickable item beside the headings and lets you use that (and act as a reminder) instead of the right click menu.
For anyone who isn’t familiar with the purpose of the rename heading option, it’s so that links to it get updated. Otherwise links and embeddings in other notes fail.
It’s a big problem and honestly the right click menu option is not prominent or accessible enough for something so important and frequently used
Does anyone know how to make some kind of clickable button with this command appear at the end of or somewhere near headings?
@Yurcee To avoid any misunderstanding, let me explain further. Any right-click menu operation will cause the v1.7.4 editing popover to disappear. You don’t need to install any plugins; you can test this in the Sandbox Vault. Some people who have installed my plugin might think it is causing this issue, but that’s not the case. Similarly, this behavior has nothing to do with the API itself; it is a feature of the new version of the v1.7.4 editing popover.