Skip to content

Commit

Permalink
docs: validate member links (#4955)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman committed Jan 9, 2021
1 parent b7e0b1b commit 3b617b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/auth.md
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions utils/doclint/cli.js
Expand Up @@ -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 */
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 3b617b3

Please sign in to comment.