Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import process from "process";
import builtins from "builtin-modules";
import { config } from "dotenv";
import { sassPlugin } from "esbuild-sass-plugin";
import { copyFileSync, mkdirSync } from "fs";
import { copyFileSync, lstatSync, mkdirSync, readlinkSync } from "fs";
import { resolve } from "path";

config();
Expand All @@ -16,7 +16,27 @@ if you want to view the source, please visit the github repository of this plugi

const prod = process.argv[2] === "production";

const dir = prod ? "./build" : process.env.OUTDIR;
const rawDir = prod ? "./build" : process.env.OUTDIR;

// If rawDir is (or contains) a symlink, resolve it to the real path and
// pre-create the target so esbuild's internal mkdir doesn't fail.
function prepareOutdir(p) {
if (!p) return p;
try {
const stat = lstatSync(p);
if (stat.isSymbolicLink()) {
const linkTarget = readlinkSync(p);
const realTarget = resolve(p, "..", linkTarget);
mkdirSync(realTarget, { recursive: true });
return realTarget;
}
} catch {
// path doesn't exist yet — let esbuild create it normally
}
return p;
}

const dir = prepareOutdir(rawDir);

const options = {
banner: {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "obsidian-admonition",
"name": "Admonition",
"version": "11.0.1",
"minAppVersion": "1.1.0",
"minAppVersion": "1.11.0",
"description": "Enhanced callouts for Obsidian.md",
"author": "Jeremy Valentine, continued by Erin Schnabel",
"authorUrl": "https://github.com/ebullient",
Expand Down
109 changes: 76 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"sass-embedded": "^1.71.1",
"monkey-around": "^2.3.0",
"object.fromentries": "^2.0.8",
"obsidian": "^1.5.7-1",
"obsidian": "^1.11.0",
"tslib": "^2.0.3",
"typescript": "^4.0.3"
},
Expand Down
6 changes: 0 additions & 6 deletions src/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ export interface AdmonitionSettings {
icons: Array<DownloadableIconPack>;
useFontAwesome: boolean;
rpgDownloadedOnce: boolean;
open: {
admonitions: boolean;
icons: boolean;
other: boolean;
advanced: boolean;
};
msDocConverted: boolean;
useSnippet: boolean;
snippetPath: string;
Expand Down
65 changes: 0 additions & 65 deletions src/assets/main.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
:root {
--admonition-details-icon: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http: //www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z'/></svg>");
--admonition-margin-top: 1.5rem;
--admonition-margin-bottom: var(--admonition-margin-top);
--admonition-margin-top-lp: 0px;
Expand Down Expand Up @@ -184,51 +183,6 @@
}
}

details {
& > summary {
outline: none;
display: block !important;
list-style: none !important;
list-style-type: none !important;
min-height: 1rem;
border-top-left-radius: 0.1rem;
border-top-right-radius: 0.1rem;
cursor: pointer;
position: relative;

& > .collapser {
position: absolute;
top: 50%;
right: 0.5rem;
transform: translateY(-50%);
content: "";

& > .handle {
transform: rotate(0deg);
transition: transform 0.25s;
background-color: currentColor;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-size: contain;
-webkit-mask-image: var(--admonition-details-icon);
mask-image: var(--admonition-details-icon);
width: 20px;
height: 20px;
}
}
}
}

details[open] {
& > summary {
& > .collapser {
& > .handle {
transform: rotate(90deg);
}
}
}
}
}

.setting-item {
Expand Down Expand Up @@ -399,11 +353,6 @@
border-color: var(--background-modifier-border-focus);
}

.admonition-settings details > summary::-webkit-details-marker,
.admonition-settings details > summary::marker {
display: none !important;
}

.admonition-setting-warning {
display: flex;
gap: 0.25rem;
Expand All @@ -414,20 +363,6 @@
}
}

.admonitions-nested-settings {
padding-bottom: 18px;

.setting-item {
border: 0;
padding-bottom: 0;
}
}

.admonitions-nested-settings[open] .setting-item-heading,
.admonitions-nested-settings:not(details) .setting-item-heading {
border-top: 0;
border-bottom: 1px solid var(--background-modifier-border);
}

.is-live-preview .admonition-content ul,
.is-live-preview .admonition-content ol {
Expand Down
6 changes: 0 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ const DEFAULT_APP_SETTINGS: AdmonitionSettings = {
parseTitles: true,
dropShadow: true,
hideEmpty: false,
open: {
admonitions: true,
icons: true,
other: true,
advanced: false,
},
icons: [],
useFontAwesome: true,
rpgDownloadedOnce: false,
Expand Down
Loading