docs: improve docs (#9179)

This PR drastically improves the documentation by improving the sidebars
and adding a GitHub icon.

Fixed: https://github.com/puppeteer/puppeteer/pull/9176
Fixed: https://github.com/puppeteer/puppeteer/issues/9173


![image](https://user-images.githubusercontent.com/101637635/198374826-399219f6-e04f-4613-9613-f7e3281d332f.png)
This commit is contained in:
jrandolf
2022-10-28 08:49:28 +02:00
committed by GitHub
parent f3ff18e468
commit 2d2120cea1
26 changed files with 386 additions and 289 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
import {readFile, rm, writeFile} from 'fs/promises';
import {copyFile, readFile, rm, writeFile} from 'fs/promises';
import {join, resolve} from 'path';
import {chdir} from 'process';
import semver from 'semver';
@@ -51,13 +51,7 @@ function spliceIntoSection(
(async () => {
const job1 = job('', async ({inputs, outputs}) => {
const content = await readFile(inputs[0]!, 'utf-8');
const sectionContent = `
---
sidebar_position: 1
---
`;
await writeFile(outputs[0]!, sectionContent + content);
await copyFile(inputs[0]!, outputs[0]!);
})
.inputs(['README.md'])
.outputs(['docs/index.md'])