MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / updateReadmeWithToolsTOC

Function updateReadmeWithToolsTOC

scripts/generate-docs.ts:131–152  ·  view source on GitHub ↗
(toolsTOC: string)

Source from the content-addressed store, hash-verified

129}
130
131function updateReadmeWithToolsTOC(toolsTOC: string): void {
132 const readmeContent = fs.readFileSync(README_PATH, 'utf8');
133
134 const beginMarker = '<!-- BEGIN AUTO GENERATED TOOLS -->';
135 const endMarker = '<!-- END AUTO GENERATED TOOLS -->';
136
137 const beginIndex = readmeContent.indexOf(beginMarker);
138 const endIndex = readmeContent.indexOf(endMarker);
139
140 if (beginIndex === -1 || endIndex === -1) {
141 console.warn('Could not find auto-generated tools markers in README.md');
142 return;
143 }
144
145 const before = readmeContent.substring(0, beginIndex + beginMarker.length);
146 const after = readmeContent.substring(endIndex);
147
148 const updatedContent = before + '\n\n' + toolsTOC + '\n' + after;
149
150 fs.writeFileSync(README_PATH, updatedContent);
151 console.log('Updated README.md with tools table of contents');
152}
153
154function generateConfigOptionsMarkdown(): string {
155 let markdown = '';

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected