1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Updated doc

This commit is contained in:
Laurent Cozic 2020-10-20 20:05:31 +01:00
parent 98bf3bde8d
commit 9f7ea7d865
2 changed files with 23 additions and 14 deletions

View File

@ -58,6 +58,8 @@ export default class JoplinPlugins {
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/CliClient/tests/support/plugins/content_script)
*
* @param type Defines how the script will be used. See the type definition for more information about each supported type.
* @param id A unique ID for the content script.
* @param scriptPath Must be a path relative to the plugin main script. For example, if your file content_script.js is next to your index.ts file, you would set `scriptPath` to `"./content_script.js`.
*/
async registerContentScript(type:ContentScriptType, id:string, scriptPath:string) {

View File

@ -322,16 +322,20 @@ export enum ContentScriptType {
* Registers a new Markdown-It plugin, which should follow this template:
*
* ```javascript
*
* // The module should export an object like below:
* // The module should export an object as below:
*
* module.exports = {
* default: {
*
* // The "context" variable is currently unused but could be used later on to provide
* // access to your own plugin so that the content script and plugin can communicate.
* default: function(context) {
* return {
*
* // This is the actual Markdown-It plugin - check the [official doc](https://github.com/markdown-it/markdown-it) for more information
* // The `options` parameter is of type [RuleOptions](https://github.com/laurent22/joplin/blob/dev/ReactNativeClient/lib/joplin-renderer/MdToHtml.ts), which
* // contains a number of options, mostly useful for Joplin's internal code.
* plugin: function(markdownIt, options) {
*
* // ...
* },
*
* // You may also specify additional assets such as JS or CSS that should be loaded in the rendered HTML document.
@ -340,6 +344,7 @@ export enum ContentScriptType {
* assets: {},
* }
* }
* }
* ```
*
* To include a regular Markdown-It plugin, that doesn't make use of any Joplin-specific feature, you
@ -347,10 +352,12 @@ export enum ContentScriptType {
*
* ```javascript
* module.exports = {
* default: {
* default: function(context) {
* return {
* plugin: require('markdown-it-toc-done-right');
* }
* }
* }
* ```
*/
MarkdownItPlugin = 'markdownItPlugin',