update
This commit is contained in:
48
.obsidian/plugins/break-page/main.js
vendored
Normal file
48
.obsidian/plugins/break-page/main.js
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
if you want to view the source, please visit the github repository of this plugin
|
||||
*/
|
||||
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// main.ts
|
||||
var main_exports = {};
|
||||
__export(main_exports, {
|
||||
default: () => ExamplePlugin
|
||||
});
|
||||
module.exports = __toCommonJS(main_exports);
|
||||
var import_obsidian = require("obsidian");
|
||||
var ExamplePlugin = class extends import_obsidian.Plugin {
|
||||
onload() {
|
||||
this.addCommand({
|
||||
id: "insert-break-page",
|
||||
name: "Insert break page",
|
||||
hotkeys: [],
|
||||
editorCallback: (editor) => {
|
||||
const currentPosition = editor.getCursor();
|
||||
editor.replaceRange(
|
||||
'<div class="page-break" style="page-break-before: always;"></div>\n',
|
||||
currentPosition
|
||||
);
|
||||
editor.setCursor(editor.getCursor().line + 1, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6I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