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

Function updateReadmeWithToolsTOC

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected