vault backup: 2023-07-22 12:53:43
Affected files: .obsidian/community-plugins.json .obsidian/hotkeys.json .obsidian/plugins/obsidian-hider/data.json .obsidian/plugins/obsidian-rtl/data.json .obsidian/plugins/obsidian-rtl/main.js .obsidian/plugins/obsidian-rtl/manifest.json .obsidian/plugins/obsidian-rtl/styles.css .obsidian/workspace.json Gen.28.10-19.md Rom.8.12-25.md images/2023-07-23.Gen.28.10-19.png
This commit is contained in:
parent
cf55875547
commit
1ccd3fa739
|
@ -5,6 +5,5 @@
|
|||
"obsidian-footnotes",
|
||||
"obsidian-tidy-footnotes",
|
||||
"cm-show-whitespace-obsidian",
|
||||
"control-characters",
|
||||
"obsidian-rtl"
|
||||
"control-characters"
|
||||
]
|
|
@ -208,5 +208,14 @@
|
|||
],
|
||||
"key": "T"
|
||||
}
|
||||
],
|
||||
"obsidian-rtl:switch-text-direction": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt",
|
||||
"Mod"
|
||||
],
|
||||
"key": "R"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"hideRibbon": false,
|
||||
"hideRibbon": true,
|
||||
"hideStatus": false,
|
||||
"hideTabs": true,
|
||||
"hideTabs": false,
|
||||
"hideScroll": false,
|
||||
"hideSidebarButtons": false,
|
||||
"hideTooltips": false,
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"fileDirections": {
|
||||
"Gen.28.10-19.md": "auto"
|
||||
},
|
||||
"defaultDirection": "ltr",
|
||||
"rememberPerFile": true,
|
||||
"setNoteTitleDirection": true,
|
||||
"setYamlDirection": false,
|
||||
"statusBar": true
|
||||
}
|
|
@ -1,686 +0,0 @@
|
|||
/*
|
||||
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: () => RtlPlugin
|
||||
});
|
||||
module.exports = __toCommonJS(main_exports);
|
||||
var import_obsidian3 = require("obsidian");
|
||||
|
||||
// AutoDirPlugin.ts
|
||||
var import_view = require("@codemirror/view");
|
||||
var import_state = require("@codemirror/state");
|
||||
|
||||
// globals.ts
|
||||
var RTL_CLASS = "is-rtl";
|
||||
var AUTO_CLASS = "is-auto";
|
||||
var STRONG_DIR_REGEX = /(?:([\p{sc=Arabic}\p{sc=Hebrew}\p{sc=Syriac}\p{sc=Thaana}])|([\p{sc=Armenian}\p{sc=Bengali}\p{sc=Bopomofo}\p{sc=Braille}\p{sc=Buhid}\p{sc=Canadian_Aboriginal}\p{sc=Cherokee}\p{sc=Cyrillic}\p{sc=Devanagari}\p{sc=Ethiopic}\p{sc=Georgian}\p{sc=Greek}\p{sc=Gujarati}\p{sc=Gurmukhi}\p{sc=Han}\p{sc=Hangul}\p{sc=Hanunoo}\p{sc=Hiragana}\p{sc=Inherited}\p{sc=Kannada}\p{sc=Katakana}\p{sc=Khmer}\p{sc=Lao}\p{sc=Latin}\p{sc=Limbu}\p{sc=Malayalam}\p{sc=Mongolian}\p{sc=Myanmar}\p{sc=Ogham}\p{sc=Oriya}\p{sc=Runic}\p{sc=Sinhala}\p{sc=Tagalog}\p{sc=Tagbanwa}\p{sc=Tamil}\p{sc=Telugu}\p{sc=Thai}\p{sc=Tibetan}\p{sc=Yi}]))/u;
|
||||
var detectDirection = (s) => {
|
||||
const match = s.match(STRONG_DIR_REGEX);
|
||||
if (match && match[1]) {
|
||||
return "rtl";
|
||||
} else if (match && match[2]) {
|
||||
return "ltr";
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
// AutoDirPlugin.ts
|
||||
var import_obsidian = require("obsidian");
|
||||
function getAutoDirectionPlugin(rtlPlugin) {
|
||||
return import_view.ViewPlugin.fromClass(class {
|
||||
constructor(view) {
|
||||
this.decorationRegions = [];
|
||||
this.active = false;
|
||||
this.rtlDec = import_view.Decoration.line({
|
||||
attributes: { dir: "rtl" }
|
||||
});
|
||||
this.ltrDec = import_view.Decoration.line({
|
||||
attributes: { dir: "ltr" }
|
||||
});
|
||||
this.emptyDirDec = import_view.Decoration.line({
|
||||
attributes: { dir: "" }
|
||||
});
|
||||
this.autoDec = import_view.Decoration.line({
|
||||
attributes: { dir: "auto" }
|
||||
});
|
||||
this.decorations = this.buildDecorations();
|
||||
this.rtlPlugin = rtlPlugin;
|
||||
this.view = view;
|
||||
const editorInfo = this.view.state.field(import_obsidian.editorInfoField);
|
||||
if (editorInfo instanceof import_obsidian.MarkdownView) {
|
||||
this.rtlPlugin.adjustDirectionToView(editorInfo, this);
|
||||
}
|
||||
this.rtlPlugin.handleIframeEditor(this.view.dom, this.view, editorInfo.file, this);
|
||||
}
|
||||
update(vu) {
|
||||
if (vu.viewportChanged || vu.docChanged) {
|
||||
const regions = [];
|
||||
if (vu.docChanged) {
|
||||
vu.changes.iterChanges((fromA, toA, fromB, toB) => {
|
||||
const shift = toB - fromB - (toA - fromA);
|
||||
this.shiftDecorationRegions(shift < 0 ? toB : toA, shift);
|
||||
regions.push(...this.getLineRegions(vu.state.doc, fromB, toB));
|
||||
});
|
||||
}
|
||||
this.updateEx(vu.view, regions);
|
||||
}
|
||||
}
|
||||
destroy() {
|
||||
}
|
||||
setActive(active, view) {
|
||||
const forceUpdate = this.active !== active;
|
||||
this.active = active;
|
||||
this.decorations = this.buildDecorations();
|
||||
if (forceUpdate) {
|
||||
this.updateEx(view);
|
||||
}
|
||||
}
|
||||
updateEx(view, regions = []) {
|
||||
if (regions.length === 0) {
|
||||
const { from, to } = view.viewport;
|
||||
regions = this.getLineRegions(view.state.doc, from, to);
|
||||
}
|
||||
for (const { from, to } of regions) {
|
||||
for (let pos = from; pos <= to; ) {
|
||||
const line = view.state.doc.lineAt(pos);
|
||||
let dec = this.emptyDirDec;
|
||||
if (this.active) {
|
||||
const s = view.state.doc.sliceString(line.from, line.to);
|
||||
const d = this.detectDecoration(s);
|
||||
dec = d ? d : this.lineBeforeDecoration(line.from);
|
||||
}
|
||||
this.addDecorationRegion({ from: line.from, to: line.to, dec });
|
||||
pos = line.to + 1;
|
||||
}
|
||||
}
|
||||
this.decorations = this.buildDecorations();
|
||||
}
|
||||
buildDecorations() {
|
||||
const builder = new import_state.RangeSetBuilder();
|
||||
for (const dr of this.decorationRegions) {
|
||||
builder.add(dr.from, dr.from, dr.dec);
|
||||
}
|
||||
return builder.finish();
|
||||
}
|
||||
addDecorationRegion(dr) {
|
||||
for (let i = 0; i < this.decorationRegions.length; i++) {
|
||||
if (this.decorationRegions[i].from < dr.from) {
|
||||
continue;
|
||||
}
|
||||
if (this.decorationRegions[i].from === dr.from) {
|
||||
this.decorationRegions[i] = dr;
|
||||
} else if (this.decorationRegions[i].from > dr.from) {
|
||||
this.decorationRegions.splice(i, 0, dr);
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.decorationRegions.push(dr);
|
||||
}
|
||||
shiftDecorationRegions(from, amount) {
|
||||
if (amount === 0) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.decorationRegions.length; i++) {
|
||||
if (this.decorationRegions[i].from < from) {
|
||||
continue;
|
||||
}
|
||||
this.decorationRegions[i].from += amount;
|
||||
this.decorationRegions[i].to += amount;
|
||||
if (this.decorationRegions[i].from <= from) {
|
||||
this.decorationRegions.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
detectDecoration(s) {
|
||||
const direction = detectDirection(s.replace("- [x]", ""));
|
||||
switch (direction) {
|
||||
case "rtl":
|
||||
return this.rtlDec;
|
||||
case "ltr":
|
||||
return this.ltrDec;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
lineBeforeDecoration(from, def = this.ltrDec) {
|
||||
const l = this.decorationRegions.length;
|
||||
if (l !== 0 && from > this.decorationRegions[l - 1].from) {
|
||||
return this.decorationRegions[l - 1].dec;
|
||||
}
|
||||
for (let i = 0; i < l; i++) {
|
||||
if (i !== 0 && this.decorationRegions[i].from >= from) {
|
||||
return this.decorationRegions[i - 1].dec;
|
||||
}
|
||||
}
|
||||
return def;
|
||||
}
|
||||
getLineRegions(doc, from, to) {
|
||||
const regions = [];
|
||||
for (let i = from; i <= to; i++) {
|
||||
const l = doc.lineAt(i);
|
||||
i = l.to;
|
||||
regions.push({ from: l.from, to: l.to });
|
||||
}
|
||||
return regions;
|
||||
}
|
||||
}, { decorations: (v) => v.decorations });
|
||||
}
|
||||
|
||||
// AutoDirPostProcessor.ts
|
||||
var lastDetectedDir = "ltr";
|
||||
var specialNodes = ["A", "STRONG", "EM", "DEL", "CODE"];
|
||||
function breaksToDivs(el) {
|
||||
if (!el)
|
||||
return;
|
||||
if (el.tagName == "P") {
|
||||
const splitText = el.innerHTML.split("<br>");
|
||||
if (splitText.length > 1) {
|
||||
let newInnerHtml = "";
|
||||
splitText.map((line) => {
|
||||
newInnerHtml += `<div class="esm-split">${line}</div>
|
||||
`;
|
||||
});
|
||||
el.innerHTML = newInnerHtml;
|
||||
}
|
||||
}
|
||||
if (el.children && el.children.length > 0) {
|
||||
for (let i = 0; i < el.children.length; i++)
|
||||
breaksToDivs(el.children[i]);
|
||||
}
|
||||
}
|
||||
function detectCanvasElement(el, ctx, setPreviewDirection) {
|
||||
const container = ctx.containerEl;
|
||||
if (container && container.closest) {
|
||||
const possibleCanvas = container.closest(".canvas-node-content");
|
||||
if (possibleCanvas) {
|
||||
const markdownPreview = container.closest(".markdown-preview-view");
|
||||
if (markdownPreview && markdownPreview instanceof HTMLDivElement) {
|
||||
setPreviewDirection(ctx.sourcePath, markdownPreview);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var autoDirectionPostProcessor = (el, ctx, setPreviewDirection) => {
|
||||
let shouldAddDir = false, addedDir = false;
|
||||
const childNodes = [];
|
||||
detectCanvasElement(el, ctx, setPreviewDirection);
|
||||
breaksToDivs(el);
|
||||
for (let i = 0; i < el.childNodes.length; i++) {
|
||||
const n = el.childNodes[i];
|
||||
if (!addedDir && n.nodeName === "#text" && n.nodeValue && n.nodeValue !== "\n") {
|
||||
const dir = detectDirection(n.nodeValue);
|
||||
if (dir) {
|
||||
addedDir = true;
|
||||
lastDetectedDir = dir;
|
||||
if (specialNodes.contains(el.nodeName) && el.parentElement) {
|
||||
addDirClassIfNotAddedBefore(el.parentElement, dirClass(dir));
|
||||
} else {
|
||||
el.addClass(dirClass(dir));
|
||||
if (el.parentElement && el.parentElement.nodeName === "LI") {
|
||||
addDirClassIfNotAddedBefore(el.parentElement, dirClass(dir));
|
||||
}
|
||||
}
|
||||
}
|
||||
shouldAddDir = true;
|
||||
continue;
|
||||
}
|
||||
childNodes.push(n);
|
||||
if (i === el.childNodes.length - 1 && shouldAddDir && !addedDir) {
|
||||
el.addClass(dirClass(lastDetectedDir));
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < childNodes.length; i++) {
|
||||
autoDirectionPostProcessor(childNodes[i], ctx, setPreviewDirection);
|
||||
}
|
||||
if (el.nodeName === "UL") {
|
||||
const lis = el.querySelectorAll("li");
|
||||
if (lis.length > 0 && lis[0].hasClass("esm-rtl")) {
|
||||
el.addClass(dirClass("rtl"));
|
||||
}
|
||||
}
|
||||
};
|
||||
function dirClass(dir) {
|
||||
if (dir === "rtl") {
|
||||
return "esm-rtl";
|
||||
} else {
|
||||
return "esm-ltr";
|
||||
}
|
||||
}
|
||||
function addDirClassIfNotAddedBefore(el, cls) {
|
||||
if (el.hasClass("esm-rtl") || el.hasClass("esm-ltr")) {
|
||||
return;
|
||||
}
|
||||
el.addClass(cls);
|
||||
}
|
||||
|
||||
// main.ts
|
||||
var import_view2 = require("@codemirror/view");
|
||||
|
||||
// settingsTab.ts
|
||||
var import_obsidian2 = require("obsidian");
|
||||
var DEFAULT_SETTINGS = {
|
||||
fileDirections: {},
|
||||
defaultDirection: "ltr",
|
||||
rememberPerFile: true,
|
||||
setNoteTitleDirection: true,
|
||||
setYamlDirection: false,
|
||||
statusBar: true
|
||||
};
|
||||
var RtlSettingsTab = class extends import_obsidian2.PluginSettingTab {
|
||||
constructor(app, plugin) {
|
||||
super(app, plugin);
|
||||
this.plugin = plugin;
|
||||
this.settings = plugin.settings;
|
||||
}
|
||||
display() {
|
||||
let { containerEl } = this;
|
||||
containerEl.empty();
|
||||
containerEl.createEl("h2", { text: "RTL Settings" });
|
||||
this.plugin.syncDefaultDirection();
|
||||
new import_obsidian2.Setting(containerEl).setName("Remember text direction per file").setDesc("Store and remember the text direction used for each file individually.").addToggle((toggle) => toggle.setValue(this.settings.rememberPerFile).onChange((value) => {
|
||||
this.settings.rememberPerFile = value;
|
||||
this.plugin.saveSettings();
|
||||
this.plugin.adjustDirectionToActiveView();
|
||||
}));
|
||||
new import_obsidian2.Setting(containerEl).setName("Default text direction").setDesc("What should be the default text direction in Obsidian?").addDropdown((dropdown) => dropdown.addOption("ltr", "LTR").addOption("rtl", "RTL").addOption("auto", "Auto").setValue(this.settings.defaultDirection).onChange((value) => {
|
||||
this.settings.defaultDirection = value;
|
||||
this.app.vault.setConfig("rightToLeft", value == "rtl");
|
||||
this.plugin.saveSettings();
|
||||
this.plugin.adjustDirectionToActiveView();
|
||||
}));
|
||||
new import_obsidian2.Setting(containerEl).setName("Set note title direction").setDesc("In RTL notes, also set the direction of the note title.").addToggle((toggle) => toggle.setValue(this.settings.setNoteTitleDirection).onChange((value) => {
|
||||
this.settings.setNoteTitleDirection = value;
|
||||
this.plugin.saveSettings();
|
||||
this.plugin.adjustDirectionToActiveView();
|
||||
}));
|
||||
new import_obsidian2.Setting(containerEl).setName("Set YAML direction in Preview").setDesc("For RTL notes, preview YAML blocks as RTL. (When turning off, restart of Obsidian is required.)").addToggle((toggle) => {
|
||||
var _a;
|
||||
return toggle.setValue((_a = this.settings.setYamlDirection) != null ? _a : false).onChange((value) => {
|
||||
this.settings.setYamlDirection = value;
|
||||
this.plugin.saveSettings();
|
||||
this.plugin.adjustDirectionToActiveView();
|
||||
});
|
||||
});
|
||||
new import_obsidian2.Setting(containerEl).setName("Show status bar item").setDesc("Show a clickable status bar item showing the current direction.").addToggle((toggle) => {
|
||||
var _a;
|
||||
return toggle.setValue((_a = this.settings.statusBar) != null ? _a : true).onChange((value) => {
|
||||
this.settings.statusBar = value;
|
||||
this.plugin.saveSettings();
|
||||
this.plugin.adjustDirectionToActiveView();
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// main.ts
|
||||
var RtlPlugin = class extends import_obsidian3.Plugin {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.settings = null;
|
||||
this.statusBarItem = null;
|
||||
this.statusBarText = null;
|
||||
}
|
||||
async onload() {
|
||||
this.addCommand({
|
||||
id: "switch-text-direction",
|
||||
name: "Switch Text Direction (LTR->RTL->auto)",
|
||||
icon: "arrow-left-right",
|
||||
callback: () => {
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian3.MarkdownView);
|
||||
if (!view || !(view == null ? void 0 : view.editor))
|
||||
return;
|
||||
this.switchDocumentDirection(view.editor, view);
|
||||
}
|
||||
});
|
||||
this.autoDirectionPlugin = getAutoDirectionPlugin(this);
|
||||
this.registerEditorExtension(this.autoDirectionPlugin);
|
||||
this.registerEditorExtension(import_view2.EditorView.perLineTextDirection.of(true));
|
||||
this.registerMarkdownPostProcessor((el, ctx) => {
|
||||
autoDirectionPostProcessor(el, ctx, (path, markdownPreviewElement) => this.setCanvasPreviewDirection(path, markdownPreviewElement));
|
||||
});
|
||||
await this.convertLegacySettings();
|
||||
await this.loadSettings();
|
||||
this.addSettingTab(new RtlSettingsTab(this.app, this));
|
||||
this.app.workspace.on("active-leaf-change", async (leaf) => {
|
||||
this.adjustDirectionToActiveView();
|
||||
this.updateStatusBar();
|
||||
});
|
||||
this.app.workspace.on("file-open", async (file, ctx) => {
|
||||
this.adjustDirectionToActiveView();
|
||||
this.updateStatusBar();
|
||||
});
|
||||
this.registerEvent(this.app.vault.on("delete", (file) => {
|
||||
if (file && file.path && file.path in this.settings.fileDirections) {
|
||||
delete this.settings.fileDirections[file.path];
|
||||
this.saveSettings();
|
||||
}
|
||||
}));
|
||||
this.registerEvent(this.app.vault.on("rename", (file, oldPath) => {
|
||||
if (file && file.path && oldPath in this.settings.fileDirections) {
|
||||
this.settings.fileDirections[file.path] = this.settings.fileDirections[oldPath];
|
||||
delete this.settings.fileDirections[oldPath];
|
||||
this.saveSettings();
|
||||
}
|
||||
}));
|
||||
this.statusBarItem = this.addStatusBarItem();
|
||||
const languageIcon = (0, import_obsidian3.getIcon)("arrow-left-right");
|
||||
this.statusBarItem.appendChild(languageIcon);
|
||||
this.statusBarText = this.statusBarItem.createEl("span");
|
||||
this.statusBarText.style.marginLeft = "5px";
|
||||
this.statusBarItem.title = "Text direction";
|
||||
this.statusBarItem.addClass("mod-clickable");
|
||||
this.statusBarItem.addEventListener("click", (_ev) => {
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian3.MarkdownView);
|
||||
if (!view || !(view == null ? void 0 : view.editor))
|
||||
return;
|
||||
this.switchDocumentDirection(view.editor, view);
|
||||
});
|
||||
}
|
||||
onunload() {
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian3.MarkdownView);
|
||||
if (view && (view == null ? void 0 : view.editor)) {
|
||||
const editorView = view.editor.cm;
|
||||
this.adjustAutoDirection(editorView, "ltr");
|
||||
}
|
||||
console.log("unloading RTL plugin");
|
||||
}
|
||||
adjustDirectionToActiveView() {
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian3.MarkdownView);
|
||||
if (!view)
|
||||
return;
|
||||
this.adjustDirectionToView(view);
|
||||
}
|
||||
adjustDirectionToView(view, autoDirectionPlugin) {
|
||||
if (!view)
|
||||
return;
|
||||
this.syncDefaultDirection();
|
||||
const file = view == null ? void 0 : view.file;
|
||||
const editor = view == null ? void 0 : view.editor;
|
||||
const editorView = editor == null ? void 0 : editor.cm;
|
||||
if (file && file.path && editorView) {
|
||||
const [requiredDirection, _usedDefault] = this.getRequiredFileDirection(file);
|
||||
this.setMarkdownViewDirection(view, editor, editorView, requiredDirection, autoDirectionPlugin);
|
||||
}
|
||||
}
|
||||
getRequiredFileDirection(file) {
|
||||
if (!file) {
|
||||
return [this.settings.defaultDirection, true];
|
||||
}
|
||||
if (!(file instanceof import_obsidian3.TFile))
|
||||
return null;
|
||||
let requiredDirection = null;
|
||||
const frontMatterDirection = this.getFrontMatterDirection(file);
|
||||
let usedDefault = false;
|
||||
if (frontMatterDirection) {
|
||||
if (frontMatterDirection == "rtl" || frontMatterDirection == "ltr" || frontMatterDirection == "auto")
|
||||
requiredDirection = frontMatterDirection;
|
||||
else
|
||||
console.log("Front matter direction in file", file.path, "is unknown:", frontMatterDirection);
|
||||
} else if (this.settings.rememberPerFile && file.path in this.settings.fileDirections) {
|
||||
requiredDirection = this.settings.fileDirections[file.path];
|
||||
} else {
|
||||
requiredDirection = this.settings.defaultDirection;
|
||||
usedDefault = true;
|
||||
}
|
||||
return [requiredDirection, usedDefault];
|
||||
}
|
||||
async saveSettings() {
|
||||
await this.saveData(this.settings);
|
||||
}
|
||||
async loadSettings() {
|
||||
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
|
||||
}
|
||||
async convertLegacySettings() {
|
||||
const legacySettingsPath = ".obsidian/rtl.json";
|
||||
if (await this.app.vault.adapter.exists(legacySettingsPath)) {
|
||||
const legacyContent = await this.app.vault.adapter.read(legacySettingsPath);
|
||||
if (legacyContent) {
|
||||
this.settings = JSON.parse(legacyContent);
|
||||
}
|
||||
this.app.vault.adapter.remove(legacySettingsPath);
|
||||
new import_obsidian3.Notice("RTL Plugin: legacy settings were converted to the new format");
|
||||
this.saveSettings();
|
||||
}
|
||||
}
|
||||
updateStatusBar() {
|
||||
let hide = true;
|
||||
let usedDefault = false;
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian3.MarkdownView);
|
||||
if (view && (view == null ? void 0 : view.editor)) {
|
||||
const direction = this.getDocumentDirection(view.editor, view);
|
||||
if (view.file && view.file.path)
|
||||
[, usedDefault] = this.getRequiredFileDirection(view.file);
|
||||
if (this.settings.statusBar) {
|
||||
let directionString = direction === "auto" ? "auto" : direction === "ltr" ? "LTR" : "RTL";
|
||||
let statusString = "";
|
||||
if (usedDefault)
|
||||
statusString = `Default (${direction})`;
|
||||
else {
|
||||
if (direction === "auto")
|
||||
statusString = "Auto";
|
||||
else
|
||||
statusString = directionString;
|
||||
}
|
||||
this.statusBarText.textContent = statusString;
|
||||
this.statusBarItem.style.display = null;
|
||||
hide = false;
|
||||
}
|
||||
}
|
||||
if (hide)
|
||||
this.hideStatusBar();
|
||||
}
|
||||
hideStatusBar() {
|
||||
this.statusBarItem.style.display = "none";
|
||||
}
|
||||
handleIframeEditor(editorDiv, editorView, file, autoDirectionPlugin) {
|
||||
const isInIframe = editorDiv.closest(".mod-inside-iframe");
|
||||
if (isInIframe) {
|
||||
if (editorDiv instanceof HTMLDivElement) {
|
||||
const [requiredDirection, _] = this.getRequiredFileDirection(file);
|
||||
this.adjustAutoDirection(editorView, requiredDirection, autoDirectionPlugin);
|
||||
this.setDocumentDirectionForEditorDiv(editorDiv, requiredDirection);
|
||||
}
|
||||
}
|
||||
}
|
||||
setMarkdownViewDirection(view, editor, editorView, newDirection, autoDirectionPlugin) {
|
||||
if (!view || !editor) {
|
||||
this.hideStatusBar();
|
||||
return;
|
||||
}
|
||||
let title = editorView.dom.querySelector(".inline-title");
|
||||
if (!title) {
|
||||
title = view.previewMode.containerEl.querySelector(".inline-title");
|
||||
}
|
||||
title == null ? void 0 : title.setAttribute("dir", newDirection === "auto" ? "auto" : "");
|
||||
this.adjustAutoDirection(editorView, newDirection, autoDirectionPlugin);
|
||||
const editorDivs = view.contentEl.getElementsByClassName("cm-editor");
|
||||
for (const editorDiv of editorDivs) {
|
||||
if (editorDiv instanceof HTMLDivElement)
|
||||
this.setDocumentDirectionForEditorDiv(editorDiv, newDirection);
|
||||
}
|
||||
const markdownPreviews = view.contentEl.getElementsByClassName("markdown-preview-view");
|
||||
for (const preview of markdownPreviews) {
|
||||
if (preview instanceof HTMLDivElement)
|
||||
this.setDocumentDirectionForReadingDiv(preview, newDirection);
|
||||
}
|
||||
if (this.settings.setNoteTitleDirection) {
|
||||
const container = view.containerEl.parentElement;
|
||||
let header = container.getElementsByClassName("view-header-title-container");
|
||||
header[0].style.direction = newDirection;
|
||||
}
|
||||
editor.refresh();
|
||||
if (newDirection !== "auto") {
|
||||
this.setExportDirection(newDirection);
|
||||
}
|
||||
}
|
||||
adjustAutoDirection(editorView, newDirection, autoDirectionPlugin) {
|
||||
const autoDirection = autoDirectionPlugin != null ? autoDirectionPlugin : editorView.plugin(this.autoDirectionPlugin);
|
||||
if (autoDirection) {
|
||||
autoDirection.setActive(newDirection === "auto", editorView);
|
||||
if (!autoDirectionPlugin)
|
||||
editorView.dispatch();
|
||||
}
|
||||
}
|
||||
setDocumentDirectionForEditorDiv(editorDiv, newDirection) {
|
||||
editorDiv.style.direction = newDirection === "auto" ? "" : newDirection;
|
||||
this.addDirectionClassToEl(editorDiv.parentElement, newDirection);
|
||||
}
|
||||
setDocumentDirectionForReadingDiv(readingDiv, newDirection) {
|
||||
readingDiv.style.direction = newDirection === "auto" ? "" : newDirection;
|
||||
this.addDirectionClassToEl(readingDiv, newDirection);
|
||||
readingDiv.classList.remove("rtl-yaml");
|
||||
if (newDirection !== "auto" && this.settings.setYamlDirection)
|
||||
readingDiv.classList.add("rtl-yaml");
|
||||
}
|
||||
setCanvasPreviewDirection(path, markdownPreviewElement) {
|
||||
const file = this.app.vault.getAbstractFileByPath(path);
|
||||
const [requiredDirection, _] = this.getRequiredFileDirection(file);
|
||||
this.setDocumentDirectionForReadingDiv(markdownPreviewElement, requiredDirection);
|
||||
}
|
||||
addDirectionClassToEl(el, direction) {
|
||||
switch (direction) {
|
||||
case "rtl":
|
||||
el.classList.remove(AUTO_CLASS);
|
||||
el.classList.add(RTL_CLASS);
|
||||
break;
|
||||
case "auto":
|
||||
el.classList.remove(RTL_CLASS);
|
||||
el.classList.add(AUTO_CLASS);
|
||||
break;
|
||||
default:
|
||||
el.classList.remove(RTL_CLASS);
|
||||
el.classList.remove(AUTO_CLASS);
|
||||
}
|
||||
}
|
||||
setExportDirection(newDirection) {
|
||||
this.replacePageStyleByString("searched and replaced", `/* This is searched and replaced by the plugin */ @media print { body { direction: ${newDirection}; } }`, true);
|
||||
}
|
||||
replacePageStyleByString(searchString, newStyle, addIfNotFound) {
|
||||
let alreadyExists = false;
|
||||
let style = this.findPageStyle(searchString);
|
||||
if (style) {
|
||||
if (style.getText() === searchString)
|
||||
alreadyExists = true;
|
||||
else
|
||||
style.setText(newStyle);
|
||||
} else if (addIfNotFound) {
|
||||
let style2 = document.createElement("style");
|
||||
style2.textContent = newStyle;
|
||||
document.head.appendChild(style2);
|
||||
}
|
||||
return style && !alreadyExists;
|
||||
}
|
||||
findPageStyle(regex) {
|
||||
let styles = document.head.getElementsByTagName("style");
|
||||
for (let style of styles) {
|
||||
if (style.getText().match(regex))
|
||||
return style;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
switchDocumentDirection(editor, view) {
|
||||
let newDirection = this.getDocumentDirection(editor, view);
|
||||
if (newDirection === null) {
|
||||
new import_obsidian3.Notice("Obsidian RTL can't set the direction of this document");
|
||||
return;
|
||||
}
|
||||
let displayName = "";
|
||||
switch (newDirection) {
|
||||
case "ltr":
|
||||
newDirection = "rtl";
|
||||
displayName = "RTL";
|
||||
break;
|
||||
case "rtl":
|
||||
newDirection = "auto";
|
||||
displayName = "Auto";
|
||||
break;
|
||||
case "auto":
|
||||
newDirection = "ltr";
|
||||
displayName = "LTR";
|
||||
break;
|
||||
}
|
||||
if (view instanceof import_obsidian3.MarkdownView) {
|
||||
const editorView = view.editor.cm;
|
||||
this.setMarkdownViewDirection(view, editor, editorView, newDirection);
|
||||
if (this.settings.rememberPerFile && view.file && view.file.path) {
|
||||
this.settings.fileDirections[view.file.path] = newDirection;
|
||||
this.saveSettings();
|
||||
}
|
||||
new import_obsidian3.Notice(`Document direction set to ${displayName}`, 2e3);
|
||||
this.updateStatusBar();
|
||||
} else {
|
||||
const canvasView = this.getCanvasContext(view);
|
||||
if (canvasView) {
|
||||
if (view.file)
|
||||
new import_obsidian3.Notice("To change a canvas card direction, open the document separately and reload the canvas.");
|
||||
else
|
||||
new import_obsidian3.Notice("Can't change the direction of a card without a file.");
|
||||
}
|
||||
}
|
||||
}
|
||||
getCanvasContext(ctx) {
|
||||
if (ctx instanceof import_obsidian3.MarkdownView)
|
||||
return null;
|
||||
const possibleCanvasContainer = ctx == null ? void 0 : ctx.containerEl;
|
||||
if (possibleCanvasContainer && possibleCanvasContainer.hasClass("canvas-node-content"))
|
||||
return possibleCanvasContainer;
|
||||
}
|
||||
getDocumentDirection(_editor, ctx) {
|
||||
let refElement = null;
|
||||
if (ctx instanceof import_obsidian3.MarkdownView) {
|
||||
refElement = ctx.contentEl;
|
||||
} else {
|
||||
refElement = this.getCanvasContext(ctx);
|
||||
}
|
||||
if (refElement === null)
|
||||
return null;
|
||||
const rtlEditors = refElement.getElementsByClassName(RTL_CLASS), autoEditors = refElement.getElementsByClassName(AUTO_CLASS);
|
||||
if (rtlEditors.length > 0)
|
||||
return "rtl";
|
||||
else if (autoEditors.length > 0)
|
||||
return "auto";
|
||||
else
|
||||
return "ltr";
|
||||
}
|
||||
getFrontMatterDirection(file) {
|
||||
const fileCache = this.app.metadataCache.getFileCache(file);
|
||||
const frontMatter = fileCache == null ? void 0 : fileCache.frontmatter;
|
||||
if (frontMatter && (frontMatter == null ? void 0 : frontMatter.direction)) {
|
||||
try {
|
||||
const direction = frontMatter.direction;
|
||||
return direction;
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
syncDefaultDirection() {
|
||||
const obsidianDirection = this.app.vault.getConfig("rightToLeft") ? "rtl" : "ltr";
|
||||
if (obsidianDirection != this.settings.defaultDirection && this.settings.defaultDirection !== "auto") {
|
||||
this.settings.defaultDirection = obsidianDirection;
|
||||
this.saveSettings();
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"id": "obsidian-rtl",
|
||||
"name": "RTL Support",
|
||||
"version": "1.1.1",
|
||||
"minAppVersion": "0.15.3",
|
||||
"description": "Right to Left (RTL) text direction support for languages like Arabic, Hebrew and Persian (Farsi).",
|
||||
"author": "esm",
|
||||
"authorUrl": "",
|
||||
"isDesktopOnly": false
|
||||
}
|
|
@ -1,202 +0,0 @@
|
|||
@media print {
|
||||
span.cm-tab {
|
||||
width: 50px !important;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.is-auto .esm-ltr {
|
||||
direction: ltr;
|
||||
text-align-last: left;
|
||||
}
|
||||
|
||||
.is-auto .esm-rtl {
|
||||
direction: rtl;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
/* List indent fix */
|
||||
.is-mobile .is-rtl .HyperMD-list-line, .is-mobile .HyperMD-list-line[dir="rtl"] {
|
||||
text-indent: 0px !important;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
.CodeMirror-rtl pre {
|
||||
text-indent: 0px !important;
|
||||
}
|
||||
|
||||
/* Embedded links always LTR */
|
||||
.embedded-backlinks {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
/* Patch YAML RTL */
|
||||
/* In a preview that is strictly RTL (is-rtl) and the settings ask to right-aline YAML (rtl-yaml), set a YAML block to RTL. */
|
||||
.is-rtl.rtl-yaml code.language-yaml {
|
||||
text-align: right;
|
||||
}
|
||||
/* Then move the 'copy' button to the left */
|
||||
.is-rtl.rtl-yaml code.language-yaml + button.copy-code-button {
|
||||
right: unset;
|
||||
left: 0;
|
||||
}
|
||||
/* In a preview that is auto (is-auto), and the YAML was detected as RTL (esm-rtl), set the 'copy' button to the left */
|
||||
.is-auto .esm-rtl.language-yaml + button.copy-code-button {
|
||||
right: unset;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/* In RTL, or in Auto with a first line that is RTL, set the flair (where it says e.g. 'yaml' in Edit mode) to the left */
|
||||
.is-rtl div:has(.HyperMD-codeblock-begin) .code-block-flair,
|
||||
.is-auto div:has(.HyperMD-codeblock-begin + .HyperMD-codeblock[dir="rtl"]) .code-block-flair {
|
||||
right: unset;
|
||||
left: 6px;
|
||||
}
|
||||
|
||||
/* RTL and Auto callout titles that are detected as RTL - set to the right */
|
||||
.is-rtl .callout-title:has(.esm-rtl),
|
||||
.is-auto .callout-title:has(.esm-rtl) {
|
||||
direction: rtl;
|
||||
}
|
||||
.is-auto .callout-content .esm-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
/* When an RTL callout title was set to the right, left-justify its edit block button */
|
||||
.is-rtl div.cm-callout:has(.callout-title .esm-rtl) .edit-block-button,
|
||||
.is-auto div.cm-callout:has(.callout-title .esm-rtl) .edit-block-button {
|
||||
right: unset;
|
||||
left: var(--size-2-2);
|
||||
}
|
||||
|
||||
.markdown-source-view .cm-line[dir="rtl"] .task-list-label {
|
||||
margin-left: 0;
|
||||
margin-right: -3px;
|
||||
}
|
||||
|
||||
/* Better spacing between bullet and text */
|
||||
.outliner-plugin-better-bullets .markdown-source-view.is-rtl .cm-formatting-list-ul,
|
||||
.outliner-plugin-better-bullets .markdown-source-view .cm-line[dir="rtl"] .cm-formatting-list-ul {
|
||||
margin-right: 0;
|
||||
margin-left: 0.3em;
|
||||
}
|
||||
|
||||
.markdown-source-view.is-rtl .is-collapsed .collapse-indicator svg.svg-icon,
|
||||
.markdown-source-view .cm-line[dir="rtl"] .is-collapsed .collapse-indicator svg.svg-icon {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
/* Styling for collapse indicator on the headings */
|
||||
.markdown-source-view.is-rtl .cm-line .cm-fold-indicator .collapse-indicator,
|
||||
.markdown-source-view .cm-line[dir="rtl"] .cm-fold-indicator .collapse-indicator {
|
||||
padding-right: 0;
|
||||
padding-left: 6px;
|
||||
right: -16px;
|
||||
}
|
||||
|
||||
/* Styling for collapse indicator on the lists */
|
||||
.markdown-source-view.is-rtl .cm-line:not(.cm-active):not(.HyperMD-header):not(.HyperMD-task-line) .cm-fold-indicator .collapse-indicator,
|
||||
.markdown-source-view .cm-line[dir="rtl"]:not(.cm-active):not(.HyperMD-header):not(.HyperMD-task-line) .cm-fold-indicator .collapse-indicator {
|
||||
padding-right: 0;
|
||||
padding-left: 18px;
|
||||
right: -16px;
|
||||
}
|
||||
|
||||
/* Styling for tags in RTL */
|
||||
.markdown-source-view.is-rtl .cm-line .cm-hashtag.cm-hashtag-begin,
|
||||
.markdown-source-view .cm-line[dir="rtl"] .cm-hashtag.cm-hashtag-begin {
|
||||
border-top-right-radius: var(--tag-radius);
|
||||
border-bottom-right-radius: var(--tag-radius);
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-left: none;
|
||||
border-right: var(--tag-border-width) solid var(--tag-border-color);
|
||||
padding-right: var(--tag-padding-x);
|
||||
padding-left: 0;
|
||||
}
|
||||
.markdown-source-view.is-rtl .cm-line .cm-hashtag.cm-hashtag-end,
|
||||
.markdown-source-view .cm-line[dir="rtl"] .cm-hashtag.cm-hashtag-end {
|
||||
border-top-left-radius: var(--tag-radius);
|
||||
border-bottom-left-radius: var(--tag-radius);
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-right: none;
|
||||
border-left: var(--tag-border-width) solid var(--tag-border-color);
|
||||
padding-left: var(--tag-padding-x);
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.markdown-preview-view.is-auto .esm-rtl,
|
||||
.kanban-plugin__board .esm-rtl,
|
||||
.kanban-plugin__drag-container .esm-rtl {
|
||||
direction: rtl;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Moving bullets to right side of the page and adding enough space between the bullet and the text */
|
||||
.markdown-preview-view.is-auto .esm-rtl > .list-bullet,
|
||||
.markdown-preview-view.is-rtl .list-bullet {
|
||||
float: right;
|
||||
margin-right: -12px;
|
||||
}
|
||||
|
||||
/* Fixing indentation guides in nested lists */
|
||||
.markdown-preview-view.is-auto.show-indentation-guide li.esm-rtl > ul::before,
|
||||
.markdown-preview-view.is-auto.show-indentation-guide li.esm-rtl > ol::before {
|
||||
left: auto;
|
||||
right: -15px;
|
||||
}
|
||||
|
||||
/* Moving the collapse indicator to right side of the page */
|
||||
.markdown-preview-view.is-auto .esm-rtl > .collapse-indicator,
|
||||
.markdown-preview-view.is-rtl .collapse-indicator {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Moving the collapse indicator icon on the right of the text with enough space between */
|
||||
.markdown-preview-view.is-auto .esm-rtl > .list-collapse-indicator,
|
||||
.markdown-preview-view.is-rtl .list-collapse-indicator {
|
||||
margin-right: -48px;
|
||||
padding-left: 18px;
|
||||
}
|
||||
|
||||
/* Moving the heading collapse indicator on the right of the text. Without
|
||||
This the collapse indicator will be over the heading text */
|
||||
.markdown-preview-view.is-auto .esm-rtl > .heading-collapse-indicator,
|
||||
.markdown-preview-view.is-rtl .heading-collapse-indicator {
|
||||
margin-right: -22px;
|
||||
}
|
||||
|
||||
/* Mirroring collapse icon for nested lists so it points to rtl text not outside of page */
|
||||
.markdown-preview-view.is-auto .esm-rtl > .collapse-icon .is-collapsed svg.svg-icon,
|
||||
.markdown-preview-view.is-auto .esm-rtl.is-collapsed > .collapse-icon svg.svg-icon,
|
||||
.markdown-preview-view.is-rtl .collapse-icon .is-collapsed svg.svg-icon {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
/* Mirroring collapse icon for headings so it points to rtl text not outside of page */
|
||||
.markdown-preview-view .is-collapsed .esm-rtl > .collapse-icon svg.svg-icon,
|
||||
.markdown-preview-view.is-rtl .collapse-icon svg.svg-icon {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
/* Reverting the margin so the text won't stick to the checkbox */
|
||||
.markdown-preview-view.is-auto .esm-rtl > .task-list-item-checkbox,
|
||||
.markdown-preview-view.is-rtl .task-list-item-checkbox {
|
||||
margin-left: 6px;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.markdown-preview-view.is-auto .esm-ltr {
|
||||
direction: ltr;
|
||||
text-align-last: left;
|
||||
}
|
||||
|
||||
/* Helper styles for debugging */
|
||||
/* .cm-line[dir="rtl"] { */
|
||||
/* border-right: dashed; */
|
||||
/* border-right-color: blue; */
|
||||
/* } */
|
||||
/* .cm-line[dir="ltr"] { */
|
||||
/* border-right: dashed; */
|
||||
/* border-right-color: red; */
|
||||
/* } */
|
|
@ -6,6 +6,7 @@
|
|||
{
|
||||
"id": "1700c7fa331b8589",
|
||||
"type": "tabs",
|
||||
"dimension": 41.97689345314506,
|
||||
"children": [
|
||||
{
|
||||
"id": "91dc25e2b1472f34",
|
||||
|
@ -22,16 +23,17 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"id": "1678d456e2d0710d",
|
||||
"id": "5d31b72eb04ae892",
|
||||
"type": "tabs",
|
||||
"dimension": 58.02310654685494,
|
||||
"children": [
|
||||
{
|
||||
"id": "d281f72a4fc9e31f",
|
||||
"id": "240062d36a9c5bb7",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Gen.28.10-19.md",
|
||||
"file": "Rom.8.12-25.md",
|
||||
"mode": "preview",
|
||||
"source": true
|
||||
}
|
||||
|
@ -91,8 +93,7 @@
|
|||
"state": {}
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 3
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
|
@ -113,7 +114,7 @@
|
|||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "Gen.28.10-19.md"
|
||||
"file": "Rom.8.12-25.md"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -134,7 +135,7 @@
|
|||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"file": "Gen.28.10-19.md",
|
||||
"file": "Rom.8.12-25.md",
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
|
@ -151,7 +152,7 @@
|
|||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"file": "Gen.28.10-19.md",
|
||||
"file": "Rom.8.12-25.md",
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
|
@ -174,15 +175,16 @@
|
|||
"workspaces:Manage workspace layouts": false
|
||||
}
|
||||
},
|
||||
"active": "d281f72a4fc9e31f",
|
||||
"active": "240062d36a9c5bb7",
|
||||
"lastOpenFiles": [
|
||||
"README.md",
|
||||
"Rom.8.12-25.md",
|
||||
"images/2023-07-23.lectionary.png",
|
||||
"Gen.28.10-19.md",
|
||||
"images/2023-07-23-Rom.8.12-15.png",
|
||||
"images/2023-07-23.Gen.28.10-19.png",
|
||||
"images/2023-07-23.lectionary.png",
|
||||
"Rom.8.12-25.md",
|
||||
"images/2023-02-19-lectionary.png",
|
||||
"template/講道筆記範本.md",
|
||||
"images/2023-07-23-Rom.8.12-15.png",
|
||||
"1Co.15.1-11.md",
|
||||
"1Co.11.23-32.md",
|
||||
"images/2023-02-19-出24.12-18.png",
|
||||
|
@ -191,12 +193,10 @@
|
|||
"images/Pasted image 20221214190537.png",
|
||||
"images/Pasted image 20221214191702.png",
|
||||
"images/2023-06-25-林前11.23-32.png.md",
|
||||
"images/2023-06-25-1Co.11.23-32.png",
|
||||
"1Co.12.3-13.md",
|
||||
"Act.2.1-21.md",
|
||||
"Jos.9.7-15.md",
|
||||
"約書亞記 9.7-15.md",
|
||||
"images/2023-05-28-1Co.12.3.13小抄.jpg",
|
||||
"Pro.18.8.md",
|
||||
"Exo.24.12-18.md",
|
||||
"Mat.17.1-9.md",
|
||||
|
|
|
@ -6,20 +6,31 @@
|
|||
|
||||
![images/2023-07-23.lectionary.png](images/2023-07-23.lectionary.png)
|
||||
|
||||
## 語意結構圖析 (Semantic Structure Diagram)
|
||||
|
||||
## 句法 (Syntax)
|
||||
|
||||
<div direction="rtl">
|
||||
Gen 28:10 <RUBY><ruby><ruby>וַיֵּצֵ֥א<rt>יָצָא</rt></ruby><rt>and went out</rt></ruby><rt>C∙V-Qal-wayyqtl-3ms</rt></RUBY> <RUBY><ruby><ruby>יַעֲקֹ֖ב<rt>יַעֲקֹב</rt></ruby><rt>Jacob</rt></ruby><rt>N-proper-ms</rt></RUBY> <RUBY><ruby><ruby>מִבְּאֵ֣ר<rt>בְּאֵר שֶׁבַע</rt></ruby><rt>from</rt></ruby><rt>Prep</rt></RUBY> <RUBY><ruby><ruby>שָׁ֑בַע<rt>בְּאֵר שֶׁבַע</rt></ruby><rt>Beersheba,</rt></ruby><rt>Prep∙N-proper-fs</rt></RUBY> <RUBY><ruby><ruby>וַיֵּ֖לֶךְ<rt>הָלַךְ</rt></ruby><rt>and went</rt></ruby><rt>C∙V-Qal-wayyqtl-3ms</rt></RUBY> <RUBY><ruby><ruby>חָרָֽנָה׃<rt>חָרָן</rt></ruby><rt>toward Haran.</rt></ruby><rt>N-proper-fs∙3fs</rt></RUBY>
|
||||
</div>
|
||||
|
||||
|
||||
## 解經 (Exegesis)
|
||||
💡😀😢❓❌⭕❗🎀🎗️✳️
|
||||
|
||||
![images/2023-07-23.Gen.28.10-19.png](images/2023-07-23.Gen.28.10-19.png)
|
||||
|
||||
️
|
||||
## 大綱 (Outline)
|
||||
💡😀😢❓❌⭕❗🎀🎗️✳️
|
||||
💡😀😢❓❌⭕❗🎀🎗️✳
|
||||
|
||||
- (0) 開場
|
||||
- (1) 榮耀的盼望——來源 (SOURCE)
|
||||
- 單單從神的應許而來 ⇐ 神的屬性 (אֲנִ֣י יְהוָ֗ה אֱלֹהֵי֙ אַבְרָהָ֣ם אָבִ֔יךָ וֵאלֹהֵ֖י יִצְחָ֑ק)
|
||||
- 不在乎人的過去 (人的行為、功德)
|
||||
- 雅各兩次欺騙 (固然以掃輕看長子名份不對)
|
||||
- 不在乎人的現在 (人的處境、困難)
|
||||
- (2) 榮耀的盼望——內涵 (WHAT)
|
||||
- (2a) 產業:土地 & 後裔 & 萬族得福
|
||||
- (2b) 永遠的同在 & 帶領
|
||||
- 雅各扶着杖頭敬拜神 (創47:31)
|
||||
- 雅各把腳收在床上斷了氣 (創49:33)
|
||||
- (2c) 已然 & 未然 (already and note-yet)!
|
||||
- 沒應驗在雅各身上 → 沒完全應驗在以色列民族歷史上 ⇒ 全都應驗在耶穌基督身上!
|
||||
- (3) 榮耀的盼望——回應 (HOW)
|
||||
- (3a) 相信:不是以為自己在作夢!
|
||||
- (3b) 敬畏:對神的話、對神所在的地方、對神!
|
||||
- (3c) 敬拜
|
||||
|
||||
## 小抄 (memo)
|
||||
|
||||
|
|
|
@ -91,11 +91,11 @@
|
|||
💡😀😢❓❌⭕❗🎀🎗️✳️
|
||||
|
||||
- (0) 開場
|
||||
- (1) 榮耀的盼望——WHAT (內涵是什麼)?
|
||||
- (1) 榮耀的盼望——內涵 (WHAT)
|
||||
- (1a) 活著 (8:12-13)!
|
||||
- (1b) 做神兒女 (8:14-16)!
|
||||
- (1c) 與基督一同得榮 (8:17)!
|
||||
- (2) 榮耀的盼望——HOW (如何回應)?
|
||||
- (2) 榮耀的盼望——回應 (HOW)
|
||||
- (2a) 你不孤單——受造之物都在等 (8:19-22)!
|
||||
- (2b) 忍耐等候——因為必定成功 (8:23-25)!
|
||||
- 聖靈代禱 (8:26-27) + 聖子代禱 (8:34) = 基督的愛掛保證 (8:31-39)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 627 KiB |
Loading…
Reference in New Issue