Returns
APIResponse<NoteTemplateInfo>:resultis the page template object. Fields: | Field | Type | Description | | --- | --- | --- | |name|string| Template name | |md5|string| MD5 for custom templates; system templates use0|
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get the template information of a note page.
static getNotePageTemplate(NOTEPath: string, page: number): Promise<APIResponse<NoteTemplateInfo>>;
| Parameter | Type | Description |
|---|---|---|
NOTEPath | string | NOTE file path |
page | number | Page index (starts from 0) |
APIResponse<NoteTemplateInfo>:
result is the page template object. Fields:
| Field | Type | Description |
| --- | --- | --- |
| name | string | Template name |
| md5 | string | MD5 for custom templates; system templates use 0 |import { PluginFileAPI } from 'sn-plugin-lib';
/**
* Example: get page template information.
*/
export async function exampleGetNotePageTemplate() {
const NOTEPath = '/storage/emulated/0/Note/demo.note';
const page = 1;
const res = await PluginFileAPI.getNotePageTemplate(NOTEPath, page);
if (!res.success) {
throw new Error(res.error?.message ?? 'getNotePageTemplate call failed');
}
return res.result;
}