Skip to content

Commit 542c3a7

Browse files
authored
docs: adjust style of the landing page (#191)
1 parent 54aabff commit 542c3a7

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
10+
- name: Set up Node.js
11+
uses: actions/setup-node@v1
12+
with:
13+
node-version: 12.x
1014
- name: Set up Python
1115
uses: actions/setup-python@v2
1216
with:
@@ -18,6 +22,8 @@ jobs:
1822
pip install -e .
1923
- name: Generate docs
2024
run: pdoc3 --html -o htmldocs playwright
25+
- name: Post doc generation
26+
run: node scripts/postPdoc3Generation.js
2127
- name: Deploy
2228
uses: peaceiris/actions-gh-pages@v3
2329
with:

playwright/__init__.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
"""
15+
Python package `playwright` is a Python library to automate Chromium,
16+
Firefox and WebKit with a single API. Playwright is built to enable cross-browser
17+
web automation that is ever-green, capable, reliable and fast.
18+
For more information you'll find the documentation for the sync API [here](sync_api.html)
19+
and for the async API [here](async_api.html).
20+
"""
1421

1522
import playwright.helper as helper
1623
from playwright.main import AsyncPlaywrightContextManager, SyncPlaywrightContextManager
@@ -33,3 +40,37 @@ def sync_playwright() -> SyncPlaywrightContextManager:
3340
"Error",
3441
"TimeoutError",
3542
]
43+
44+
__pdoc__ = {
45+
"accessibility": False,
46+
"async_base": False,
47+
"browser": False,
48+
"browser_context": False,
49+
"browser_type": False,
50+
"cdp_session": False,
51+
"chromium_browser_context": False,
52+
"connection": False,
53+
"console_message": False,
54+
"dialog": False,
55+
"download": False,
56+
"element_handle": False,
57+
"event_context_manager": False,
58+
"file_chooser": False,
59+
"frame": False,
60+
"helper": False,
61+
"impl_to_api_mapping": False,
62+
"input": False,
63+
"js_handle": False,
64+
"main": False,
65+
"network": False,
66+
"object_factory": False,
67+
"page": False,
68+
"path_utils": False,
69+
"playwright": False,
70+
"selectors": False,
71+
"sync_base": False,
72+
"transport": False,
73+
"wait_helper": False,
74+
"async_playwright": False,
75+
"sync_playwright": False,
76+
}

scripts/postPdoc3Generation.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const fs = require('fs');
2+
3+
// Removes the sidebar on the landing page (/)
4+
const indexPath = 'htmldocs/playwright/index.html';
5+
let input = fs.readFileSync(indexPath).toString();
6+
input = input.replace(/<nav id="sidebar">.*<\/nav>/s, '');
7+
fs.writeFileSync(indexPath, input);

0 commit comments

Comments
 (0)