Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(web): drop the repeated note title from PDF page headers

tianma-if5c77cfcbf187
diff --git a/apps/web/src/styles/note-print.css b/apps/web/src/styles/note-print.css
index 9669e54c..7c992381 100644
--- a/apps/web/src/styles/note-print.css
+++ b/apps/web/src/styles/note-print.css
@@ -2,13 +2,6 @@
size: A4;
margin: 18mm 17mm 20mm;
- @top-center {
- content: string(edgeever-note-title);
- color: #64748b;
- font-family: "Noto Sans SC Variable", sans-serif;
- font-size: 8.5pt;
- }
-
@bottom-center {
content: counter(page) " / " counter(pages);
color: #64748b;
@@ -17,14 +10,6 @@
}
}
-/* The note title is already the first-page heading. A running header there
- repeats the same text above it. Later pages still carry the title. */
-@page :first {
- @top-center {
- content: none;
- }
-}
-
* {
box-sizing: border-box;
}
@@ -45,7 +30,6 @@
}
.edgeever-print-title {
- string-set: edgeever-note-title content(text);
margin: 0 0 4mm;
color: #0f172a;
font-size: 24pt;
diff --git a/apps/web/src/styles/note-print.test.mjs b/apps/web/src/styles/note-print.test.mjs
index c4d29522..730a9af9 100644
--- a/apps/web/src/styles/note-print.test.mjs
+++ b/apps/web/src/styles/note-print.test.mjs
@@ -3,21 +3,11 @@ import { describe, expect, test } from "bun:test";
const css = readFileSync(new URL("./note-print.css", import.meta.url), "utf8");
-const pageRule = (selector) => {
- const marker = `@page${selector} {`;
- const start = css.indexOf(marker);
- expect(start).toBeGreaterThanOrEqual(0);
- const end = css.indexOf("\n}", start);
- return css.slice(start, end);
-};
-
-describe("note print running header", () => {
- test("repeats the note title from the second page onward", () => {
- expect(pageRule("")).toContain("content: string(edgeever-note-title)");
- expect(css).toContain("string-set: edgeever-note-title content(text)");
- });
-
- test("leaves the first page header empty so it does not repeat the title", () => {
- expect(pageRule(" :first")).toMatch(/@top-center\s*\{[^}]*content:\s*none;/s);
+describe("note print page margin", () => {
+ test("keeps the page number and leaves the note title off the page header", () => {
+ expect(css).toContain('content: counter(page) " / " counter(pages)');
+ expect(css).not.toContain("@top-center");
+ expect(css).not.toContain("edgeever-note-title");
+ expect(css).not.toContain("string-set:");
});
});