-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Add PLUGIN_SECTIONID env variable #1519
Comments
The page ID should be an attribute of the top level Page element, attribute name "ID". For the section ID, here's a proposed solution: There are a number of PLUGIN env variables your plugin can use, see the bottom of this OneMore Wiki page. It would be quite easy to add a PLUGIN_SECTIONID env variable when you run a page-scoped plugin. |
Environment variables would be great, yeah. I came across another use-case: modifying highlighted text, or otherwise accessing the caret position. With this, I could bind hotkeys to create linked tasks in my chosen ToDo app. (my Outlook is broken so I can't use the sync w/MS ToDo) I could highlight a line of text, hit a hotkey, and my plugin creates a ToDo task from the highlighted text, creating a bidirectional link between the ToDo and the text. If I limit myself to focusing on a page's title, then I can setup a link between title and ToDo, since that doesn't require knowing caret position or selection. EDIT nevermind, plugins do get the current selection! https://onemoreaddin.com/developers/TechNote%20-%20Editing%20Text.htm |
Could you add the Page ID to the environment variables as well, then for a lot of plugins, you might not need to parse the page at all? |
Environment variables will include • PLUGIN_ASCHILD - set to true when the Create as child option is checked |
Section Groups - do they change the hierarchy of the path? |
Yes, section groups are part of the path. Regarding skipLock, if a section is password-protected, the Plugin has no means to ask for a password and unlock it. So either it attempts to open it and will fail, or you specify Skip and it won't even try. |
How can I help you?
Today I hit a situation that I thought would be the perfect use-case for a plugin. Unfortunately, I hit some limitations of the current plugin implementation. This is understandable because it's experimental, and trying to support all possible use-cases is surely not a reasonable goal. However, I thought I'd share my use-case in case it inspires additional plugin features.
Use-case
Bind a hotkey to copy a markdown-formatted link to the current page or paragraph, for pasting into other apps which don't auto-detect that
onenote:
is a clickable link:Details
I use a to-do app that supports markdown hyperlinks. It doesn't automatically render
onenote:
links, but if I wrap them up in markdown[label](url)
syntax, they render correctly. This lets me create ToDos with clickable links to associated OneNote pages.Another benefit of markdown syntax: I can embed the page's title, which is good because the ToDo app has no way of fetching the URL's title from the web.
Plugin limitations
Unfortunately, when I tried to implement this as a plugin, I hit a couple issues.
The text was updated successfully, but these errors were encountered: