豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content
Merged
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
7 changes: 4 additions & 3 deletions scripts/generate-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function addCrossLinks(text: string, tools: ToolWithAnnotations[]): string {

for (const toolName of sortedToolNames) {
// Create regex to match tool name (case insensitive, word boundaries)
const regex = new RegExp(`\\b${toolName.replace(/_/g, '_')}\\b`, 'gi');
const regex = new RegExp(`\\b${toolName}\\b`, 'gi');

result = result.replace(regex, match => {
// Only create link if the match isn't already inside a link
Expand Down Expand Up @@ -274,15 +274,16 @@ async function generateToolDocumentation(): Promise<void> {

const propertyNames = Object.keys(properties).sort();
for (const propName of propertyNames) {
const prop = properties[propName] as string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const prop = properties[propName] as any;
const isRequired = required.includes(propName);
const requiredText = isRequired
? ' **(required)**'
: ' _(optional)_';

let typeInfo = prop.type || 'unknown';
if (prop.enum) {
typeInfo = `enum: ${prop.enum.map(v => `"${v}"`).join(', ')}`;
typeInfo = `enum: ${prop.enum.map((v: string) => `"${v}"`).join(', ')}`;
}

markdown += `- **${propName}** (${typeInfo})${requiredText}`;
Expand Down