mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
docs: remove TOC in main page (#12270)
This commit is contained in:
parent
140f012b51
commit
5116a33d2c
@ -6,20 +6,20 @@
|
|||||||
|
|
||||||
/* eslint-disable import/order */
|
/* eslint-disable import/order */
|
||||||
|
|
||||||
import {copyFile, readFile, writeFile} from 'fs/promises';
|
import {readFile, writeFile} from 'fs/promises';
|
||||||
|
|
||||||
import {docgen, spliceIntoSection} from '@puppeteer/docgen';
|
import {docgen, spliceIntoSection} from '@puppeteer/docgen';
|
||||||
import {execa} from 'execa';
|
import {execa} from 'execa';
|
||||||
import {task} from 'hereby';
|
import {task} from 'hereby';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
|
|
||||||
export const docsNgSchematicsTask = task({
|
function addNoTocHeader(markdown) {
|
||||||
name: 'docs:ng-schematics',
|
return `---
|
||||||
run: async () => {
|
hide_table_of_contents: true
|
||||||
const readme = await readFile('packages/ng-schematics/README.md', 'utf-8');
|
---
|
||||||
await writeFile('docs/guides/ng-schematics.md', readme);
|
|
||||||
},
|
${markdown}`;
|
||||||
});
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This logic should match the one in `website/docusaurus.config.js`.
|
* This logic should match the one in `website/docusaurus.config.js`.
|
||||||
@ -34,6 +34,14 @@ function getApiUrl(version) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const docsNgSchematicsTask = task({
|
||||||
|
name: 'docs:ng-schematics',
|
||||||
|
run: async () => {
|
||||||
|
const readme = await readFile('packages/ng-schematics/README.md', 'utf-8');
|
||||||
|
await writeFile('docs/guides/ng-schematics.md', readme);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const docsChromiumSupportTask = task({
|
export const docsChromiumSupportTask = task({
|
||||||
name: 'docs:supported-browsers',
|
name: 'docs:supported-browsers',
|
||||||
run: async () => {
|
run: async () => {
|
||||||
@ -72,7 +80,8 @@ export const docsTask = task({
|
|||||||
dependencies: [docsNgSchematicsTask, docsChromiumSupportTask],
|
dependencies: [docsNgSchematicsTask, docsChromiumSupportTask],
|
||||||
run: async () => {
|
run: async () => {
|
||||||
// Copy main page.
|
// Copy main page.
|
||||||
await copyFile('README.md', 'docs/index.md');
|
const mainPage = await readFile('README.md', 'utf-8');
|
||||||
|
await writeFile('docs/index.md', addNoTocHeader(mainPage));
|
||||||
|
|
||||||
// Generate documentation
|
// Generate documentation
|
||||||
for (const [name, folder] of [
|
for (const [name, folder] of [
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
---
|
||||||
|
hide_table_of_contents: true
|
||||||
|
---
|
||||||
|
|
||||||
# Puppeteer
|
# Puppeteer
|
||||||
|
|
||||||
[![build](https://github.com/puppeteer/puppeteer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/puppeteer/puppeteer/actions/workflows/ci.yml)
|
[![build](https://github.com/puppeteer/puppeteer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/puppeteer/puppeteer/actions/workflows/ci.yml)
|
||||||
|
Loading…
Reference in New Issue
Block a user