From 223a9567041822f4430099524a4b0e8ff3e6957c Mon Sep 17 00:00:00 2001 From: vrugtehagel Date: Tue, 16 Jul 2024 12:02:48 +0200 Subject: [PATCH] Add more symbol docs --- deno.json | 2 +- src/index.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/deno.json b/deno.json index c5935bc..22f24e4 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@vrugtehagel/eleventy-document-outline", - "version": "0.1.3", + "version": "0.1.4", "exports": "./mod.ts", "publish": { "include": ["src/**", "mod.ts", "README.md"] diff --git a/src/index.ts b/src/index.ts index 04a3def..535543a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,6 +19,9 @@ function RenderPluginForEleventyDocumentOutline(config: EleventyConfig) { }); } +/** The main plugin. Add this with `eleventyConfig.addPlugin(…);` Options are + * all optional - see the `EleventyDocumentOutlineOptions` type for more + * information. */ export function EleventyDocumentOutline( config: EleventyConfig, options: EleventyDocumentOutlineOptions = {}, @@ -145,6 +148,10 @@ export function EleventyDocumentOutline( return result; }); + /** This may not run if the build fails for some reason or another, but it + * should be okay since we use the same `tmpDir` on subsequent runs. In other + * words, the next successful run will delete the temporary directory + * properly. */ config.events.addListener("eleventy.after", async () => { await fs.rm(tmpDir, { recursive: true, force: true }); });