Skip to content

Commit b537d6c

Browse files
magicaldavedependabot[bot]leolazoucbarkrsaberzero1
authored
Update to Quartz 3e14b2b (#49)
* chore(deps): bump rehype-pretty-code from 0.13.0 to 0.13.2 (#1184) Bumps [rehype-pretty-code](https://github.com/rehype-pretty/rehype-pretty-code/tree/HEAD/packages/core) from 0.13.0 to 0.13.2. - [Release notes](https://github.com/rehype-pretty/rehype-pretty-code/releases) - [Changelog](https://github.com/rehype-pretty/rehype-pretty-code/blob/master/packages/core/CHANGELOG.md) - [Commits](https://github.com/rehype-pretty/rehype-pretty-code/commits/[email protected]/packages/core) --- updated-dependencies: - dependency-name: rehype-pretty-code dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump tsx from 4.11.0 to 4.11.2 (#1183) Bumps [tsx](https://github.com/privatenumber/tsx) from 4.11.0 to 4.11.2. - [Release notes](https://github.com/privatenumber/tsx/releases) - [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs) - [Commits](privatenumber/tsx@v4.11.0...v4.11.2) --- updated-dependencies: - dependency-name: tsx dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump @floating-ui/dom from 1.6.3 to 1.6.5 (#1196) Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.6.3 to 1.6.5. - [Release notes](https://github.com/floating-ui/floating-ui/releases) - [Changelog](https://github.com/floating-ui/floating-ui/blob/master/packages/dom/CHANGELOG.md) - [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/[email protected]/packages/dom) --- updated-dependencies: - dependency-name: "@floating-ui/dom" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump preact from 10.20.1 to 10.22.0 (#1195) Bumps [preact](https://github.com/preactjs/preact) from 10.20.1 to 10.22.0. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](preactjs/preact@10.20.1...10.22.0) --- updated-dependencies: - dependency-name: preact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump preact-render-to-string from 6.4.2 to 6.5.4 (#1198) Bumps [preact-render-to-string](https://github.com/preactjs/preact-render-to-string) from 6.4.2 to 6.5.4. - [Release notes](https://github.com/preactjs/preact-render-to-string/releases) - [Changelog](https://github.com/preactjs/preact-render-to-string/blob/main/CHANGELOG.md) - [Commits](preactjs/preact-render-to-string@v6.4.2...v6.5.4) --- updated-dependencies: - dependency-name: preact-render-to-string dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * homepage coloured as visited in the Graph (#1128) simplifies slug from FullSlug to SimpleSlug before storing it in the visited pages list in memory this leads to "index" page and "folder/index", "tags/tag/index" being stored a "/", "folder/" and "tags/tag/" respectively in the list of visited pages. this ensures that the homepage is rightfully coloured as a visited page in the "color" function of the graph * fix: fix explorer view gradient positioning on mobile (fixes #906) (#1206) * .callout-content support (#1188) * .callout-content support * Use BlockContent | FootnoteContent for callout body * Update quartz/plugins/transformers/ofm.ts Co-authored-by: Jacky Zhao <[email protected]> * Refactor * Combine child selectors * Fix multiple callout members * Empty check * Replace splice --------- Co-authored-by: Jacky Zhao <[email protected]> * fix(wikilinks): pdf page linking (#1207) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leo Lazou <[email protected]> Co-authored-by: Callum Barker <[email protected]> Co-authored-by: Emile Bangma <[email protected]> Co-authored-by: Jacky Zhao <[email protected]>
1 parent 89760a4 commit b537d6c

File tree

6 files changed

+49
-41
lines changed

6 files changed

+49
-41
lines changed

package-lock.json

Lines changed: 21 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"dependencies": {
3838
"@clack/prompts": "^0.7.0",
39-
"@floating-ui/dom": "^1.6.3",
39+
"@floating-ui/dom": "^1.6.5",
4040
"@napi-rs/simple-git": "0.1.16",
4141
"async-mutex": "^0.5.0",
4242
"chalk": "^5.3.0",
@@ -58,16 +58,16 @@
5858
"mdast-util-to-hast": "^13.1.0",
5959
"mdast-util-to-string": "^4.0.0",
6060
"micromorph": "^0.4.5",
61-
"preact": "^10.20.1",
62-
"preact-render-to-string": "^6.4.2",
61+
"preact": "^10.22.0",
62+
"preact-render-to-string": "^6.5.4",
6363
"pretty-bytes": "^6.1.1",
6464
"pretty-time": "^1.1.0",
6565
"reading-time": "^1.5.0",
6666
"rehype-autolink-headings": "^7.1.0",
6767
"rehype-citation": "^2.0.0",
6868
"rehype-katex": "^7.0.0",
6969
"rehype-mathjax": "^6.0.0",
70-
"rehype-pretty-code": "^0.13.0",
70+
"rehype-pretty-code": "^0.13.2",
7171
"rehype-raw": "^7.0.0",
7272
"rehype-slug": "^6.0.0",
7373
"remark": "^15.0.1",
@@ -104,7 +104,7 @@
104104
"@types/yargs": "^17.0.32",
105105
"esbuild": "^0.19.9",
106106
"prettier": "^3.2.4",
107-
"tsx": "^4.11.0",
107+
"tsx": "^4.11.2",
108108
"typescript": "^5.4.5"
109109
}
110110
}

quartz/components/scripts/graph.inline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ function renderGlobalGraph() {
361361

362362
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
363363
const slug = e.detail.url
364-
addToVisited(slug)
364+
addToVisited(simplifySlug(slug))
365365
await renderGraph("graph-container", slug)
366366

367367
const containerIcon = document.getElementById("global-graph-icon")

quartz/plugins/transformers/ofm.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { slug as slugAnchor } from "github-slugger"
66
import rehypeRaw from "rehype-raw"
77
import { SKIP, visit } from "unist-util-visit"
88
import path from "path"
9+
import { splitAnchor } from "../../util/path"
910
import { JSResource } from "../../util/resources"
1011
// @ts-ignore
1112
import calloutScript from "../../components/scripts/callout.inline.ts"
@@ -200,10 +201,9 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
200201
src = src.replace(wikilinkRegex, (value, ...capture) => {
201202
const [rawFp, rawHeader, rawAlias]: (string | undefined)[] = capture
202203

203-
const fp = rawFp ?? ""
204-
const anchor = rawHeader?.trim().replace(/^#+/, "")
204+
const [fp, anchor] = splitAnchor(`${rawFp ?? ""}${rawHeader ?? ""}`)
205205
const blockRef = Boolean(anchor?.startsWith("^")) ? "^" : ""
206-
const displayAnchor = anchor ? `#${blockRef}${slugAnchor(anchor)}` : ""
206+
const displayAnchor = anchor ? `#${blockRef}${anchor.trim().replace(/^#+/, "")}` : ""
207207
const displayAlias = rawAlias ?? rawHeader?.replace("#", "|") ?? ""
208208
const embedDisplay = value.startsWith("!") ? "!" : ""
209209

@@ -415,8 +415,8 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
415415
return
416416
}
417417

418-
// find first line
419-
const firstChild = node.children[0]
418+
// find first line and callout content
419+
const [firstChild, ...calloutContent] = node.children
420420
if (firstChild.type !== "paragraph" || firstChild.children[0]?.type !== "text") {
421421
return
422422
}
@@ -493,6 +493,21 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
493493
"data-callout-metadata": calloutMetaData,
494494
},
495495
}
496+
497+
// Add callout-content class to callout body if it has one.
498+
if (calloutContent.length > 0) {
499+
const contentData: BlockContent | DefinitionContent = {
500+
data: {
501+
hProperties: {
502+
className: "callout-content",
503+
},
504+
hName: "div",
505+
},
506+
type: "blockquote",
507+
children: [...calloutContent],
508+
}
509+
node.children = [node.children[0], contentData]
510+
}
496511
}
497512
})
498513
}

quartz/styles/base.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ ul.overflow,
485485
ol.overflow {
486486
max-height: 400;
487487
overflow-y: auto;
488+
position: relative;
488489

489490
// clearfix
490491
content: "";

quartz/styles/callouts.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
transition: max-height 0.3s ease;
1111
box-sizing: border-box;
1212

13-
& > *:nth-child(2) {
13+
& > .callout-content > :first-child {
1414
margin-top: 0;
1515
}
1616

0 commit comments

Comments
 (0)