@devries-cameron20 / composio Mirror · read-only / commits / 78aed78b2
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 09:45 UTC

docs: make toolkit description web links clickable

Sushmitha committed Oct 13, 2026 at 00:08 UTC 78aed78b2f5f39cca6ad84f793080cf267a45581
2 files changed +39 -1
docs/components/toolkits/toolkit-detail.tsx
+6 -1
@@ -6,6 +6,7 @@ import { Search, Copy, Check, ChevronDown, ChevronRight, ArrowLeft } from 'lucid
6 import { TypeTable } from 'fumadocs-ui/components/type-table';
7 import type { Toolkit, Tool, Trigger, ParameterSchema } from '@/types/toolkit';
8 import { processSchema } from '@/lib/toolkit-schema';
9 +import { descriptionLinks } from '@/lib/description-links';
10 import { instantDiscount, instantPricingDescription, toolkitSupportsInstant } from '@/lib/instant';
11 import { InstantBadge } from './instant-badge';
12 import { PageActions } from '@/components/page-actions';
@@ -359,7 +360,11 @@ export function ToolkitDetail({ toolkit, tools, triggers, path, faq }: ToolkitDe
360 </div>
361
362 {/* Description */}
362 - <p className="mt-1.5 text-sm text-fd-muted-foreground">{toolkit.description}</p>
363 + <p className="mt-1.5 text-sm text-fd-muted-foreground">
364 + {descriptionLinks(toolkit.description).map((part, index) => part.href ? (
365 + <a key={index} href={part.href} className="underline hover:text-fd-foreground">{part.text}</a>
366 + ) : part.text)}
367 + </p>
368 {instantSupported && (
369 <p className="mt-1.5 text-sm text-fd-muted-foreground">
370 <Link href="/docs/instant-tools" className="underline">Instant</Link> is available on the latest version. Check each tool for support and pricing.
docs/lib/description-links.ts new
+33
@@ -0,0 +1,33 @@
1 +export interface DescriptionPart {
2 + text: string;
3 + href?: string;
4 +}
5 +
6 +/** Linkify web addresses in plain-text toolkit descriptions without interpreting HTML. */
7 +export function descriptionLinks(description: string): DescriptionPart[] {
8 + const parts: DescriptionPart[] = [];
9 + const addresses = /(?<![\w@./-])(?:https?:\/\/[^\s<>"']+|(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,63}(?::\d+)?(?:[/?#][^\s<>"']*)?)/gi;
10 + let cursor = 0;
11 +
12 + for (const match of description.matchAll(addresses)) {
13 + let text = match[0].replace(/[.,!?:;]+$/, '');
14 + // Keep balanced parentheses in URL paths, but leave prose delimiters outside links.
15 + while (text.endsWith(')') && text.split(')').length > text.split('(').length) {
16 + text = text.slice(0, -1);
17 + }
18 + text = text.replace(/[\]}]+$/, '');
19 + const href = /^https?:\/\//i.test(text) ? text : `https://${text}`;
20 + try {
21 + new URL(href);
22 + } catch {
23 + continue;
24 + }
25 +
26 + if (match.index > cursor) parts.push({ text: description.slice(cursor, match.index) });
27 + parts.push({ text, href });
28 + cursor = match.index + text.length;
29 + }
30 +
31 + if (cursor < description.length) parts.push({ text: description.slice(cursor) });
32 + return parts;
33 +}