cherry-pick(#15093): chore: fix api.json
This commit is contained in:
parent
c74c9a3690
commit
7b78e71433
|
|
@ -15,7 +15,7 @@ echo "Building playwright-core package"
|
||||||
node ../../utils/pack_package.js playwright-core ./output/playwright-core.tgz
|
node ../../utils/pack_package.js playwright-core ./output/playwright-core.tgz
|
||||||
|
|
||||||
echo "Building api.json and protocol.yml"
|
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/
|
cp ../../packages/playwright-core/src/protocol/protocol.yml ./output/
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
|
|
|
||||||
|
|
@ -264,6 +264,9 @@ function innerRenderMdNode(indent, node, lastNode, result, maxColumns) {
|
||||||
|
|
||||||
if (node.type === 'code') {
|
if (node.type === 'code') {
|
||||||
newLine();
|
newLine();
|
||||||
|
if (process.env.API_JSON_MODE)
|
||||||
|
result.push(`${indent}\`\`\`${node.codeLang}`);
|
||||||
|
else
|
||||||
result.push(`${indent}\`\`\`${codeLangToHighlighter(node.codeLang)}`);
|
result.push(`${indent}\`\`\`${codeLangToHighlighter(node.codeLang)}`);
|
||||||
for (const line of node.lines)
|
for (const line of node.lines)
|
||||||
result.push(indent + line);
|
result.push(indent + line);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue