Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/code-cleanup-cache-optimization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@signalwire/docusaurus-plugin-llms-txt': patch
'@signalwire/docusaurus-theme-llms-txt': patch
---

Code cleanup and cache optimization:

- Remove dead code (className prop, normalizePathname export, CopyContentData export)
- Optimize cache implementation (replace over-engineered promise cache with minimal in-memory cache)
- Fix resize re-fetch bug (component no longer re-fetches data when switching between mobile/desktop
views)
- Reduce code size by 47% in useCopyContentData hook
- Changed the location of the CopyButtonContent component. The theme now swizzles DocItem/Layout and
conditionally puts the Copy button content component after it or below it
6 changes: 6 additions & 0 deletions .changeset/eight-vans-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@signalwire/docusaurus-plugin-llms-txt': patch
'@signalwire/docusaurus-theme-llms-txt': patch
---

Organize links by path now in llms-txt
6 changes: 6 additions & 0 deletions .changeset/fast-lands-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@signalwire/docusaurus-plugin-llms-txt': patch
'@signalwire/docusaurus-theme-llms-txt': patch
---

Fixed attachments filename bug
37 changes: 37 additions & 0 deletions .changeset/major-refactor-breadcrumbs-wrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
'@signalwire/docusaurus-plugin-llms-txt': patch
'@signalwire/docusaurus-theme-llms-txt': patch
---

Major architecture improvements for better plugin compatibility:

**Component Changes:**

- Switched from ejecting `DocItem/Layout` to wrapping `DocBreadcrumbs`
- This prevents conflicts with other plugins that customize the layout
- Uses WRAP pattern instead of EJECT for better compatibility
- Changed internal import from `@theme-original` to `@theme-init` following Docusaurus best
practices for theme enhancers

**Improvements:**

- Fixed type declarations to accurately reflect component props
- Removed unused `className` prop from `CopyPageContent`
- Fixed `DocBreadcrumbs` type declaration for proper wrapping support
- Added `margin-left: auto` to ensure copy button always aligns right in desktop view
- Fixed package publishing configuration
- Added `src/theme` directory to published files for TypeScript swizzling support
- Updated devDependencies for proper type resolution
- Changed `react-icons` from exact version to version range

**Documentation:**

- Updated README with correct swizzle examples for `DocBreadcrumbs`
- Added explanation of `@theme-init` vs `@theme-original` usage
- Updated swizzle configuration to reflect new safe wrapping pattern

**Compatibility:**

- Now compatible with plugins like `docusaurus-plugin-openapi-docs` that also customize layouts
- Follows official Docusaurus theme enhancer pattern (similar to `@docusaurus/theme-live-codeblock`)
- Users can now safely wrap our enhanced breadcrumbs with `@theme-original/DocBreadcrumbs`
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,26 @@ structure.
| Package | Version | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [`@signalwire/docusaurus-plugin-llms-txt`](./packages/docusaurus-plugin-llms-txt) | ![npm](https://img.shields.io/npm/v/@signalwire/docusaurus-plugin-llms-txt) | Generate Markdown versions of Docusaurus pages and an llms.txt index file |
| [`@signalwire/docusaurus-theme-llms-txt`](./packages/docusaurus-theme-llms-txt) | ![npm](https://img.shields.io/npm/v/@signalwire/docusaurus-theme-llms-txt) | Theme components for llms.txt plugin with copy-to-clipboard functionality |

## 🚀 Quick Start

### Installation

```bash
npm install @signalwire/docusaurus-plugin-llms-txt
npm install @signalwire/docusaurus-plugin-llms-txt @signalwire/docusaurus-theme-llms-txt
# or
yarn add @signalwire/docusaurus-plugin-llms-txt
yarn add @signalwire/docusaurus-plugin-llms-txt @signalwire/docusaurus-theme-llms-txt
```

### Usage

Add to your `docusaurus.config.js`:
Add to your `docusaurus.config.ts`:

```javascript
module.exports = {
```typescript
import type { Config } from '@docusaurus/types';

const config: Config = {
plugins: [
[
'@signalwire/docusaurus-plugin-llms-txt',
Expand All @@ -33,7 +36,10 @@ module.exports = {
},
],
],
themes: ['@signalwire/docusaurus-theme-llms-txt'],
};

export default config;
```

## 🏗 Development
Expand Down Expand Up @@ -121,7 +127,8 @@ For detailed publishing instructions, see [PUBLISHING.md](./PUBLISHING.md).
```
docusaurus-plugins/
├── packages/ # Published packages
│ └── docusaurus-plugin-llms-txt/
│ ├── docusaurus-plugin-llms-txt/
│ └── docusaurus-theme-llms-txt/
├── website/ # Demo/documentation site
├── .changeset/ # Changeset configuration
├── lerna.json # Lerna configuration
Expand Down Expand Up @@ -194,3 +201,24 @@ consumption.
- 🎯 Content filtering

[View Package →](./packages/docusaurus-plugin-llms-txt)

### [@signalwire/docusaurus-theme-llms-txt](./packages/docusaurus-theme-llms-txt)

Theme package providing UI components for the llms.txt plugin, including a copy-to-clipboard button
for page content.

**Key Features:**

- 📋 Copy page content as Markdown
- 🤖 Format for ChatGPT and Claude
- 🎯 Smart detection of page title
- 📱 Responsive mobile/desktop layouts
- 🔧 Fully swizzlable components

**Architecture:**

- Uses DOM-based detection to identify page titles (H1 in `<header>` tags)
- Global data fetching with shared cache for performance
- Integrates seamlessly with Docusaurus theme system

[View Package →](./packages/docusaurus-theme-llms-txt)
113 changes: 111 additions & 2 deletions packages/docusaurus-plugin-llms-txt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,118 @@
# @signalwire/docusaurus-plugin-llms-txt

## 2.0.0-alpha.0
## 2.0.0-alpha.5

### Patch Changes

- Organize links by path now in llms-txt
- 85c2631: Fixed attachments filename bug

## 2.0.0-alpha.3

### Major Changes

- Alpha Release
- 75c2b75: Alpha Release

### Patch Changes

- Fix `contentStrategy` bug where dropdown menu displayed incorrect content type. When
`contentStrategy: 'html-only'` is set, the dropdown now correctly shows "Copy Raw HTML" instead of
"Copy Raw Markdown". The "View Markdown" option remains available when markdown exists,
independent of `contentStrategy` setting.

- Updated ambient type declarations to remove unused `hasMarkdown` prop from CopyButton component.

- Updated README documentation to clarify `contentStrategy` behavior and `viewMarkdown`
independence.

- ec2e25b: Code cleanup and cache optimization:
- Remove dead code (className prop, normalizePathname export, CopyContentData export)
- Optimize cache implementation (replace over-engineered promise cache with minimal in-memory
cache)
- Fix resize re-fetch bug (component no longer re-fetches data when switching between
mobile/desktop views)
- Reduce code size by 47% in useCopyContentData hook
- Changed the location of the CopyButtonContent component. The theme now swizzles DocItem/Layout
and conditionally puts the Copy button content component after it or below it

- e1246b2: Major architecture improvements for better plugin compatibility:

**Component Changes:**
- Switched from ejecting `DocItem/Layout` to wrapping `DocBreadcrumbs`
- This prevents conflicts with other plugins that customize the layout
- Uses WRAP pattern instead of EJECT for better compatibility
- Changed internal import from `@theme-original` to `@theme-init` following Docusaurus best
practices for theme enhancers

**Improvements:**
- Fixed type declarations to accurately reflect component props
- Removed unused `className` prop from `CopyPageContent`
- Fixed `DocBreadcrumbs` type declaration for proper wrapping support
- Added `margin-left: auto` to ensure copy button always aligns right in desktop view
- Fixed package publishing configuration
- Added `src/theme` directory to published files for TypeScript swizzling support
- Updated devDependencies for proper type resolution
- Changed `react-icons` from exact version to version range

**Documentation:**
- Updated README with correct swizzle examples for `DocBreadcrumbs`
- Added explanation of `@theme-init` vs `@theme-original` usage
- Updated swizzle configuration to reflect new safe wrapping pattern

**Compatibility:**
- Now compatible with plugins like `docusaurus-plugin-openapi-docs` that also customize layouts
- Follows official Docusaurus theme enhancer pattern (similar to
`@docusaurus/theme-live-codeblock`)
- Users can now safely wrap our enhanced breadcrumbs with `@theme-original/DocBreadcrumbs`

## 2.0.0-alpha.2

### Patch Changes

- Major architecture improvements for better plugin compatibility:

**Breaking Changes:**
- Switched from ejecting `DocItem/Layout` to wrapping `DocBreadcrumbs`
- This prevents conflicts with other plugins that customize the layout
- Uses WRAP pattern instead of EJECT for better compatibility
- Changed internal import from `@theme-original` to `@theme-init` following Docusaurus best
practices for theme enhancers

**Improvements:**
- Fixed type declarations to accurately reflect component props
- Removed unused `className` prop from `CopyPageContent`
- Fixed `DocBreadcrumbs` type declaration for proper wrapping support
- Added `margin-left: auto` to ensure copy button always aligns right in desktop view
- Fixed package publishing configuration
- Added `src/theme` directory to published files for TypeScript swizzling support
- Updated devDependencies for proper type resolution
- Changed `react-icons` from exact version to version range

**Documentation:**
- Updated README with correct swizzle examples for `DocBreadcrumbs`
- Added explanation of `@theme-init` vs `@theme-original` usage
- Updated swizzle configuration to reflect new safe wrapping pattern

**Compatibility:**
- Now compatible with plugins like `docusaurus-plugin-openapi-docs` that also customize layouts
- Follows official Docusaurus theme enhancer pattern (similar to
`@docusaurus/theme-live-codeblock`)
- Users can now safely wrap our enhanced breadcrumbs with `@theme-original/DocBreadcrumbs`

## 2.0.0-alpha.1

### Patch Changes

- Code cleanup and cache optimization:
- Remove dead code (className prop, normalizePathname export, CopyContentData export)
- Optimize cache implementation (replace over-engineered promise cache with minimal in-memory
cache)
- Fix resize re-fetch bug (component no longer re-fetches data when switching between
mobile/desktop views)
- Reduce code size by 47% in useCopyContentData hook

## 2.0.0-alpha.0

### Major Changes

- Alpha Release
Loading