Skip to content

Releases

v0.6.2

Choose a tag to compare

@rachfop rachfop released this 18 Nov 18:10

This release points links between docs at each target's generated Markdown file, and writes the Markdown copy for a route that ends in .md beside its route directory instead of failing the run. Docs are at https://rachfop.github.io/docusaurus-plugin-llms.

Fixed

  • In a site with versions, blog posts reach every version's custom LLM files,
    so a custom file whose includePatterns match the blog directory is written
    for versions under a path prefix as well. The posts' markdown files keep
    their unprefixed links and are written once, at the site root.
  • A docs section that points at the blog directory keeps its documents in every
    version: only posts collected through includeBlog count as unversioned
    content, so every version keeps them in its standard files.
  • With generateMarkdownFiles enabled, relative links between docs point to
    each target's generated Markdown file in per-page copies, llms-full.txt,
    and full-content custom files. Inline and reference-style links keep their
    query strings and fragments; useRelativeUrls writes these targets as paths
    from the site root (#97).
  • The plugin writes the Markdown copy for a route that ends in .md as
    fiber.md.md, beside Docusaurus's fiber.md/index.html route directory. If
    a copy cannot be written, the plugin logs the path, links the page's HTML
    route, and writes the remaining LLM files (#98).

v0.6.1

Choose a tag to compare

@rachfop rachfop released this 03 Oct 01:34
f632da5

This release fixes how links, Markdown file paths, and content are generated for versioned, translated, and multi-section sites, and adds lint and format checks to the repo. Docs are at https://rachfop.github.io/docusaurus-plugin-llms.

Added

  • versions[].routePrefix, for explicit versions served inside the route base
    path (/docs/<version>/) (#88).

Changed

  • versions: 'auto' follows Docusaurus versioning: the last version writes the
    root files, the current docs go under next/ with the label Next, and the
    docs plugin's lastVersion, includeCurrentVersion, onlyIncludeVersions,
    and disableVersioning options apply (#88, #93).
  • Each locale's files use the page translations in i18n/<locale>/ (#88).
  • HTML tables, line breaks, and <img> tags become Markdown text and images,
    and HTML and MDX comments are removed (#85).
  • Duplicate llms-full.txt headings get a space before the suffix:
    ## Install (Api) (#86).
  • Option validation rejects output paths outside the build directory,
    duplicate output file names, a processingBatchSize that isn't a positive
    integer, and invalid per-version options (#78, #84, #88).

Fixed

  • Links and Markdown file paths match the routes Docusaurus builds for index
    and README pages, slugs and ids, number-prefixed files, date-prefixed blog
    posts, multi-section and baseUrl sites, and paths with spaces or accents
    (#74, #77, #87).
  • Content cleaning keeps prose lines that start with "import", code samples
    inside partials, and blank lines inside code, and long JSX tags don't hang
    the build (#85).
  • Page descriptions skip code fences, tables, admonitions, JSX, and comments,
    and a wrapped first paragraph is joined before it's truncated (#76, #85,
    #86).
  • Generated files stay inside the build directory and don't overwrite each
    other (#84).
  • Empty and unclosed code fences are left as written, <img> tags with a
    require() source become Markdown images, and @site/ images are
    rewritten (#92).
  • logLevel: 'quiet' prints errors only, and each plugin instance uses its
    own level (#78, #86).
  • Titles with brackets or line breaks, components in preserveComponents
    named like HTML tags, TabItem labels, the blog heading on multi-section
    sites, and image rewriting for relative paths (#86).

Documentation

  • Corrected documented option behavior, and documented how titles and
    descriptions are chosen, directory index pages, versioned sites, and
    translated sites (#79, #82, #88).

v0.6.0

Choose a tag to compare

@rachfop rachfop released this 01 Sep 18:31

This release ships a large batch of correctness fixes across content cleaning, partial resolution, output assembly, multi-version handling, and URL construction, plus a fully rewritten documentation set published at https://rachfop.github.io/docusaurus-plugin-llms.

Fixed

  • <TabItem label="A > B"> leaked tag fragments: the TabItem label
    emitter cut its tag match at the first >, so a quoted label containing >
    dumped the rest of the tag into the output as prose. The matcher is now
    attribute-aware, like the PascalCase stripper.
  • Multi-line descriptions rendered as broken blockquotes: a frontmatter
    description spanning lines quoted only its first line, leaving the rest as
    prose under the heading. Every line is now blockquoted.
  • $ sequences corrupted partial content: partial files were spliced
    with a string replacement, so shell/perl patterns like echo $1, kill $$,
    or $& in a partial's code samples were silently rewritten (attr values
    substituted, tags re-inserted, document fragments duplicated). The splice
    now ignores replacement patterns.
  • CRLF line endings corrupted output: files authored or checked out with
    Windows line endings had their fenced code blocks unmasked (imports and HTML
    inside code samples were stripped) and their descriptions mis-extracted (a
    heading-only file got the heading as description; a heading-less file got
    the entire document). readFile now normalizes CRLF/CR to LF.
  • Root slug (slug: "/") crossed version subtrees: in multi-version
    mode, a section-root page linked to the current version's route (e.g.
    /docs) instead of its own version's (/stable/docs). Root-slug resolution
    now honors version and section scoping.
  • siteConfig.url with a trailing slash produced //baseUrl in every
    generated URL, mismatching sitemap.xml.
  • routeBasePath with a leading/trailing slash (e.g. '/docs') silently
    disabled route scoping for that section, falling every doc back to
    heuristic URLs. Slashes are now normalized.
  • Blog detection misclassified sibling sections: any directory whose name
    merely started with the blog dir (e.g. a blog-api docs section next to
    blog) was treated as the blog for fallback URL construction.
  • Code-fence samples containing import statements were rewritten: a
    fenced sample of an import line was resolved as a real partial import and
    spliced the partial's content into the code sample (or dropped the line when
    the target did not exist). Partial-import resolution now runs on fence-masked
    content.
  • llms-full.txt flattened heading hierarchy: each document's inner
    ## Foo stayed at ##, colliding with the ## {title} document header, and
    the document's own title H1 appeared again under its header. Inner headings
    are now demoted one level under the document header, and the duplicate title
    heading is removed.
  • Individual .md files duplicated their title and intro: the file header
    emitted # {title} plus the description blockquote, then the body repeated
    the identical H1 and (for pages whose description was auto-extracted from
    the first paragraph) the identical paragraph. Both duplicates are now
    stripped from the body.
  • Triple blank lines in llms-full.txt: stripping a body's duplicate
    title heading left its surrounding blank lines behind. Gaps now collapse to
    a single blank line.
  • Numeric frontmatter description dropped: an unquoted YAML number
    (description: 2024) was silently discarded instead of used as text; it is
    now coerced like title/slug/id.
  • applyMdExtension mangled bare origins: a bare site URL would become
    https://site.com.md; the trailing slash is now preserved.

Added

  • preserveComponents option: an array of MDX/JSX component names whose
    tags pass through untouched instead of being stripped, for components that
    render meaningful content themselves (e.g. a swizzled
    <PackageManagerTabs command="add my-package" />). Matching is exact on
    the component name, and tags inside code fences are still left alone.
    (#64)
  • CI workflow: the repository now runs build + unit + integration tests on
    Node 18/20/22 for every pull request and push to main.

Fixed

  • Prop content lost in JSX stripping: the attribute-aware stripper
    (0.5.0) dropped non-children prop values wholesale, deleting content like
    the command inside <PackageManagerTabs command="..." />. Attribute values
    are now parsed and their text is preserved. (#68,
    #64)
  • <TabItem> collapsed its label: <TabItem> tags now degrade to a
    readable outline instead of a bare body: the label (or value) is emitted
    as a bold line before the tab body. (#64)
  • Imported MDX page bodies silently dropped: only imports whose path
    contained _ or /partials/ were inlined; a normally-named .mdx page body
    imported as a component was stripped without its content. Every .mdx/.md
    import is now inlined, and imports using webpack-style aliases other than
    @site (e.g. @global/components/x.mdx) resolve against the site directory.
    Failed resolutions warn with the specifier and importing file. (#65)
  • Imports inside partial code fences stripped: when a partial was inlined,
    import lines inside its fenced code samples were removed. Code fences are
    masked before partial splicing, so samples survive verbatim. (#69)
  • Absolute slugs double-prefixed: a frontmatter slug starting with /
    was prefixed with the route base path again, producing URLs like
    .../docs/team-b/docs/faq.md. Absolute slugs are now used as-is. (#63)
  • Multiple docsDir entries collapsed to the first: with
    docsDir: ['docs', 'blog'], every page resolved to the first matching
    section, mis-routing pages and leaking blog URLs into docs output.
    Sections now resolve per-file, routes are scoped per-section, and the new
    blogDir/blogRouteBasePath options configure a blog alongside docs. (#67)

Documentation

  • README restructured into a full docs/ site: installation, configuration,
    output files, content cleaning, best practices, and per-feature guides. (#61)
  • Corrected the JSDoc default for generateMarkdownFiles. (#62)
  • New "Validating the deployed output" section in best practices. (#66)

Thanks

This release exists because of its contributors. Thanks to everyone who
opened pull requests: adeelehsan,
AlexAdiaconitei,
anupamme, canuto,
deka0106, F-OBrien,
ilanazholobovsky,
kingsword09, Konkrad,
nicolasiscoding,
portdeveloper,
puehringer, scottamain,
smol-ninja, statico,
and svrnm.

Thanks to everyone who filed issues that shaped this release:
allxsmith, anvme,
benfoster, canuto,
critesjosh, ctauchen,
cyrusmith, dineshpinto,
emertechie, fflaten,
ilanazholobovsky,
johngrimes, manuelmeurer,
nicolasiscoding, PaulRBerg,
prdai, quangdusk,
Rajesh11082005, ratansen,
Rob-Purbrick, scottamain,
smol-ninja,
sujanmoi-kasm, thomhurst,
wparad, and yada.
If you reported a problem, tested a pre-release, or shared feedback along
the way, that work made 0.6.0 better. Thank you.

v0.5.1 — path & route resolution fixes

Choose a tag to compare

@rachfop rachfop released this 22 Jul 23:53

Bug-fix release for individual .md generation — path and route resolution.

Fixed

  • Numeric frontmatter slug/id/title — unquoted YAML numbers (e.g. slug: 2025) are now coerced to strings, matching how Docusaurus routes them, so the .md is written at the correct route instead of a fallback filename. (#58)
  • baseUrl applied twice on disk — with a non-root baseUrl, files were nested one level too deep and their links 404'd; the baseUrl segment is now stripped before deriving the physical path. (#59)
  • Compound numeric prefixes — ordering prefixes are parsed like Docusaurus's DefaultNumberPrefixParser (e.g. 03--1.6.X → 1.6.X), and version/date-like names such as 7.0-foo are preserved. (#59)
  • Explicit slug/id precedence — an authoritative frontmatter slug/id (including slug: "/") is consulted before the filename-tail heuristic, so a root page no longer loses its route to a coincidental match. (#59)

Thanks to @AlexAdiaconitei (#59) and @ratansen (#58).

v0.5.0 — multi-version llms.txt + @site partials

Choose a tag to compare

@rachfop rachfop released this 17 Jul 17:18
a2a23a0

Added

  • Multi-version output via a new versions option. Generate a separate set of LLM files per documentation version, each written under its own subdirectory with links scoped to that version's routes. Accepts an explicit array of versions ({ name, label, docsDir, path, customLLMFiles, includeOrder }) or 'auto' to detect them from Docusaurus docs versioning (versions.json + versioned_docs/). Omitting versions preserves the existing single-root behavior. (#56)

Fixed

  • @site alias partials are now resolved and inlined (previously the import was stripped but the JSX tag survived, dropping the partial's content). Partials in a /partials/ directory are recognized alongside the _partial convention, and a partial's own import lines are stripped before inlining so they don't leak into lists. (#55, closes #54)
  • @site imports resolve against the site directory (threaded siteDir) rather than process.cwd(). (#57)

v0.4.0

Choose a tag to compare

@rachfop rachfop released this 20 Apr 18:44

What's New

  • Append .md to llms.txt link URLs — Per the llmstxt.org spec, links in llms.txt now point to markdown versions of pages (e.g. /docs/intro.md instead of /docs/intro/). (#38)
  • Fix import/export in descriptions — .mdx files starting with import or export statements no longer use those lines as page descriptions. (#39)
  • Added test coverage for import/export description extraction fix. (#40)

Breaking Change

addMdExtension defaults to true. All link URLs in generated llms.txt files will now have .md appended. To preserve the previous behavior, set addMdExtension: false in your plugin config.

Full Changelog: v0.3.1...v0.4.0

v0.3.1

Choose a tag to compare

@rachfop rachfop released this 14 Apr 16:10

Bug Fixes

  • #31 — Doubled docs/docs/ paths when routeBasePath: '/' and docs live in a nested docs/ subdirectory
  • #30 — trailingSlash: true not reflected in generated URLs

What Changed

Replaced the routeMap construction approach with suffix-based matching against Docusaurus's own routesPaths. This removes ~150 lines of production code (five edge-case helper functions) and makes URL resolution simpler and more correct across all common Docusaurus configurations.

Note: pathTransformation is now only applied as a fallback when a file cannot be matched to a known Docusaurus route. In most configurations, you no longer need it.

Thanks to @scottamain for the fix!

v0.3.0 - Stability and Robustness Release

Choose a tag to compare

@rachfop rachfop released this 08 Feb 06:46

Highlights

This release focuses on stability, robustness, and addressing edge cases with 33 bug fixes across critical functionality, data integrity, path handling, and performance.

Critical Bug Fixes (GitHub Issues)

  • #19 PluginOptions type compatibility with Docusaurus - Added index signature to resolve TypeScript errors
  • #23 YAML encoding for special characters and emojis - Added proper YAML.stringify options
  • #25 includeOrder pattern matching - Now matches against both site-relative and docs-relative paths
  • #15 Numbered prefix handling - Uses Docusaurus resolved routes before manual prefix removal

Key Improvements

  • Windows Compatibility: Path length validation, proper path normalization
  • Large Site Support: Batch processing prevents OOM on sites with 1000+ pages
  • Type Safety: Improved TypeScript types, proper error handling
  • Input Validation: Comprehensive validation prevents crashes from invalid input
  • Pattern Matching: Flexible pattern matching supports multiple path formats
  • URL Handling: Robust URL construction with proper encoding and error handling
  • Frontmatter Parsing: Handles special characters, emojis, and edge cases

Testing

  • 300+ tests across 50 test files, all passing
  • Comprehensive test coverage for all bug fixes
  • Integration tests for plugin functionality

Breaking Changes

None. This release maintains backward compatibility with v0.2.x.

See CHANGELOG.md for complete details.

Update generation of individual markdown files

Choose a tag to compare

@rachfop rachfop released this 15 Sep 22:21

Update generation of individual markdown files

What's Changed

  • Update generation of individual markdown files by @svrnm in #21

New Contributors

  • @svrnm made their first contribution in #21

Full Changelog: v0.2.0...v0.2.1

v0.2.0 - Partials Support & Custom Root Content

Choose a tag to compare

@rachfop rachfop released this 20 Aug 22:08

🚀 New Features

Docusaurus Partials Support

  • Full support for Docusaurus partial files (MDX files prefixed with underscore)
  • Automatically excludes partial files (e.g., _shared.mdx) from being processed as standalone documents
  • Resolves and inlines partial content when imported in other documents
  • Handles both default and named imports: import Partial from './_partial.mdx'
  • Replaces JSX usage <Partial /> with the actual partial content

Custom Root Content

  • New rootContent option for customizing the introductory content in llms.txt
  • New fullRootContent option for customizing the introductory content in llms-full.txt
  • Custom root content support for individual custom LLM files
  • Follows llmstxt.org standard allowing markdown sections after title/description
  • Enables project-specific context, technical specifications, and navigation hints

🔧 Improvements

URL Resolution

  • Plugin now uses actual resolved URLs from Docusaurus routes instead of guessing paths
  • Properly handles numbered prefixes in file names (e.g., 1-page.md → /docs/page)
  • Uses Docusaurus's route data from the postBuild lifecycle hook
  • Comprehensive route matching with fallbacks for backward compatibility

📚 Documentation

  • Added comprehensive examples for all new features
  • Updated README with usage guides and best practices
  • Enhanced changelog with technical details

🧪 Testing

  • Added test suites for partials support and custom root content
  • All existing functionality continues to work as expected
  • 100% backward compatibility maintained

Breaking Changes

None - this release is fully backward compatible.

Example Usage

// docusaurus.config.js
plugins: [
  [
    'docusaurus-plugin-llms',
    {
      rootContent: `Welcome to our comprehensive documentation.

This documentation covers:
- Installation and setup guides  
- Complete API reference
- Best practices and tutorials

For support, visit https://example.com/support`,

      customLLMFiles: [
        {
          filename: 'llms-api.txt',
          includePatterns: ['api/**/*.md'],
          fullContent: true,
          rootContent: 'Complete API reference. Authentication required.'
        }
      ]
    }
  ]
]