Auto saved by Logseq
This commit is contained in:
Vendored
+6
File diff suppressed because one or more lines are too long
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "journaling",
|
||||
"name": "Journaling",
|
||||
"description": "View daily notes in a journal-like format, similar to Logseq. It enhances note organization and facilitates better reflection by consolidating daily notes into a continuous journaling view.",
|
||||
"author": "Ordeeper",
|
||||
"authorUrl": "https://github.com/Ordeeper/",
|
||||
"fundingUrl": "https://github.com/sponsors/Ordeeper/",
|
||||
"version": "1.0.0",
|
||||
"minAppVersion": "0.15.0",
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
:root{--border-radius:2rem;--border-w:.2rem}a.svelte-1m20tsl.svelte-1m20tsl{text-decoration:none;box-shadow:#0a254059 0 -2px 6px inset;background-color:#e8e8e8;border-color:#ffe2e2;border-style:solid;border-width:var(--border-w);border-radius:var(--border-radius);transition:transform .4s cubic-bezier(.68,-.55,.27,2.5),width .4s cubic-bezier(.68,-.55,.27,2.5),border-color .4s ease-in-out,background-color .4s ease-in-out}a.svelte-1m20tsl.svelte-1m20tsl:hover{background-color:#eee;transform:scale(105%);animation:svelte-1m20tsl-movingBorders 3s infinite;width:10em}.title.svelte-1m20tsl.svelte-1m20tsl{font-weight:900;font-family:monospace;color:#867c7c00;word-spacing:-2px;height:0;width:0;visibility:hidden;transition:color .7s ease-in-out}a.svelte-1m20tsl:hover .title.svelte-1m20tsl{height:auto;width:auto;visibility:visible;color:#867c7c}a.svelte-1m20tsl svg.svelte-1m20tsl{fill:#ff6e6e;transition:opacity .1s ease-in-out}.filled.svelte-1m20tsl.svelte-1m20tsl{position:absolute;opacity:0}a.svelte-1m20tsl:hover .empty.svelte-1m20tsl{opacity:0}a.svelte-1m20tsl:hover .filled.svelte-1m20tsl{opacity:1;animation:svelte-1m20tsl-beatingHeart 1.2s infinite}@keyframes svelte-1m20tsl-movingBorders{0%{border-color:#fce4e4}50%{border-color:#ffd8d8}90%{border-color:#fce4e4}}@keyframes svelte-1m20tsl-beatingHeart{0%{transform:scale(1)}15%{transform:scale(1.15)}30%{transform:scale(1)}45%{transform:scale(1.15)}60%{transform:scale(1)}}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.visible{visibility:visible}.absolute{position:absolute}.me{margin-inline-end:1rem}.hidden{display:none}.h-13{height:3.25rem}.w-13{width:3.25rem}.flex{display:flex}.inline-flex{display:inline-flex}.flex-col{flex-direction:column}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-3{gap:.75rem}.overflow-hidden{overflow:hidden}.break-words{overflow-wrap:break-word}.border{border-width:1px}.p-x-2\.5{padding-left:.625rem;padding-right:.625rem}.pb-7{padding-bottom:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width: 640px){.sm\:flex-row{flex-direction:row}}
|
||||
+371
@@ -0,0 +1,371 @@
|
||||
/*
|
||||
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);
|
||||
|
||||
// src/main.ts
|
||||
var main_exports = {};
|
||||
__export(main_exports, {
|
||||
default: () => PagePropsPlugin
|
||||
});
|
||||
module.exports = __toCommonJS(main_exports);
|
||||
var import_obsidian = require("obsidian");
|
||||
|
||||
// src/render.ts
|
||||
var import_view = require("@codemirror/view");
|
||||
var fieldName = /([\p{L}\p{Extended_Pictographic}][0-9\p{L}\p{Extended_Pictographic}\s_/-]*)/u;
|
||||
function decoratedRegex(dec) {
|
||||
return new RegExp(`(^\\s*)${dec}${fieldName.source}${dec}(::\\s*)(.*)$`, "u");
|
||||
}
|
||||
var regex = decoratedRegex("");
|
||||
var specialRegex1 = decoratedRegex("\\*\\*");
|
||||
var specialRegex2 = decoratedRegex("\\*");
|
||||
var specialRegex3 = decoratedRegex("`");
|
||||
var specialRegex4 = decoratedRegex("_");
|
||||
function parseField(line) {
|
||||
let res = regex.exec(line);
|
||||
let extraLen = 0;
|
||||
if (!res) {
|
||||
extraLen = 4;
|
||||
res = specialRegex1.exec(line);
|
||||
if (!res) {
|
||||
extraLen = 2;
|
||||
res = specialRegex2.exec(line);
|
||||
if (!res) {
|
||||
res = specialRegex3.exec(line);
|
||||
if (!res) {
|
||||
res = specialRegex4.exec(line);
|
||||
if (!res) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const [, prespace, field, separator, content] = res;
|
||||
return {
|
||||
prespace,
|
||||
field,
|
||||
fieldLen: field.length + extraLen,
|
||||
separator,
|
||||
content
|
||||
};
|
||||
}
|
||||
function render(plugin, field, separator, content, fieldNode) {
|
||||
const span = createSpan();
|
||||
const text = fieldNode ? void 0 : field;
|
||||
const fieldEl = plugin.settings.fieldsAreInnerLinks ? createEl("a", {
|
||||
cls: `internal-link page-prop page-prop--${field} page-prop-field`,
|
||||
text,
|
||||
href: field,
|
||||
attr: { "data-href": field, spellcheck: "false", target: "_blank", rel: "noopener" },
|
||||
parent: span
|
||||
}) : createSpan({
|
||||
cls: `page-prop page-prop--${field} page-prop-field`,
|
||||
text,
|
||||
attr: { spellcheck: "false" },
|
||||
parent: span
|
||||
});
|
||||
if (fieldNode) {
|
||||
fieldEl.appendChild(fieldNode);
|
||||
}
|
||||
createSpan({
|
||||
cls: `page-prop page-prop--${field} page-prop-separator`,
|
||||
text: separator,
|
||||
attr: { spellcheck: "false" },
|
||||
parent: span
|
||||
});
|
||||
if (content.length == 1 && content[0].nodeType == Node.TEXT_NODE) {
|
||||
const pattern = plugin.autolinkPatterns[field];
|
||||
if (pattern) {
|
||||
const text2 = content[0].textContent || "";
|
||||
createEl("a", {
|
||||
cls: `external-link page-prop page-prop--${field} page-prop-content`,
|
||||
text: text2,
|
||||
href: pattern.format(encodeURI(text2)),
|
||||
attr: { spellcheck: "false" },
|
||||
parent: span
|
||||
});
|
||||
return span;
|
||||
}
|
||||
}
|
||||
const holder = createSpan({
|
||||
cls: `page-prop page-prop--${field} page-prop-content`,
|
||||
attr: { spellcheck: "false" },
|
||||
parent: span
|
||||
});
|
||||
for (const node of content) {
|
||||
holder.appendChild(node);
|
||||
}
|
||||
return span;
|
||||
}
|
||||
function createMarkdownPostProcessor(plugin) {
|
||||
return (el) => {
|
||||
if (el.childElementCount != 1) {
|
||||
return;
|
||||
}
|
||||
const p = el.firstChild;
|
||||
if (!p || p.nodeName != "P") {
|
||||
return;
|
||||
}
|
||||
const nodes = p.childNodes;
|
||||
const lines = [];
|
||||
let currentLine = [];
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
const node = nodes[i];
|
||||
if (node.nodeName == "BR") {
|
||||
lines.push(currentLine);
|
||||
currentLine = [];
|
||||
} else if (node.nodeType != Node.TEXT_NODE || node.textContent != "\n") {
|
||||
currentLine.push(node);
|
||||
}
|
||||
}
|
||||
lines.push(currentLine);
|
||||
for (const lineNodes of lines) {
|
||||
if (lineNodes.length == 0) {
|
||||
continue;
|
||||
}
|
||||
const [first] = lineNodes;
|
||||
if (first.nodeType == Node.TEXT_NODE) {
|
||||
const res2 = parseField(first.textContent || "");
|
||||
if (!res2) {
|
||||
continue;
|
||||
}
|
||||
const { prespace: prespace2, field: field2, separator: separator2, content: contentTextPart } = res2;
|
||||
if (contentTextPart.length == 0 && lineNodes.length == 1) {
|
||||
continue;
|
||||
}
|
||||
if (prespace2.length != 0) {
|
||||
p.insertBefore(document.createTextNode(prespace2), first);
|
||||
}
|
||||
if (!plugin.settings.hideInReaderMode.contains(field2)) {
|
||||
const contentNodes = [document.createTextNode(contentTextPart), ...lineNodes.slice(1)];
|
||||
p.insertBefore(render(plugin, field2, separator2, contentNodes), first);
|
||||
}
|
||||
p.removeChild(first);
|
||||
continue;
|
||||
}
|
||||
if (lineNodes.length == 1) {
|
||||
continue;
|
||||
}
|
||||
const [, second] = lineNodes;
|
||||
if (second.nodeType != Node.TEXT_NODE) {
|
||||
continue;
|
||||
}
|
||||
let preContent = second.textContent || "";
|
||||
if (!preContent.startsWith("::")) {
|
||||
continue;
|
||||
}
|
||||
preContent = preContent.substring(2);
|
||||
const res = parseField((first.textContent || "") + "::");
|
||||
if (!res) {
|
||||
continue;
|
||||
}
|
||||
const { prespace, field, separator } = res;
|
||||
if (preContent.trim().length == 0 && lineNodes.length == 2) {
|
||||
continue;
|
||||
}
|
||||
if (prespace.length != 0) {
|
||||
p.insertBefore(document.createTextNode(prespace), first);
|
||||
}
|
||||
if (!plugin.settings.hideInReaderMode.contains(field)) {
|
||||
const contentNodes = preContent.length != 0 ? [document.createTextNode(preContent), ...lineNodes.slice(2)] : lineNodes.slice(2);
|
||||
const rendered = render(plugin, field, separator, contentNodes, first);
|
||||
p.insertBefore(rendered, second);
|
||||
}
|
||||
p.removeChild(second);
|
||||
}
|
||||
};
|
||||
}
|
||||
function decorate(plugin, view) {
|
||||
const { doc } = view.state;
|
||||
const widgets = [];
|
||||
for (const { from, to } of view.visibleRanges) {
|
||||
for (let i = doc.lineAt(from).number; i <= doc.lineAt(to).number; i++) {
|
||||
const line = doc.line(i);
|
||||
if (line.text.trim().length == 0) {
|
||||
continue;
|
||||
}
|
||||
const res = parseField(line.text);
|
||||
if (!res) {
|
||||
continue;
|
||||
}
|
||||
const { prespace, field, fieldLen, separator, content } = res;
|
||||
if (content.length == 0) {
|
||||
continue;
|
||||
}
|
||||
const nameStart = line.from + prespace.length;
|
||||
const nameEnd = nameStart + fieldLen;
|
||||
const contentStart = nameEnd + separator.length;
|
||||
const contentEnd = line.to;
|
||||
let extraClass = "";
|
||||
if (plugin.settings.hideInReaderMode.contains(field)) {
|
||||
extraClass = " page-prop-hidden";
|
||||
}
|
||||
if (plugin.settings.fieldsAreInnerLinks) {
|
||||
widgets.push(import_view.Decoration.mark({
|
||||
tagName: "a",
|
||||
class: `internal-link page-prop${extraClass} page-prop--${field} page-prop-field`,
|
||||
attributes: {
|
||||
href: field,
|
||||
spellcheck: "false",
|
||||
draggable: "true"
|
||||
}
|
||||
}).range(nameStart, nameEnd));
|
||||
} else {
|
||||
widgets.push(import_view.Decoration.mark({
|
||||
class: `page-prop${extraClass} page-prop--${field} page-prop-field`,
|
||||
attributes: { spellcheck: "false" }
|
||||
}).range(nameStart, nameEnd));
|
||||
}
|
||||
widgets.push(import_view.Decoration.mark({
|
||||
class: `page-prop${extraClass} page-prop--${field} page-prop-separator`,
|
||||
attributes: { spellcheck: "false" }
|
||||
}).range(nameEnd, contentStart));
|
||||
const cls = `page-prop${extraClass} page-prop--${field} page-prop-content`;
|
||||
const pattern = plugin.autolinkPatterns[field];
|
||||
if (pattern) {
|
||||
const href = pattern.format(encodeURI(content));
|
||||
widgets.push(import_view.Decoration.mark({
|
||||
tagName: "a",
|
||||
class: `external-link page-prop page-prop--${field} page-prop-content`,
|
||||
attributes: { href, spellcheck: "false" }
|
||||
}).range(contentStart, contentEnd));
|
||||
} else {
|
||||
widgets.push(import_view.Decoration.mark({
|
||||
class: cls,
|
||||
attributes: { spellcheck: "false" }
|
||||
}).range(contentStart, contentEnd));
|
||||
}
|
||||
}
|
||||
}
|
||||
return import_view.Decoration.set(widgets);
|
||||
}
|
||||
function createViewPlugin(plugin) {
|
||||
return import_view.ViewPlugin.fromClass(class {
|
||||
constructor(view) {
|
||||
this.decorations = decorate(plugin, view);
|
||||
}
|
||||
update(update) {
|
||||
if (update.docChanged || update.viewportChanged || update.selectionSet) {
|
||||
this.decorations = decorate(plugin, update.view);
|
||||
}
|
||||
}
|
||||
}, { decorations: (v) => v.decorations });
|
||||
}
|
||||
|
||||
// src/main.ts
|
||||
var DEFAULT_SETTINGS = {
|
||||
fieldsAreInnerLinks: true,
|
||||
autolinkPatterns: [
|
||||
{ field: "github", prefix: "https://github.com/{0}" },
|
||||
{ field: "wiki", prefix: "https://wikipedia.org/wiki/{0}" },
|
||||
{ field: "twitter", prefix: "https://twitter.com/{0}" }
|
||||
],
|
||||
hideInReaderMode: [
|
||||
"public"
|
||||
]
|
||||
};
|
||||
var PagePropsPlugin = class extends import_obsidian.Plugin {
|
||||
async onload() {
|
||||
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
|
||||
this.refreshAutolinkPatterns();
|
||||
this.registerEditorExtension([createViewPlugin(this)]);
|
||||
this.registerMarkdownPostProcessor(createMarkdownPostProcessor(this), -100);
|
||||
this.addSettingTab(new Settings(this.app, this));
|
||||
}
|
||||
refreshAutolinkPatterns() {
|
||||
this.autolinkPatterns = {};
|
||||
for (const entry of this.settings.autolinkPatterns) {
|
||||
this.autolinkPatterns[entry.field] = entry.prefix;
|
||||
}
|
||||
}
|
||||
async saveSettings() {
|
||||
this.refreshAutolinkPatterns();
|
||||
await this.saveData(this.settings);
|
||||
}
|
||||
};
|
||||
var Settings = class extends import_obsidian.PluginSettingTab {
|
||||
constructor(app, plugin) {
|
||||
super(app, plugin);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
display() {
|
||||
const { containerEl } = this;
|
||||
containerEl.empty();
|
||||
containerEl.createEl("h2", { text: "General" });
|
||||
new import_obsidian.Setting(containerEl).setName("Page property names are inner links").setDesc("A feature from Logseq, if you hover/click the page property name it'll behave as if it was a link to the page with the same name.").addToggle((toggle) => toggle.setValue(this.plugin.settings.fieldsAreInnerLinks).onChange(async (value) => {
|
||||
this.plugin.settings.fieldsAreInnerLinks = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
const { autolinkPatterns, hideInReaderMode } = this.plugin.settings;
|
||||
containerEl.createEl("h2", { text: "Fields to hide in reader view" });
|
||||
for (let index = 0; index < hideInReaderMode.length; index++) {
|
||||
new import_obsidian.Setting(containerEl).setName("Hidden field #" + (index + 1)).addText((text) => text.setPlaceholder("Field that will be hidden").setValue(hideInReaderMode[index]).onChange(async (value) => {
|
||||
hideInReaderMode[index] = value;
|
||||
await this.plugin.saveSettings();
|
||||
})).addButton((button) => button.setButtonText("-").onClick(async () => {
|
||||
hideInReaderMode.splice(index, 1);
|
||||
this.display();
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
}
|
||||
new import_obsidian.Setting(containerEl).addButton((button) => button.setWarning().setButtonText("Reset").onClick(async () => {
|
||||
this.plugin.settings.hideInReaderMode = [...DEFAULT_SETTINGS.hideInReaderMode];
|
||||
this.display();
|
||||
await this.plugin.saveSettings();
|
||||
})).addButton((button) => button.setButtonText("+").onClick(
|
||||
async () => {
|
||||
hideInReaderMode.push("");
|
||||
this.display();
|
||||
await this.plugin.saveSettings();
|
||||
}
|
||||
));
|
||||
containerEl.createEl("h2", { text: "Autolink Patterns" });
|
||||
for (let index = 0; index < autolinkPatterns.length; index++) {
|
||||
const entry = autolinkPatterns[index];
|
||||
new import_obsidian.Setting(containerEl).setName("Pattern #" + (index + 1)).addText((text) => text.setPlaceholder("Field for the link pattern").setValue(entry.field).onChange(async (value) => {
|
||||
entry.field = value;
|
||||
await this.plugin.saveSettings();
|
||||
})).addText((text) => text.setPlaceholder("The link pattern").setValue(entry.prefix).onChange(async (value) => {
|
||||
entry.prefix = value;
|
||||
await this.plugin.saveSettings();
|
||||
})).addButton((button) => button.setButtonText("-").onClick(async () => {
|
||||
autolinkPatterns.splice(index, 1);
|
||||
this.display();
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
}
|
||||
new import_obsidian.Setting(containerEl).addButton((button) => button.setWarning().setButtonText("Reset").onClick(async () => {
|
||||
this.plugin.settings.autolinkPatterns = [...DEFAULT_SETTINGS.autolinkPatterns];
|
||||
this.display();
|
||||
await this.plugin.saveSettings();
|
||||
})).addButton((button) => button.setButtonText("+").onClick(
|
||||
async () => {
|
||||
autolinkPatterns.push({ field: "", prefix: "" });
|
||||
this.display();
|
||||
await this.plugin.saveSettings();
|
||||
}
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
/* nosourcemap */
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"id": "page-properties",
|
||||
"name": "Page Properties",
|
||||
"version": "1.0.3",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Render page properties similar to Logseq",
|
||||
"author": "Anton Bulakh",
|
||||
"authorUrl": "https://necauqua.dev",
|
||||
"fundingUrl": {
|
||||
"Patreon": "https://www.patreon.com/necauqua",
|
||||
"Ko-Fi": "https://ko-fi.com/necauqua",
|
||||
"Buy Me a Coffee": "https://buymeacoffee.com/necauqua"
|
||||
},
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
|
||||
body {
|
||||
--page-prop-color: var(--tag-color);
|
||||
--page-prop-background: var(--tag-background);
|
||||
--page-prop-border-width: var(--tag-border-width);
|
||||
--page-prop-border-color: var(--tag-border-color);
|
||||
--page-prop-size: var(--tag-size);
|
||||
--page-prop-padding-x: var(--tag-padding-x);
|
||||
--page-prop-padding-y: var(--tag-padding-y);
|
||||
--page-prop-radius: var(--tag-radius);
|
||||
|
||||
--page-prop-hidden-color: hsl(254deg 80% 68% / 50%);
|
||||
}
|
||||
|
||||
/* basically a copy of .tag */
|
||||
/* the :not part is again because of the ordering issue (read below) */
|
||||
:not(.cm-hmd-codeblock) > .page-prop {
|
||||
color: var(--page-prop-color);
|
||||
background-color: var(--page-prop-background);
|
||||
border: var(--page-prop-border-width) solid var(--page-prop-border-color);
|
||||
font-size: var(--page-prop-size);
|
||||
vertical-align: baseline;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
padding-top: var(--page-prop-padding-y);
|
||||
padding-bottom: var(--page-prop-padding-y);
|
||||
}
|
||||
|
||||
/* instead of just .page-prop.page-prop-field and .page-prop.page-prop-content below */
|
||||
/* we have to have a ton of weird matchers because obsidian cm6 decorations always */
|
||||
/* have the highest (or lowest? anyway, it's wrong compared to mine and can't be changed) */
|
||||
/* precedence for some reason */
|
||||
|
||||
:is(div,.markdown-rendered span) > .page-prop.page-prop-field:first-of-type,
|
||||
:is(div,.markdown-rendered span) > *:first-of-type > .page-prop.page-prop-field:first-of-type,
|
||||
:is(div,.markdown-rendered span) > *:empty + :is(.cm-hmd-internal-link,.cm-strong,.cm-em,.cm-highlight,.cm-strikethrough,.cm-comment,.cm-inline-code) > .page-prop.page-prop-field:first-of-type {
|
||||
border-top-left-radius: var(--page-prop-radius);
|
||||
border-bottom-left-radius: var(--page-prop-radius);
|
||||
border-right: none;
|
||||
border-left: var(--page-prop-border-width) solid var(--page-prop-border-color);
|
||||
padding-left: var(--page-prop-padding-x);
|
||||
}
|
||||
|
||||
:is(div,.markdown-rendered span) > .page-prop.page-prop-content:last-of-type,
|
||||
:is(div,.markdown-rendered span) > *:last-of-type > .page-prop.page-prop-content:last-of-type,
|
||||
:is(div,.markdown-rendered span) > :is(.cm-hmd-internal-link,.cm-strong,.cm-em,.cm-highlight,.cm-strikethrough,.cm-comment,.cm-inline-code):has(+ *:empty) > .page-prop.page-prop-content:last-of-type {
|
||||
border-top-right-radius: var(--page-prop-radius);
|
||||
border-bottom-right-radius: var(--page-prop-radius);
|
||||
border-left: none;
|
||||
border-right: var(--page-prop-border-width) solid var(--page-prop-border-color);
|
||||
padding-right: var(--page-prop-padding-x);
|
||||
}
|
||||
|
||||
/* bleaker color for the hidden props */
|
||||
.page-prop.page-prop-hidden {
|
||||
color: var(--page-prop-hidden-color);
|
||||
}
|
||||
|
||||
/* make the field-links only underlined on hover */
|
||||
.page-prop.page-prop-field.internal-link {
|
||||
text-decoration-line: none;
|
||||
}
|
||||
.page-prop.page-prop-field.internal-link:hover {
|
||||
text-decoration-line: var(--link-decoration);
|
||||
}
|
||||
|
||||
/* dont highlight field links as unresolved */
|
||||
.markdown-rendered .page-prop.page-prop-field.internal-link.is-unresolved {
|
||||
color: var(--page-prop-color);
|
||||
opacity: inherit;
|
||||
filter: inherit;
|
||||
text-decoration-style: inherit;
|
||||
text-decoration-color: inherit;
|
||||
}
|
||||
|
||||
/* disable the little icon, it's misplaced interacts weirdly with round */
|
||||
/* corners (but the class is needed for it to be clickable in the editor) */
|
||||
/* second match is for the reader mode */
|
||||
.page-prop.page-prop-content.external-link,
|
||||
.page-prop.page-prop-content > a.external-link {
|
||||
background-image: none;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
/* fixup if *someone* uses an inline code block as a field name */
|
||||
.cm-s-obsidian span.cm-inline-code:has(.page-prop) {
|
||||
font-size: inherit;
|
||||
background-color: inherit;
|
||||
}
|
||||
Reference in New Issue
Block a user