Import data json below to dynamic highlight config.
{
"light-time-8-5": {
"class": "light-time-8-5",
"color": "#E45858",
"regex": true,
"query": "(?<=\\s)(0?8|20):[3-5][0-9](:[0-5][0-9])?(?=(\\s|$))",
"mark": [| def load_pb(path_to_pb): | |
| with tf.gfile.GFile(path_to_pb, "rb") as f: | |
| graph_def = tf.GraphDef() | |
| graph_def.ParseFromString(f.read()) | |
| with tf.Graph().as_default() as graph: | |
| tf.import_graph_def(graph_def, name='') | |
| return graph | |
| #你可以检索感兴趣的张量 | |
| input = graph.get_tensor_by_name('input:0') |
| import tensorflow as tf | |
| import numpy as np | |
| from PIL import Image | |
| FILEPATH = path_to_img # 检测文件地址 | |
| MODELPATH = path_to_pb_file # pb文件 | |
| SIZE = [100, 100] # 检测图片规格 | |
| DIC = {0: 'aaa', 1: 'bbb'} # 定义字典,保存标签和类别的映射关系 | |
| # 图片转化为数组 |
| export default class mapForNotePlugin extends Plugin { | |
| //... | |
| public activeMapForNoteView: MapForNote = null; | |
| async onload(): Promise<void> { | |
| //... | |
| this.registerEventListeners(); | |
| } | |
| //... |
Import data json below to dynamic highlight config.
{
"light-time-8-5": {
"class": "light-time-8-5",
"color": "#E45858",
"regex": true,
"query": "(?<=\\s)(0?8|20):[3-5][0-9](:[0-5][0-9])?(?=(\\s|$))",
"mark": [| // Version 0.0.1 | |
| module.exports = askChatWithPrompt; | |
| function askChat(str, app) { | |
| const prompt = encodeURI(str); | |
| const chatViewEl = app.workspace.getLeavesOfType("surfing-view").find((item)=>{ return /chat\.openai\.com/.test(item?.view?.currentUrl)}).view.webviewEl; | |
| chatViewEl.executeJavaScript(` | |
| var htmlElement = document.querySelector("textarea"); | |
| htmlElement.value = decodeURI("${ prompt }"); |
| module.exports = {"Copy Chat History": copyChatWithHistory, "Copy Last Answer": copyLastAnswer}; | |
| const ExportMD = (function () { | |
| if (!window.TurndownService) return; | |
| const hljsREG = /^.*(hljs).*(language-[a-z0-9]+).*$/i; | |
| const turndownService = new window.TurndownService({ | |
| headingStyle: "atx", | |
| hr: "---", | |
| bulletListMarker: "-", | |
| codeBlockStyle: "fenced", |
| "use client" | |
| import * as React from "react" | |
| import { buttonVariants } from "@/components/ui/button" | |
| import { ScrollArea } from "@/components/ui/scroll-area" | |
| import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" | |
| import { cn } from "@/lib/utils" | |
| import { ChevronLeft, ChevronRight } from "lucide-react" | |
| import { DayPicker, DropdownProps } from "react-day-picker" |
| export default class ExamplePlugin extends Plugin { | |
| async onload() { | |
| this.registerExtensions(["epub"], "epub"); | |
| this.registerView("epub", (leaf) => new EpubView(leaf)); | |
| } | |
| onunload() { | |
| } | |
| } |
| /* attempt to better vertically align block embeds in lists */ | |
| :is(.HyperMD-list-line, .markdown-rendered :is(ol, ul)) .inline-embed[src*="#^"]:has(.markdown-preview-section > div > ul:only-child) { | |
| margin-left: 0px; | |
| border-left: 0px; | |
| padding-left: 0px; | |
| & > .embed-title { | |
| display: none; | |
| } |
| // Interface defining the options for showing content | |
| interface ShowContentOptions { | |
| start: number; // Starting position of the content | |
| end: number; // Ending position of the content | |
| content: string; // The full content string | |
| view: MyView; // The view object | |
| file: TFile; // The file object | |
| plugin: MyPlugin; // The plugin instance | |
| } |