Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update vitepress, fix a build crash, add a sitemap #1809

Merged
merged 3 commits into from
Aug 16, 2023
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
3 changes: 3 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export default defineConfig({
["script", {async: "", src: "https://www.googletagmanager.com/gtag/js?id=G-9B88TP6PKQ"}],
["script", {}, "window.dataLayer=window.dataLayer||[];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js',new Date());\ngtag('config','G-9B88TP6PKQ');"]
],
sitemap: {
hostname: 'https://observablehq.com/plot'
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
// Theme related configurations.
Expand Down
5 changes: 5 additions & 0 deletions docs/components/PlotRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ class Element {
dispatchEvent() {
// ignored; interaction needs real DOM
}
append(...children) {
for (const child of children) {
this.appendChild(child?.ownerDocument ? child : this.ownerDocument.createTextNode(child));
}
}
appendChild(child) {
this.children.push(child);
child.parentNode = this;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"ts-morph": "^19.0.0",
"typescript": "^5.0.2",
"vite": "^4.0.0",
"vitepress": "^1.0.0-beta.2"
"vitepress": "^1.0.0-rc.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn’t strictly necessary (we could have upgraded vitepress with just yarn upgrade and changing the yarn.lock file. But I guess since we’re using the sitemap feature added in beta.7, this is okay. The point being, 1.0.0-rc.4 is already consistent with ^1.0.0-beta.2.

},
"dependencies": {
"d3": "^7.8.0",
Expand Down
4 changes: 2 additions & 2 deletions src/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,13 @@ export function plot(options = {}) {
function createTitleElement(document, contents, tag) {
if (contents.ownerDocument) return contents;
const e = document.createElement(tag);
e.append(document.createTextNode(contents));
e.append(contents);
return e;
}

function createFigcaption(document, caption) {
const e = document.createElement("figcaption");
e.append(caption.ownerDocument ? caption : document.createTextNode(caption));
e.append(caption);
return e;
}

Expand Down
Loading