docs: validate member links (#4955)

This commit is contained in:
Pavel Feldman 2021-01-08 16:36:52 -08:00 committed by GitHub
parent b7e0b1b393
commit 3b617b3709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -69,7 +69,7 @@ existing authentication state in new browser contexts.
Web apps use cookie-based or token-based authentication, where authenticated
state is stored as [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies)
or in [local storage](https://developer.mozilla.org/en-US/docs/Web/API/Storage).
Playwright provides [`method: Browser.storageState`] method that can be used to retrieve storage state from authenticated contexts and then create new contexts with prepopulated state.
Playwright provides [`method: BrowserContext.storageState`] method that can be used to retrieve storage state from authenticated contexts and then create new contexts with prepopulated state.
Cookies and local storage state can be used across different browsers. They depend
on your application's authentication model: some apps might require both cookies

View File

@ -22,6 +22,7 @@ const fs = require('fs');
const path = require('path');
const { parseApi } = require('./api_parser');
const missingDocs = require('./missingDocs');
const md = require('../markdown');
/** @typedef {import('./documentation').Type} Type */
/** @typedef {import('../markdown').MarkdownNode} MarkdownNode */
@ -64,6 +65,16 @@ async function run() {
writeAssumeNoop(path.join(PROJECT_DIR, 'README.md'), content, dirtyFiles);
}
// Validate links
{
for (const file of fs.readdirSync(path.join(PROJECT_DIR, 'docs', 'src'))) {
if (!file.endsWith('.md'))
continue;
const data = fs.readFileSync(path.join(PROJECT_DIR, 'docs', 'src', file)).toString();
documentation.renderLinksInText(md.parse(data));
}
}
// Check for missing docs
{
const srcClient = path.join(PROJECT_DIR, 'src', 'client');