Develop with Writer
How to use Writer functionality in your plugin
Getting started
Writer plugin gives you methods to use in your plugin to open articles in Writer application if it's mounted in the same workspace with your plugin, or open an article with the Naviga writer in a new tab.
Writer register it's own methods with Dashboard Actions
You can use any of these actions in your plugin.
Available actions
ID | Descriptions |
com.naviga.writer:openArticle | An action to handle open an article in Writer application with article uuid |
com.naviga.writer:get:article | An action type promise, it will resolve with opened article {url, uuid}, and rejects if Writer application is not mounted |
openArticle action
If your plugin is running beside Writer plugin in the same workspace openArticle action will open the requested article within Writer plugin by calling openArticle action with passing the article {uuid, url}
get:article action
If your plugin is running beside Writer plugin in the same workspace get:article action will return the opened article {uuid, url} by resolving a promise.
An example to how to open an article with Writer
In your plugin you can import useAction from Dashboard, so you can "import" Writer actions to your plugin.
Here we used com.naviga.writer:openArticle
action to open the article with given uuid === 838d42cf-507a-c701-f46d-6cd0a738cca4
If you called openArticle action while Writer plugin is not mounted, The requested article will open in a new tab with the Naviga Writer.
An example to how to get article from Writer
If you called get:article action while Writer plugin is not mounted, get:article action will reject the promise
Last updated