aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src
diff options
context:
space:
mode:
Diffstat (limited to 'nuldoc-src')
-rw-r--r--nuldoc-src/commands/build.ts14
-rw-r--r--nuldoc-src/pages/slide.ts21
-rw-r--r--nuldoc-src/pages/tag.ts10
-rw-r--r--nuldoc-src/renderers/html.ts6
4 files changed, 50 insertions, 1 deletions
diff --git a/nuldoc-src/commands/build.ts b/nuldoc-src/commands/build.ts
index 8961da9..38af80a 100644
--- a/nuldoc-src/commands/build.ts
+++ b/nuldoc-src/commands/build.ts
@@ -32,6 +32,7 @@ export async function runBuildCommand(config: Config) {
await buildAboutPage(config);
await buildNotFoundPage(config);
await copyStaticFiles(config);
+ await copyAssetFiles(slides, config);
}
async function buildPostPages(config: Config): Promise<PostPage[]> {
@@ -182,6 +183,19 @@ async function copyStaticFiles(config: Config) {
}
}
+async function copyAssetFiles(slides: SlidePage[], config: Config) {
+ const cwd = Deno.cwd();
+ const contentDir = join(cwd, config.locations.contentDir);
+ const destDir = join(cwd, config.locations.destDir);
+
+ for (const slide of slides) {
+ const src = join(contentDir, slide.slideLink);
+ const dst = join(destDir, slide.slideLink);
+ await ensureDir(dirname(dst));
+ await Deno.copyFile(src, dst);
+ }
+}
+
async function writePage(page: Page, config: Config) {
const destFilePath = join(
Deno.cwd(),
diff --git a/nuldoc-src/pages/slide.ts b/nuldoc-src/pages/slide.ts
index fdfe868..2b7e202 100644
--- a/nuldoc-src/pages/slide.ts
+++ b/nuldoc-src/pages/slide.ts
@@ -90,6 +90,27 @@ export async function generateSlidePage(
),
),
),
+ el(
+ "canvas",
+ [["id", "slide"], ["data-slide-link", slide.slideLink]],
+ ),
+ el(
+ "div",
+ [],
+ el("button", [["id", "prev"]], text("Prev")),
+ el("button", [["id", "next"]], text("Next")),
+ ),
+ el(
+ "script",
+ [[
+ "src",
+ "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.4.120/pdf.min.js",
+ ]],
+ ),
+ el(
+ "script",
+ [["src", "/slide.js"], ["type", "module"]],
+ ),
),
),
),
diff --git a/nuldoc-src/pages/tag.ts b/nuldoc-src/pages/tag.ts
index dd7a5c0..3c1421f 100644
--- a/nuldoc-src/pages/tag.ts
+++ b/nuldoc-src/pages/tag.ts
@@ -39,7 +39,15 @@ export async function generateTagPage(
el(
"header",
[["class", "entry-header"]],
- el("h2", [], text("event" in page ? `登壇: ${page.event} (${page.talkType})` : page.title)),
+ el(
+ "h2",
+ [],
+ text(
+ "event" in page
+ ? `登壇: ${page.event} (${page.talkType})`
+ : page.title,
+ ),
+ ),
),
el(
"section",
diff --git a/nuldoc-src/renderers/html.ts b/nuldoc-src/renderers/html.ts
index 94d134b..6cf632c 100644
--- a/nuldoc-src/renderers/html.ts
+++ b/nuldoc-src/renderers/html.ts
@@ -29,6 +29,10 @@ function getDtd(name: string): Dtd {
return { type: "block" };
case "br":
return { type: "block", auto_closing: true };
+ case "button":
+ return { type: "block" };
+ case "canvas":
+ return { type: "block" };
case "code":
return { type: "inline" };
case "div":
@@ -73,6 +77,8 @@ function getDtd(name: string): Dtd {
return { type: "block" };
case "pre":
return { type: "block" };
+ case "script":
+ return { type: "block" };
case "section":
return { type: "block" };
case "span":