Browse Source

chore: fix api.json (#15093)

pull/15095/head
Pavel Feldman 3 days ago committed by GitHub
parent
commit
d60f84d06a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      utils/build/build-playwright-driver.sh
  2. 5
      utils/markdown.js

2
utils/build/build-playwright-driver.sh

@ -15,7 +15,7 @@ echo "Building playwright-core package"
node ../../utils/pack_package.js playwright-core ./output/playwright-core.tgz
echo "Building api.json and protocol.yml"
node ../../utils/doclint/generateApiJson.js > ./output/api.json
API_JSON_MODE=1 node ../../utils/doclint/generateApiJson.js > ./output/api.json
cp ../../packages/playwright-core/src/protocol/protocol.yml ./output/
function build {

5
utils/markdown.js

@ -264,7 +264,10 @@ function innerRenderMdNode(indent, node, lastNode, result, maxColumns) {
if (node.type === 'code') {
newLine();
result.push(`${indent}\`\`\`${codeLangToHighlighter(node.codeLang)}`);
if (process.env.API_JSON_MODE)
result.push(`${indent}\`\`\`${node.codeLang}`);
else
result.push(`${indent}\`\`\`${codeLangToHighlighter(node.codeLang)}`);
for (const line of node.lines)
result.push(indent + line);
result.push(`${indent}\`\`\``);

Loading…
Cancel
Save