import { Plugin } from 'siyuan'; import {DATA_PATH, EMBED_PATH} from "@/const"; const drawIcon: string = ` `; export function loadIcons(p: Plugin) { const icons = drawIcon; p.addIcons(icons); } export function getMenuHTML(icon: string, text: string): string { return `
${text}
`; } export function generateSiyuanId() { const now = new Date(); const year = now.getFullYear().toString(); const month = (now.getMonth() + 1).toString().padStart(2, '0'); const day = now.getDate().toString().padStart(2, '0'); const hours = now.getHours().toString().padStart(2, '0'); const minutes = now.getMinutes().toString().padStart(2, '0'); const seconds = now.getSeconds().toString().padStart(2, '0'); const timestamp = `${year}${month}${day}${hours}${minutes}${seconds}`; const characters = 'abcdefghijklmnopqrstuvwxyz'; let random = ''; for (let i = 0; i < 7; i++) { random += characters.charAt(Math.floor(Math.random() * characters.length)); } return `${timestamp}-${random}`; } export function idToPath(id: string) { return DATA_PATH + '/' + id + '.svg'; } // [Edit](siyuan://plugins/siyuan-jsdraw-pluginwhiteboard/?icon=iconDraw&title=Drawing&data={"id":"${id}"}) // ![Drawing](assets/${id}.svg) export function getPreviewHTML(id: string): string { return ` ` }