@frontmatter/extensibility
Advanced tools
Comparing version 0.0.14 to 0.0.15-beta.8341811
@@ -9,2 +9,7 @@ import { Question } from "../models/Question.js"; | ||
/** | ||
* Opens a file or page once the script has finished. | ||
* @param fileOrPagePath - The path of the file or page to open. | ||
*/ | ||
static open(fileOrPagePath: string): void; | ||
/** | ||
* Call this method to indicate that the script has finished. | ||
@@ -11,0 +16,0 @@ * @param log |
@@ -12,2 +12,12 @@ export class CustomScript { | ||
/** | ||
* Opens a file or page once the script has finished. | ||
* @param fileOrPagePath - The path of the file or page to open. | ||
*/ | ||
static open(fileOrPagePath) { | ||
JSON.stringify({ | ||
fmAction: "open", | ||
fmPath: fileOrPagePath, | ||
}); | ||
} | ||
/** | ||
* Call this method to indicate that the script has finished. | ||
@@ -14,0 +24,0 @@ * @param log |
{ | ||
"name": "@frontmatter/extensibility", | ||
"version": "0.0.14", | ||
"version": "0.0.15-beta.8341811", | ||
"description": "Front Matter CMS extensibility library", | ||
@@ -38,2 +38,2 @@ "type": "module", | ||
} | ||
} | ||
} |
@@ -61,3 +61,2 @@ <p align="center"> | ||
> **Important**: Front Matter will execute the same script, so you first need to check if the answers were provided. | ||
@@ -81,2 +80,10 @@ | ||
#### Open a file or page on completion | ||
To let the CMS know you want to open a file or page after the script is done, you can make use of the `open` method: | ||
```js | ||
ContentScript.open("https://frontmatter.codes"); | ||
``` | ||
#### Done | ||
@@ -83,0 +90,0 @@ |
@@ -17,2 +17,13 @@ import { Question } from "../models/Question.js"; | ||
/** | ||
* Opens a file or page once the script has finished. | ||
* @param fileOrPagePath - The path of the file or page to open. | ||
*/ | ||
public static open(fileOrPagePath: string): void { | ||
JSON.stringify({ | ||
fmAction: "open", | ||
fmPath: fileOrPagePath, | ||
}); | ||
} | ||
/** | ||
* Call this method to indicate that the script has finished. | ||
@@ -19,0 +30,0 @@ * @param log |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40289
754
348