Skip to content
Search
Search the documentation
Svelte DocSmith
GitHub

Changelog

What shipped in each release.

Subscribe via Atom

0.29.1

Patch Changes

  • An internal restructuring that fixes several places where two parts of the framework read the same thing differently.

    • The table of contents rendered on the server now links to the ids the page really has. It used to read headings its own way, so ## my_prop linked to #myprop, a heading repeated at another level was numbered differently from the page, a heading inside a list was missing, and a line starting with ## inside an HTML block was listed as a heading.
    • Every reader event now carries the same path for a page: the current path without a trailing slash. copy_code and not_found used to send the raw path, so with trailingSlash on a handler saw one page as two.
    • A doc page is a +page file in any extension listed in markdown.extensions, everywhere: the indexes, the dev watcher, the broken-link check and archive-version now all follow the option. A +page.svx is no longer indexed unless .svx is listed.
    • svelte-docsmith theme and the OG image colours read a theme file the way the plugin does, through comments, @layer and repeated blocks. The command takes any file that sets a custom property in :root or .dark.
    • Agent markdown for a page with CRLF line endings keeps them throughout, and its <SectionCards /> are written out.
    • A frontmatter typo warning prints once per read of the docs instead of once per generated module.
    • The outside export of svelte-docsmith/site is typed readonly string[], as the option is.

0.29.0

Minor Changes

  • Three new docs components. Anatomy labels the parts of a live component: mark each part with data-part="name" and describe it with a <Part name="name"> in the parts snippet. The numbered labels sit over the real component, follow it as it changes size or state, let clicks through, and can be hidden. A data-part with no Part, or a Part with no data-part, warns in development. Compare shows two versions of one thing split by a divider the reader drags or moves with the arrow keys; each side is a picture (an imported file or a URL) or a snippet of live content, labelled "Before" and "After" unless you name them. SectionCards lists the pages of a section as cards in sidebar order, the page's own section by default or another with section, and agent markdown writes the list out as links.

0.28.0

Minor Changes

  • Generated props tables now say when things arrived and what is inside an object prop. A prop tagged @since 0.3 gets a "since 0.3" badge on its row, and @since in the component's <!-- @component --> comment goes on the caption. A prop typed with one of the library's own object types opens into its fields under a collapsed Fields toggle, each with its type, @default and description, nested as deep as the type goes. A list opens into its item's fields, and a union of objects shows each shape under its name. Library types, Snippet and HTML attributes stay closed, and a type that refers to itself stops where it repeats. Agent markdown gets a Since column when any row has one, and a row per field named by its path (options.delay). Hand-written Prop rows take since and a fields snippet too.

    Pages take a since frontmatter field, shown in the page header and in the page's agent markdown. A page whose since names the newest release in the site's changelog (0.15 matches 0.15.2) gets a dot in the sidebar.

0.27.0

Minor Changes

  • Three new docs components for design-system docs. Columns sets content side by side in two or three columns (<Columns cols={3}>), stacking into one on phones. Do and Dont are panels for guidelines, with a coloured top edge and a "Do" or "Don't" label in words and an icon; their colours are the new --docsmith-do and --docsmith-dont theme tokens. ColorSwatch shows any CSS colour with its name and the value it resolves to in the current colour mode (<ColorSwatch value="var(--brand)" />), and ColorSwatches lays them out in a grid. See the new Columns, Do & Don't and Colour swatches pages.

  • Three new things for doc pages. Images: a markdown image on its own line is now drawn as a figure with its title as the caption, and any image shown smaller than its real size zooms to full size on click. A path starting ./ or ../ is a file next to the page: DocSmith imports it so Vite serves it, and a missing file fails the build naming the page and the path. The new Image component takes a second picture for dark mode (<Image src={light} dark={dark} alt="…" caption="…" />). Install blocks: add pkg after a fence's language (```bash pkg) and write npm commands; readers get pnpm, npm, yarn and bun tabs synced with every syncKey="pkg" group, and agent markdown carries all four. Math: with docsmith({ markdown: { math: true } }), $…$ and $$…$$ become MathML at build time, with no client script or fonts; it needs the new optional peer dependency temml, and search leaves formulas out. Under a custom mdsvex layout, images stay plain and an install block shows its npm commands. See the new Image and Math pages, and Install commands on Code blocks.

  • Two new docs components. Tooltip puts a short note on a word or phrase in a sentence (<Tooltip note="Hot module replacement">HMR</Tooltip>). It opens on hover and keyboard focus, and on tap on a touch screen; a click keeps it open, and Escape closes it. Video plays a video file with native controls, a poster and a .vtt captions track. loop plays a clip like a GIF: muted, looping, with no controls and a pause button, and its captions on. Under reduced motion it waits on its poster until the reader presses play. Given a YouTube watch, short, Shorts, live or embed link, it shows the thumbnail and loads the player from youtube-nocookie.com only when the reader presses play. See the new Tooltip and Video pages.

Patch Changes

  • Fixes for Columns, Do and Dont, and colour swatches. A ColorSwatch whose variable has a fallback with brackets, like var(--brand, oklch(0.5 0.1 200)), is named by the variable again. Its value is read again when the value prop changes, a token derived with color-mix() shows the colour it comes out as, and a site that marks dark mode with an attribute such as data-theme on html, or that follows the system setting, updates the swatches too. Columns stack below Tailwind's sm breakpoint, so a site that changes it moves Columns with it. The Do and Dont colours keep their --docsmith-do and --docsmith-dont names, but their defaults now live in the component rather than in theme.css.

  • Fixes for images, install blocks and math. With math on, Svelte store reads like {$a} and {$b} are no longer read as a formula, a heading with a formula gets the same anchor the table of contents links to, and search keeps the text of inline code that holds a $. An image file whose name has spaces or non-ASCII characters is found next to the page, and an image inside a link no longer zooms, so clicking it follows the link. Install blocks are written out for agents in pages with CRLF line endings, and a pkg inside a fence's quoted title is left in the title.

0.26.0

Minor Changes

  • Replace parts of DocsShell with overrides. Pass a sidebar, toc, pageHeader or pager snippet and it renders in place of the built-in part: the sidebar receives { nav }, the table of contents { items, activeId }, the page header (breadcrumbs, reading time and Copy page) { path, breadcrumbs, readingMinutes, copyPage }, and the pager { prev, next }. The built-in parts are now exported as Sidebar, TableOfContents, PageHeader and Pager, each taking exactly what its snippet receives, so an override can wrap the default ({#snippet sidebar(props)}<Sidebar {...props} /><SponsorCard />{/snippet}). The shell keeps each part's place: the sticky columns stay, and the sidebar and table-of-contents overrides also fill the mobile menu and "On this page" popover. The prop types (SidebarProps, TableOfContentsProps, PageHeaderProps, PagerProps) and what they carry (NavGroup, NavItem, NavNode, Breadcrumb, TocItem, isNavGroup) are exported too. Overrides are inside the 1.0 promise. See the new Overrides page.

  • Send what readers do in your docs to the analytics you already use. Name a handler module with docsmith({ readerEvents: './src/lib/reader-events.ts' }) and its default export receives every reader event, in the browser only: feedback (a "Was this page helpful?" vote), feedback_link (the edit or issue link after a "No" vote), search (once per time the palette opens, with the query, the result count and the page picked or null), not_found (a 404 on ErrorPage, with the referrer), page_action (each Copy page menu item, MCP setup included) and copy_code (with the language, from a fence or a live example). Every event has a snake_case type and the page path, so posthog.capture(event.type, event) forwards it as is. The library itself still sends nothing anywhere, and a handler that throws is logged without breaking the page. Type the handler with the new ReaderEventHandler export; ReaderEvent and each event's type are exported too. Code blocks now pass their fence language to the pre component as language.

    DocsShell's feedback now only shows or hides the widget. Passing a callback (feedback={(vote, path) => …}) still works, alongside the feedback reader event, but is deprecated and stops working in the next minor: move it into your handler. See the new Reader events page.

0.25.0

Minor Changes

  • Give every doc page its own OG image. ogImages() from svelte-docsmith/server draws a 1200×630 PNG per page at build time: the site title, the page's section, title and description, and the site's host, in your theme's colours (read from the theme file, so it matches any preset or theme file of your own). Add it as src/routes/og/[...slug].png/+server.ts with export const { GET, entries } = ogImages(), set site.ogImages: '/og', and DocsShell points each doc page's og:image and twitter:image at its own image. Pages that aren't doc pages keep site.ogImage. The images are drawn with satori and @resvg/resvg-js, new optional peer dependencies: install them in the docs app to use this, and nothing changes for sites that don't.

0.24.1

Patch Changes

  • The header's GitHub star count now shows up even when the build can't fetch it. Shared build machines (Vercel, Netlify, GitHub Actions) often hit GitHub's unauthenticated rate limit, which left sites without a count unless they set GITHUB_TOKEN. Now, when the build has no count, each reader's browser asks GitHub itself, once, and caches the answer for a day, so it stays within every reader's own allowance. Setting GITHUB_TOKEN still bakes the count into the build and skips the browser request, and site.githubStars: false turns both off.

0.24.0

Minor Changes

  • Show your repo's GitHub star count in the header. When site.github is a https://github.com/owner/repo URL, the header GitHub link now shows the count (1.2k, with the exact number in its accessible name) on desktop and tablet, and stays a bare icon on phones. The plugin fetches it from the GitHub API once per build and once per vite dev start, sending GITHUB_TOKEN when it is set, so readers' browsers never call GitHub. A failed fetch logs a warning and leaves the count off, never failing the build. Set site.githubStars: false to turn it off. The count is also exported as githubStars from svelte-docsmith/site for pages of your own.

0.23.0

Minor Changes

  • Add svelte-docsmith theme, the other half of the new theme builder at /themes. Run it from your docs app: it opens the builder, and when you press "Send to my project" it writes the theme to src/theme.css and sets theme in your docsmith() call. If the browser can't reach the terminal (a container, SSH), paste the code the builder shows at the prompt instead. --link <theme link> writes a shared theme link straight into the project, and --file, --config, --builder and --no-open adjust the rest. The theme link format is documented on /docs/theming for agents.

0.22.0

Minor Changes

  • Choose the theme in docsmith(), and let code blocks follow it. A theme is now the whole look in one CSS file, colours, radius, fonts, shadows and code colours for light and dark, and docsmith({ theme }) picks it: a preset name or a path to a theme file of your own. A theme file is a :root and a .dark block of tokens, the shape tweakcn and shadcn export, so a tweakcn theme works pasted as it is (its @theme inline block is ignored). The plugin adds the theme to the stylesheet svelte-docsmith/theme.css compiles into, in the base layer, so every page that imports it is themed on first paint and a token you redefine in app.css wins whatever order the imports are in. Edits to a theme file hot-update in vite dev. An unknown preset name or a missing theme file fails when Vite starts.

    // vite.config.ts
    docsmith({
    	site: { title: 'My Library' },
    	theme: 'ocean' // or './src/theme.css'; default 'darkmatter'
    });
    

    Code blocks now read --code-* tokens, so they match the theme in both colour modes, and switching theme recolours them with no rebuild. Every preset sets its own syntax colours, each readable on its background, and a theme without them gets colours mixed from its palette. codeTheme: { light, dark } names an exact Shiki pair instead and renders as before. The presets based on a tweakcn theme now carry that theme's shadows too.

    ThemeProvider and ThemeToggle are renamed ModeProvider and ModeToggle, since they control light and dark rather than the theme, and the themes option is renamed codeTheme. create-svelte-docsmith writes the chosen preset into vite.config.ts as theme instead of importing it in app.css.

    Upgrading: move a preset import from app.css to the option: @import 'svelte-docsmith/themes/ocean.css'; becomes theme: 'ocean'. The old import keeps working, as it is plain CSS that wins over the default, but the option is now the documented way. theme.css no longer carries colours of its own, so it needs the docsmith() plugin to look right, as the rest of the shell already does. Code blocks change colour by default, because they follow the theme: set codeTheme: { light: 'github-light', dark: 'github-dark' } to keep the old look. themes, ThemeProvider and ThemeToggle still work, with a deprecation notice for themes, and are removed in the next minor; setting both themes and codeTheme fails at startup. See https://docsmith.geodask.com/docs/theming.

0.21.0

Minor Changes

  • Check the links doc pages write, and declare outside paths. vite build now checks every link a doc page writes to a path under the docs base, markdown [text](href) and raw <a href> alike, relative links included, against the pages of every version, anchors included. It prints one report of every broken link, with its file, line and what is wrong (no page at /docs/x, or no anchor #y on /docs/x with the anchors that page has), then fails. vite dev prints the same report as a warning, and again whenever a page changes the set of broken links, but never fails. Links outside the docs base, to other origins, in code and in Svelte expressions are left alone.

    For paths that something other than the app serves on the same origin, such as a Cloudflare Worker in front of a static build or a reverse proxy, declare them as outside paths: links: { outside: ['/playground'] }. A link to one is never a broken link, and DocSmith marks it rel="external" in doc pages and in the shell's nav, footer and announcement links, so SvelteKit's crawler skips it during prerender and a click loads it from the server. A doc page under an outside path fails the build. svelte-docsmith/site now also exports outside, the resolved outside paths.

    // vite.config.ts
    docsmith({
    	site: { title: 'My Library' },
    	links: {
    		broken: 'error', // the default; or 'warn', or 'ignore'
    		outside: ['/playground']
    	}
    });
    

    Upgrading: the check is on by default with broken: 'error', so the first build after upgrading can fail on links that were already broken. Set links: { broken: 'warn' } to build while you fix them, then remove it. If the report lists links to paths a Worker or proxy serves, add those prefixes to links.outside rather than turning the check off. An invalid links.broken or links.outside value now fails when Vite starts. A test that mocks svelte-docsmith/site with only { site } and renders the shell must add outside: [] to the mock. See https://docsmith.geodask.com/docs/links.

0.20.3

Patch Changes

  • Resolve the page chrome once for both headers. The header links and which one is current, the archived-version banner, the feedback issue link and the canonical URL now come from the same resolved page view as the sidebar and breadcrumbs, and the desktop and mobile headers both read it. This fixes two places where the mobile header disagreed with the desktop one: its menu now marks the current section's link with aria-current="page", and it shows site.logo instead of always falling back to the book icon. The feedback issue link also no longer doubles the slash when site.github ends in one.

  • Harden the page chrome. Two site.nav links, or two footer links or columns, that share an href or a title no longer crash the header or footer render. The feedback widget's "open an issue" link now keeps only the owner and repository of site.github, so a URL with .git, a subpath like /tree/main, a query or a hash still opens the issue form; an account or org URL, a git+https: URL or a value that isn't a URL shows no issue link instead of a broken one. The head tags and the footer now read the site config and the resolved page directly, like the headers, and site.logo takes the same classes as the built-in mark.

  • Move the props playground's state into one module, separate from LiveExample and its controls. No API change; controls and args work as before. These behavior changes come with it:

    • The usage line lists props in the order the component declares them, instead of the order they were first set.
    • A number control treats Infinity (say, 1e999 typed in) as unset, like any other value that isn't a finite number.
    • Swapping the props import passed to controls now starts a fresh playground for it, instead of keeping the previous component's values.
  • Share the props table rules between the page and agent markdown. One props reference module decides what a generated props table says (the caption, each prop row with its deprecation note and description, the inherited attributes notes and the "No props." case), and <PropsTable of={…}> and the agent markdown writer only render it, so the two can no longer drift. The playground's control tooltips take their plain-text description from the same module. No change to what pages, llms-full.txt, the .md twins or the MCP server serve.

  • Fix three small props table quirks. A @deprecated tag with more than one paragraph now reads "Deprecated: …" as one sentence on the page, as it already did in agent markdown, instead of a bare "Deprecated:" above the paragraphs. A props playground control's tooltip keeps line breaks where the description has a <br>, a new paragraph or a list item, instead of running the words together. It also decodes numeric character references (&#8212;, &#x2014;) and common named ones (&nbsp;, &mdash;) instead of showing them literally.

    • Fixing a broken tsconfig.json now brings props tables' types back in vite dev. Before, a props table read while TypeScript couldn't be set up kept showing names only until its component file changed or the server restarted.
    • archive-version now escapes quotes in the versions block it prints, so a label like Bob's 1.x pastes as valid code.
    • The frontmatter typo warning no longer reads a built-in key with one letter in front as a typo (border is not order), and it skips any custom key your schema declares.

0.20.2

Patch Changes

  • Build agent markdown and the llms index in one module. No change to what llms.txt, llms-full.txt, the .md twins or the MCP server serve: the docs site's prerendered output is byte-for-byte the same.

  • Give doc imports one home. ?source and ?props are each one module with a page side and an agent side, served by one Vite plugin, and props are read through one reader that owns the shared extractor, file watching and warning once. Two concurrent reads of one component now share one extraction, so its warnings can no longer be reported twice. No change to what pages, llms-full.txt, the .md twins or the MCP server serve: the docs site's prerendered output and client bundle are byte-for-byte the same.

0.20.1

Patch Changes

  • Move the search palette's state into one search session, separate from the dialog. No API change; DocsShell's search loader works as before. These behavior changes come with it:

    • A search loader that keeps failing no longer retries in a tight loop while the palette is open. It shows "Search is unavailable" and tries again the next time the palette opens.
    • After a version switch, the palette never shows the previous version's results or suggestions while the new version's index loads, and a load that finishes after the reader has moved on is dropped.
    • A loader that returns every version's records (like the default svelte-docsmith/search export) now builds an index over the active version only, instead of indexing every version and filtering the hits.
    • The palette keeps one index per version it has searched, so switching back to a version is instant instead of reloading it, even if its earlier load was interrupted or another version's load failed.

0.20.0

Minor Changes

  • Breaking: the whole site is now configured in one docsmith() call in vite.config.ts. The markdown preprocessor and defineConfig are gone: docsmith() compiles your .md pages itself and serves the site config to DocsShell, ErrorPage and the route handlers, so nothing takes it as an argument anymore. Code block themes are set once for markdown fences and LiveExample source alike, and svelte-docsmith archive-version reads your docs directory and versions from the same options, then prints the exact versions block to paste.

    To migrate:

    1. Move the contents of defineConfig({...}) (usually src/lib/site-config.ts) into docsmith({ site: {...} }) and delete the file. The site config is now plain data checked when Vite starts.
    2. Remove the svelte-docsmith/preprocess import and its entry from preprocess. Move its options under markdown (langs, twoslash, lineNumbers, layout, extensions, remarkPlugins, rehypePlugins), except themes, which moves to the top level and now covers ?source too. Keep extensions: ['.svelte', '.md'] in SvelteKit's config.
    3. Replace changelog: 'path' and changelogPath: '/route' with changelog: { file: 'path', path: '/route' }.
    4. Drop config={siteConfig} from DocsShell and ErrorPage, and the argument from the route handlers: sitemap({ extra }), changelogFeed(), llmsTxt(), llmsFullTxt(), mcpServer(). A page of your own that needs the config imports { site } from svelte-docsmith/site.
    5. Run archive-version from your docs app. --content and --routes are gone; pass --config <file> if your vite config is somewhere else.
    // vite.config.ts
    docsmith({
    	site: { title: 'My Library', url: 'https://my-library.dev', nav: [/* … */] },
    	themes: { light: 'github-light', dark: 'github-dark' },
    	markdown: { twoslash: true },
    	changelog: { file: '../../packages/my-lib/CHANGELOG.md' }
    });
    

    The renamed types: DocsmithConfig is now DocsmithSite, and svelte-docsmith/vite exports DocsmithOptions (was DocsmithViteOptions), DocsmithMarkdownOptions and DocsmithChangelogOptions. RouteSite is gone from svelte-docsmith/server.

0.19.1

Patch Changes

  • Fix a build error when a code fence's title contains a double quote, and a fence title with {braces} no longer turns into a Svelte expression: title='say "hi" to {name}.ts' now shows exactly that. Markdown fences and ?source imports now go through one code block renderer, so a LiveExample's source panel also honours the [!code …] notation comments a fence does.

0.19.0

Minor Changes

  • Add svelte-docsmith/server, with ready route handlers for the files a docs site serves besides its pages: sitemap, changelogFeed, llmsTxt, llmsFullTxt, agentMarkdown (the <path>.md twins) and mcpServer. Each reads the generated indexes itself, keeps to the current version where that applies, and takes your defineConfig result, so a route is one line:

    // src/routes/sitemap.xml/+server.ts
    import { sitemap } from 'svelte-docsmith/server';
    import { siteConfig } from '$lib/site-config';
    
    export const prerender = true;
    export const GET = sitemap(siteConfig, { extra: [{ path: '/' }] });
    

    svelte-docsmith/content now also exports content, the pages and the version manifest together, and DocsShell and ErrorPage take it as their content prop (<DocsShell {content}>), so a page can no longer pass the pages without the versions. The bare docs array plus versions still works, and versions is deprecated. svelte-docsmith/changelog also exports changelogPath, so the feed links where the plugin dated the releases.

    Breaking: generateSitemap, generateFeed, generateLlmsTxt, generateLlmsFullTxt, currentOnly and mcpHandler, along with the LlmsSite, FeedSite and McpOptions types, are no longer exported from svelte-docsmith. Replace each route with its handler from svelte-docsmith/server; see the SEO, Changelog and MCP server pages.

0.18.0

Minor Changes

  • llms.txt, llms-full.txt and the MCP server's list_pages now follow the sidebar's reading order exactly. Pages that share an order sort by title instead of by path, a nested section's heading (Guides / Advanced) comes right after its parent's, blank section segments are ignored, and llms-full.txt reads in the same page order as the sidebar. LlmsDoc.section is now the section as written (string | string[]), the same as DocsContentItem.section, instead of a path joined with /.

0.17.0

Minor Changes

  • Add a props playground to LiveExample (experimental): pass a props import as controls and the example gets a control for each prop whose type allows one, with the current values passed to its children snippet, a reset button and a copyable usage line. args sets the starting values.

0.16.0

Minor Changes

  • Serve your docs to coding agents with mcpHandler(), and write generated props tables and example code into agent markdown (experimental).

0.15.0

Minor Changes

  • Validate page frontmatter, with an optional schema, and expose custom fields as data on content entries.

  • Generate props tables from component types with <PropsTable of={…}> and a ?props import (experimental).

0.14.0

Minor Changes

  • Support SvelteKit 3. svelte-docsmith now accepts @sveltejs/kit ^2.16.0 || ^3.0.0 as its peer, so existing SvelteKit 2 sites keep working unchanged. New projects from create-svelte-docsmith start on SvelteKit 3: configuration lives in vite.config.ts (sveltekit({ extensions, preprocess, adapter })) and your own files are imported from #lib. The archive notice now also lists #lib imports.

Patch Changes

  • Upgrade dependencies, including Shiki 4, js-yaml 5 and tailwind-variants 4. Mermaid 12 is now accepted as the optional peer. An unquoted lastUpdated: 2024-01-02 in frontmatter is now honoured instead of being ignored, and the copy-page menu no longer imports $app/environment, which SvelteKit 3 renames.

0.13.1

Patch Changes

  • Refine docs chrome edges and ship the full typeface stack:

    • Self-host JetBrains Mono from theme.css so code faces match without a separate Google Fonts link
    • Theme toggle labels the destination mode (Switch to light/dark mode)
    • Search empty state lists suggested starter pages once the index loads
    • Prev/next cards get directional chevrons and a light primary hover fill
    • Mobile header includes the GitHub control when configured
    • Background pattern grid lines follow the --border token so presets stay coherent
    • Sidebar hover is quieter than the active state on dense trees
  • Polish the docs chrome and landing sections for reading measure, identity, and recovery:

    • Ship Source Serif 4 with theme.css and apply it on landing display headings (Hero, FeatureGrid, CTA); land body copy on foreground ink
    • Cap markdown articles at max-w-prose so body measure stays ~65ch on wide screens
    • Make breadcrumbs navigable: group steps link to the group's first page
    • After a "No" on page feedback, offer Edit this page and Open an issue when configured
    • Label the mobile table-of-contents control ("On this page") instead of an icon-only button
    • Add an optional before snippet on CTA so notes can sit above the heading while the section still ends on the actions

0.13.0

Minor Changes

    • Report the pages an archive copies that import across the freeze boundary, so archive-version says out loud when a frozen page will keep resolving to current code
    • The notice names each page and the specifiers it crosses on ($lib, bare npm packages, relative paths that climb out of the docs root), and is informational: the archive is still written and the config block still printed

Patch Changes

    • Document every package export and the features they power (versioning, changelog/feed, mermaid, landing sections, generators, archive CLI) so the README matches what ships
    • Use the full git+https:// form for repository.url so publint stays quiet
  • Omit git-derived page dates on a shallow clone instead of dating every page the same day. A shallow history makes the walk look successful while stamping every file with the tip commit, which turns sitemap <lastmod> into uniform noise. The build warns and leaves lastUpdated unset (frontmatter still wins); use a full clone (fetch-depth: 0) when real dates matter.

    • Document the 1.0 stability promise: which surface ordinary semver will cover, and that versioning (DocsVersions, currentOnly, archive marker, archive-version) stays experimental outside it

0.12.2

Patch Changes

    • Scope the code block styles to the component's own <pre>, so they no longer restyle unrelated code blocks in the consuming app
    • Fix the layout shift when hovering a link, caused by those styles arriving with a preloaded route and repainting code blocks the component never rendered

0.12.1

Patch Changes

    • Date every page from one git history walk instead of a git log per page, cutting the content index's git cost by about 11x (93ms to 8.5ms on a 23-page site) and scaling with history rather than page count
    • Reuse that walk for the life of the dev server, so editing a page no longer re-runs git at all; dates now refresh on restart rather than on save
    • Report a failed date lookup instead of silently dating only some pages, which a large repo could hit when the walk outgrew the default output buffer
    • Freeze archived pages' dates from the same walk, so archive-version no longer spawns git per copied page

0.12.0

Minor Changes

  • svelte-docsmith/vite now exports only docsmith and DocsmithViteOptions. The collectDocs, collectSearchDocs, collectLlmsDocs and collectReleases re-exports are gone: they were internal build steps that the plugin's own tests reached through the package entry, never part of its contract.

    • Build the content, search and llms indexes as projections of one source-page list, instead of three independent scans of the docs root
    • Report a missing or empty docs root from the plugin, so index building no longer writes to the console

Patch Changes

    • Fix the version switcher sending readers to the landing page instead of the matching page, on sites serving their docs from the routes root
    • Accept a path without a leading slash in generateSitemap entries and in generateFeed's path, joining it to the origin with exactly one slash
    • Tolerate any number of trailing slashes on a configured url or editUrl, not just one, wherever a URL is built from it
    • Build every doc URL through one internal vocabulary, replacing three disagreeing trailing-slash regexes and three copies of the segment-boundary rule

0.11.0

Minor Changes

  • Give the archive-version command one seam into the library, so version identity and commit dates are decided in one place instead of two.

    • One lastCommitDate, shared by the command and the Vite plugin. Both now emit a commit day (2026-03-04); archived pages and current pages no longer carry different shapes in the same lastUpdated field.
    • "Last updated" and changelog release dates render as a UTC calendar day, so they read the same in every timezone and match between the server render and hydration. They previously formatted in the ambient zone, which showed the wrong day west of UTC.
    • Version ids are validated wherever they are declared, not only in the command. The rule covers current too, since archiving turns today's current id into an archive folder.
    • A versions config that disagrees with your docs folder now fails the build, reporting the config to paste. Both mismatches were previously silent: an undeclared archive was merged into the current version, and a section folder declared as a version dropped out of the current sidebar.
    • .docsmith-archive is now documented contract. A folder is an archived version when it carries the marker and is declared in versions; an archive copied by hand needs one.

    Breaking, for sites already using versions. DocsContentItem.lastUpdated is a YYYY-MM-DD day rather than a full ISO timestamp, so a consumer reading time-of-day off it loses that; sitemap.xml already truncated to the day and is unaffected. The new checks can also fail a build that previously passed, which is the point: every case they reject was producing a wrong content index. Unversioned sites are unaffected.

Patch Changes

    • The mobile menu now shows the version switcher on non-doc pages (a landing page, or any layout="page" route), matching what the desktop header already did there.

0.10.0

Minor Changes

  • Add opt-in versioned docs. The current version stays unprefixed at your docs root, so turning versioning on never moves a URL.

    • Declare versions: { current, archived } in docsmith(). The sidebar, search, prev/next, and breadcrumbs scope to the version being read. No versions means today's single-tree behaviour, unchanged.
    • Archived versions are served at /docs/<id>/…, get a banner linking to the current equivalent, and drop their "Edit this page" link.
    • A header version switcher appears once an archive exists, and keeps you on the same page across versions.
    • Archives stay indexable with a self-canonical; sitemap.xml and llms.txt scope to the current version via the new currentOnly helper.
    • svelte-docsmith archive-version <id> freezes the current docs into an archive, rewriting in-content links to stay inside it and preserving each page's real last-updated date.
    • DocsShell's search prop now receives the active version id, so a loader can return one version's records.
    • lastUpdated frontmatter, when present, takes precedence over the git commit date.

Patch Changes

    • ErrorPage takes a versions prop and forwards it to the shell, so an error under an archived prefix keeps that version's search scope, switcher, and noindex instead of falling back to the current version.
    • ErrorPage's search prop now receives the active version id, matching DocsShell.
    • The scaffolded +error.svelte passes versions (a no-op until you declare versions).
    • Fenced code is detected per CommonMark everywhere at build time: a fence now closes only on a marker of the same character, at least as long as the opener, carrying no info string. A page whose samples nest one fence inside another (```svelte inside ````) no longer leaks its code into the search index or phantom headings into the table of contents.
    • The fence rule and the frontmatter delimiters live in one module the search index, table of contents, llms.txt content and the archive rewriter all cross, instead of a copy per pass.
  • Accessibility polish across the docs chrome.

    • Honour prefers-reduced-motion: overlay (dialog, sheet, popover, dropdown, accordion) and transition animations collapse to instant; opacity fades still play.
    • The copy button announces "Copied to clipboard" to screen readers via a polite live region, instead of only swapping its icon.
    • The header GitHub link sets rel="noopener noreferrer".

0.9.0

Minor Changes

  • Publish your releases as a page and a feed. The docsmith() plugin now parses a Changesets CHANGELOG.md into the generated svelte-docsmith/changelog module, and the new Changelog component renders it. Because the entries come from the changelog you already ship, the page cannot fall behind what actually went out.

    Commit hashes are stripped, multi-paragraph entries survive intact, and each entry's markdown is rendered to HTML at build time so your site needs no runtime markdown renderer. Release dates come from git, specifically the commit that first introduced each version's heading; no date is invented when the history isn't available. Point the new changelog option at the package you publish (docsmith({ changelog: '../../packages/my-lib/CHANGELOG.md' })) or set it to false to skip.

    generateFeed builds an Atom feed from the same index, for a changelog.xml/+server.ts alongside the existing sitemap and llms.txt endpoints. Atom rather than RSS because it requires an unambiguous id and timestamp per entry, which a version and its release date give exactly.

    A release that deserves more than a terse entry can have a hand-written page at src/routes/changelog/<version>/, which the generated entry then links to instead of to its anchor, so the ones worth writing up get a proper post while the rest stay generated.

  • Add filenames and line numbers to code blocks. A fence's metadata now drives both: ```ts title="vite.config.ts" puts a filename bar above the block, and showLineNumbers adds a gutter. Pair startLine=12 with numbering when the snippet is lifted out of a longer file so the numbers match the real source.

    Number every block by default with the new lineNumbers preprocessor option; an individual fence still opts out with noLineNumbers. The numbers are a CSS counter over Shiki's existing per-line spans, so they add no markup and stay out of what the copy button copies. When a block has a title, the copy button moves into the filename bar instead of floating over the first line of code.

  • Add landing page sections, so the marketing page in front of your docs is built from the same design tokens as the docs themselves rather than hand-rolled.

    Five new components: Hero (headline, description, call-to-action buttons, and an optional second column for a code sample or screenshot; without one it centres on a single column), FeatureGrid and Feature (a two or three column grid of icon-and-text cells, with an optional tinted band for alternating against neighbouring sections), CTA (the closing panel, with a soft glow behind the heading), and Action (the call-to-action link used by Hero and CTA, in filled and outlined variants).

    Each renders its own full-width <section> with the container and spacing already set, so a landing page is a handful of components rather than a wall of layout classes. They use only design tokens, so they follow every theme preset and both colour schemes without configuration.

  • Add Mermaid diagram support. A ```mermaid code fence now renders as a diagram instead of highlighted code, themed to match the site — diagrams draw their colors, borders and text from your design tokens and follow the light/dark toggle. Diagrams render in the browser, and mermaid is an optional peer dependency pulled in only on pages that actually contain one — install it (npm i -D mermaid) to use diagrams; sites without them stay lean and need nothing. A <pre> source fallback shows if a diagram fails to parse or mermaid isn't installed.

  • Highlight code lines by number from the fence: ```svelte {4}, with lists and ranges ({1,5}, {2-4}) too. This is the only way to mark a line inside a Svelte template region, where Shiki's comment markers cannot reach: an HTML comment there is stripped without highlighting anything, so the marker silently does nothing. Comment markers keep working everywhere they already did.

    Header nav links now show which one is active. A link is matched on its section rather than its exact path, since a header link is usually the entry point to an area rather than a page you sit on: "Docs" pointing at /docs/introduction stays lit across all of /docs/*. External links are never marked, and a link to / matches only the root. The active link also carries aria-current="page".

  • Add Twoslash, so a code sample can show real types on hover. Mark a fence with ```ts twoslash and the block is compiled by TypeScript, then annotated with the types it actually infers rather than ones written by hand beside the code. Svelte fences work too, via twoslash-svelte.

    It is opt-in twice: docsmith({ twoslash: true }) in the preprocessor, then per fence. @shikijs/twoslash, twoslash-svelte, and typescript are optional peer dependencies, loaded only when a fence asks for them, so sites that don't use Twoslash pay nothing.

    Because the snippet really is compiled, it has to typecheck, and an unresolved import or a type error means there is no type to show. Rather than fail the build over one block, DocSmith falls back to an ordinary highlight and warns which block it was. The usual Twoslash directives apply: // @errors: 2322 to show an error deliberately, // @noErrors to silence one, and // ---cut--- to keep setup lines out of the rendered output while still compiling them.

    The hover popup is restyled from the stock rich theme onto your design tokens, so it matches the site in both colour schemes.

Patch Changes

  • Stop the header showing a stray divider when search isn't wired. The separator between the search trigger and the header action icons rendered unconditionally, so a site that passed no search loader to DocsShell got a rule with nothing before it. It now appears only alongside the trigger it divides.

  • Stop the code block clipping Twoslash hover popups. A code block is a scroll container, so an absolutely positioned popup was cut off at its edges: hovering a token on the last line showed a sliver of the type and nothing else. CSS alone can't solve it, because an element that scrolls horizontally must also clip vertically. The popup is now promoted to fixed positioning on hover, so it escapes the block, and it flips above the token when there isn't room below. Popups also shrink to the width of the type rather than always filling the maximum. Without JavaScript the popup still opens on hover exactly as before.

    The popup's documentation also reads as documentation now. Sitting inside a <pre>, it inherited monospace and whatever token colour the hovered word happened to carry, so the prose looked like more code; it is now sans-serif and muted, with the signature alone staying mono. Each @param is its own line with a space after the tag, rather than the whole block running together as @paramcallbackfn.

    The @param tags also took on the colour of whatever word you hovered, because the dark-theme swap repaints every span inside a code block with --shiki-dark, which those spans inherited from the hovered token. The popup's documentation now defines that variable itself, so tags read as tags and their text as prose.

0.8.0

Minor Changes

  • Add an announcement bar. Set announcement in your config ({ text, tag?, href?, external?, id?, dismissible? }) to show a thin bar above the header on every page, with an optional leading tag pill (e.g. "New") carrying the accent color. It's dismissible by default and, once dismissed, stays dismissed (persisted in localStorage) until you change its id or text, so a new announcement shows again. A blocking head script keeps an already-dismissed bar from flashing in and shifting the layout on reload. The bar sits above the sticky header, so it scrolls away as the reader moves down the page.

  • Add nested sidebar sections. A page's section frontmatter now accepts an array as well as a string: section: [Guides, Advanced] nests the page inside a collapsible Advanced subsection under Guides. Nesting can go any number of levels deep; order still sorts each level, and a subsection takes the smallest order of its pages so it slots into reading order. In the sidebar, nested groups are collapsible (a caret on the right of the row), with the branch containing the current page expanded on load and the rest collapsed. Breadcrumbs and the prev/next pager follow the full nested path. Single-string section values are unchanged.

    Also makes sidebar ordering deterministic: pages that share an order (for example all defaulting to 0) now tie-break by title instead of by filesystem scan order, so the sidebar is stable across machines.

  • Add synced tab groups. Give related <Tabs> a syncKey and they share one selection: choosing (say) pnpm in any block selects it in every block with the same key, and the choice is remembered across reloads and navigation via localStorage. Ideal for package-manager, runtime, or OS variant blocks that a reader picks once. Tabs without a syncKey are unchanged, and the server still renders the default tab so there's no hydration flash.

0.7.0

Minor Changes

  • Make Darkmatter the built-in default theme. svelte-docsmith/theme.css now ships the Darkmatter tokens as its base, so importing it alone gives the Darkmatter look (near-monochrome with a warm orange primary) without importing a preset. Sites that want the previous look can import svelte-docsmith/themes/tangerine.css after theme.css.

    Also fixes Darkmatter's dark-mode destructive token, which was a teal carried over from the source preset instead of a red, so delete buttons and error surfaces now read as errors in dark mode.

0.6.0

Minor Changes

  • Add reading time and a page-feedback widget to DocsShell.

    Doc pages now show an estimated reading time (computed at build time from the page's word count, in the content index as readingTime); toggle it with the readingTime prop (default true). The new feedback prop renders a "Was this page helpful?" thumbs up/down widget at the foot of each page: pass true for the UI alone, or a (vote, path) => void callback to record votes.

0.5.1

Patch Changes

  • Declare @lucide/svelte as a runtime dependency. The shipped components import icons from @lucide/svelte/icons/*, but it was listed only under devDependencies, so standalone consumers (anything outside this monorepo, including projects scaffolded with create-svelte-docsmith) failed to build with "failed to resolve import @lucide/svelte/icons/...". The dogfood docs site masked it because the workspace already had the package installed.

0.5.0

Minor Changes

  • Add "Edit this page" and "Last updated" to the bottom of each doc page. Set editUrl in your config (the GitHub edit URL for your docs directory, e.g. https://github.com/you/repo/edit/main/apps/docs) and each page links to its own source. The "Last updated" date is read from each page's last git commit automatically, no config needed. Both sit just above the prev/next navigation.

  • Add llms.txt and "Copy page" support for AI tooling.

    The docsmith() plugin now emits a svelte-docsmith/llms module with each page's full markdown. Two framework-agnostic helpers, generateLlmsTxt and generateLlmsFullTxt, turn it into the llms.txt index and llms-full.txt corpus defined by the llmstxt.org standard, both following the sidebar reading order (grouped by section, sorted by order). Wire them into src/routes/llms.txt/+server.ts and src/routes/llms-full.txt/+server.ts.

    A new copyPage prop on DocsShell adds a "Copy page" split button to doc pages: copy the page as Markdown, view the raw .md, or open it in ChatGPT / Claude. Back it with a catch-all src/routes/[...slug].md/+server.ts over the same svelte-docsmith/llms index. See the SEO docs page.

  • Add a generateSitemap helper that builds a sitemap.xml body from the content index. Wire it into a src/routes/sitemap.xml/+server.ts and each doc page is listed with a <lastmod> from its last git commit. Pair it with a static/robots.txt pointing at the sitemap. See the SEO docs page.

Patch Changes

  • Accessibility pass on the shell: add a "Skip to content" link (visible on keyboard focus) that jumps to the main content, give <main> an id and focus target, and label the sidebar, header, mobile, and pagination navs so screen readers can tell the landmarks apart.

  • Normalize trailing slashes when matching the current route. /docs/intro/ and /docs/intro now resolve to the same page, so the SEO tags, "Edit this page" link, prev/next nav, sidebar highlight, and canonical URL all work regardless of the app's SvelteKit trailingSlash setting (they previously broke on a trailing slash).

0.4.0

Minor Changes

  • Add code-block annotations. On top of Shiki line highlighting, doc code fences now support the full set of comment-driven markers, each styled for light and dark:

    • Diff — // [!code ++] / // [!code --], with colored backgrounds and +/- gutter markers (this finishes a feature that was styled but not wired).
    • Focus — // [!code focus] dims the other lines and sharpens them on hover.
    • Error / warning — // [!code error] / // [!code warning] tint a line red or amber.
    • Word highlight — // [!code word:name] highlights a token.

    Markers are stripped from the rendered output. No new dependencies (the transformers ship with the @shikijs/transformers DocSmith already used). See the new Code blocks page in the docs.

Patch Changes

  • Point the README at the new create-svelte-docsmith scaffolder as the fastest way to start a new docs site.

0.3.0

Minor Changes

  • Add an ErrorPage component for 404 and error routes. Drop it into a SvelteKit +error.svelte to get a styled error screen that keeps the full site chrome — header, search, footer, theme — so a lost reader can navigate away or search instead of hitting a bare stack trace.

    <script lang="ts">
    	import { docs } from 'svelte-docsmith/content';
    	import { ErrorPage } from 'svelte-docsmith';
    	import { siteConfig } from '$lib/site-config';
    </script>
    
    <ErrorPage config={siteConfig} content={docs} home="/docs" homeLabel="Back to the docs" />
    

    It reads the status and message from the current page by default (404 → "Page not found"), and accepts status, title, message, home/homeLabel, search, and a children snippet for overrides.

  • Render each doc page's <h1> and lead subtitle from frontmatter. The markdown layout now emits the page heading from title and a lead paragraph from description, so the visible page title, the sidebar label, and the <title> tag all come from one source — pages start their body at ## and never repeat the title.

    Note: if a page previously wrote its own top-level # Heading, remove it to avoid two h1s (the frontmatter title now provides the page heading).

  • Emit a searchable body-text index. The docsmith() Vite plugin now serves a second virtual module, svelte-docsmith/search, alongside svelte-docsmith/content. It exports one record per page — { path, title, section, description, headings, text } — where text is the page's prose and headings reduced to plain text (frontmatter, <script> blocks, fenced code, tags, and markdown punctuation removed). It is a separate chunk from the nav index so it can be lazy-loaded only when needed. This is the data layer for upcoming full-text search; the new SearchDoc type is exported from the package root.

  • Add a full-text search palette. DocsShell now accepts a search loader that enables a ⌘K / Ctrl-K command palette:

    <DocsShell
      {config}
      content={docs}
      search={() => import('svelte-docsmith/search').then((m) => m.docs)}
    >
    

    The palette lazily fetches the generated svelte-docsmith/search index (a separate chunk, loaded only when search first opens), builds a FlexSearch index over each page's title, headings, description, and body, and links results to their pages with a context snippet. Header (⌘K button) and mobile (search icon) triggers share one dialog and one shortcut. Omit the prop to keep search off.

    The framework-agnostic engine is also exported for custom search UIs: createSearchEngine(docs) returning { search(query, limit?) }, plus the SearchEngine and SearchResult types.

    Adds flexsearch as a runtime dependency.

  • Emit SEO head tags from frontmatter. DocsShell now renders <title>, <meta name="description">, canonical, and Open Graph / Twitter Card tags for every page — no per-page wiring. Doc pages get their title and description straight from frontmatter (via the content index); other pages fall back to the site title and the new config.description.

    • New optional config fields: description (default meta description), url (canonical origin — enables <link rel="canonical"> and absolute og:url), and ogImage (default share image).
    • New DocsShell prop seo={{ title?, description? }} to set or override the head on non-doc pages (landing pages, custom routes).

    Previously pages shipped with no <title> or meta description at all.

  • Normalize the public component API ahead of v1.0 (breaking).

    • Tabs no longer takes an items array. Each TabItem now declares its own label, and Tabs builds the trigger row from them, so labels are written once instead of duplicated between items and each TabItem's value. The first tab is selected by default; pass value on Tabs to start elsewhere.

      <!-- before -->
      <Tabs items={['npm', 'pnpm']} value="npm">
        <TabItem value="npm">…</TabItem>
        <TabItem value="pnpm">…</TabItem>
      </Tabs>
      
      <!-- after -->
      <Tabs>
        <TabItem label="npm">…</TabItem>
        <TabItem label="pnpm">…</TabItem>
      </Tabs>
      
    • Callout's type prop is renamed to variant, matching Badge and the shadcn convention (<Callout variant="tip">). The CalloutType type is renamed to CalloutVariant and is now exported from the package root.

    • Badge gains an external prop: a linked badge (href) can now open in a new tab with rel="noopener noreferrer", matching Card and header/footer links.

Patch Changes

  • Polish anchor navigation and copy resilience.

    • Mobile table of contents is now server-rendered. The mobile TOC button and list are driven by the build-time heading index, so they're present on first paint (and without JavaScript) instead of popping in after hydration — matching the desktop TOC.
    • Heading anchor links are keyboard-accessible. The # link on each h2/h3 now reveals on focus (not just hover) and carries an accessible label, so it's reachable by keyboard and announced by screen readers.
    • Copying to the clipboard fails quietly. The copy button no longer throws an unhandled rejection in insecure contexts or when clipboard permission is denied; it logs a warning and leaves the button in its normal state.
  • Refresh the README and clean up stale source comments. The README's exports table now reflects the full public API (ErrorPage, createSearchEngine, the svelte-docsmith/search entry point, the theme presets) and gains short sections for search, SEO, error pages, and themes. Dead references to the old velite pipeline and to an internal PLAN.md were removed from the shipped source comments.

  • Fix PropsTable overflow on narrow content. The four-column table forced a horizontal scrollbar and crushed the Description column to a sliver whenever a prop had a long type signature (e.g. () => Promise<SearchDoc[]>). Each prop now renders as a stacked row — name, required badge, type chips, and default on one wrapping line, with the description full-width below — so nothing overflows and the description stays readable at every width. The PropsTable / Prop API is unchanged.

  • Fix the page layout header on mobile. DocsShell layout="page" (landing pages, the themes gallery, any non-doc page) previously rendered the full desktop header at every breakpoint, so on phones the nav links, version badge, and controls crammed together with no menu — and it sat at a different horizontal inset than the docs pages.

    Both layouts now share one header system: DocsHeader on desktop and the responsive mobile header below lg, so every page's header lines up and collapses to a hamburger identically. The mobile menu now also lists the configured header nav (config.nav) alongside the doc sidebar, so links like a top-level "Themes" are reachable from the mobile menu on doc pages too.

  • Fix server-rendered TOC anchors that could miss their heading. The build-time TOC extractor used a hand-rolled slugifier that only approximated rehype-slug, so headings with punctuation or symbols drifted — e.g. ## Anchors & copy buttons rendered the id anchors--copy-buttons but the TOC linked #anchors-copy-buttons, a dead anchor until hydration re-scanned the DOM. The extractor now slugs with the same github-slugger rehype-slug uses, including its duplicate-suffixing, so SSR TOC links resolve on first paint for every heading.

  • Fail loudly instead of silently on misconfiguration.

    • defineConfig now validates the footer. footer.copyright, footer.poweredBy, and footer.columns (each column's title/links, and every link's label/href) are checked, so a malformed footer throws a named error instead of rendering blank.
    • The docsmith() Vite plugin warns when it finds no pages. A missing content directory, or one with no titled +page.md files, now logs an actionable warning explaining the empty sidebar instead of leaving you guessing.
    • Invalid YAML frontmatter reports the file. A page with broken frontmatter throws an error naming the offending file, rather than a bare parser message.

0.2.0

Minor Changes

  • Add the darkmatter theme preset (svelte-docsmith/themes/darkmatter.css) — a near-monochrome shell with a warm orange primary and muted teal secondary, in light and dark.

    Add a "Powered by Svelte DocSmith" attribution to the footer. It is shown by default whenever a footer is configured; opt out with footer.poweredBy: false in your DocsmithConfig.

0.1.1

Patch Changes

  • Declare all runtime dependencies. @lucide/svelte, clsx, tailwind-merge, tailwind-variants, tw-animate-css, and @fontsource-variable/inter were devDependencies, so installs outside this monorepo failed to resolve imports from the shipped components and theme.css. They are now regular dependencies.

0.1.0

Minor Changes

  • Initial public release of svelte-docsmith — a framework for building documentation sites with Svelte 5 + SvelteKit.

    • docsmith() markdown pipeline (mdsvex + Shiki dual-theme highlighting + heading anchors) and Vite plugin (frontmatter-driven content index + ?source imports).
    • DocsShell layout, LiveExample, and docs components: Tabs/TabItem, Callout, Steps/Step, Card/CardGrid, Accordion/AccordionItem, Badge, Kbd, FileTree, PropsTable.
    • One-import theme contract (svelte-docsmith/theme.css) with a set of tweakcn-based theme presets and light/dark support.
    • defineConfig() for typed site configuration.