A Shpinx extension to embed webpage screenshots.
Project description
sphinxcontrib-screenshot
A Sphinx extension to embed website screenshots.
Install
pip install sphinxcontrib-screenshot
playwright install
Usage
Add sphinxcontrib.screenshot
to your conf.py
.
extensions = ["sphinxcontrib.screenshot"]
Then use the screenshot
directive in your Sphinx source file.
.. screenshot:: http://www.example.com
You can also specify the screen size for the screenshot with width
and height
parameters.
.. screenshot:: http://www.example.com
:width: 1280
:height: 960
You can include a caption for the screenshot's figure
directive.
.. screenshot:: http://www.example.com
:caption: This is a screenshot for www.example.com
You can describe the interaction that you want to have with the webpage before taking a screenshot. page
is the Playwright's Page instance.
.. screenshot:: http://www.example.com
page.get_by_role('link').click()
Notes
This extension uses Playwright to capture a screenshot of the specified website only. No data is sent to any other external server; the request is limited to the specified website. Be cautious: avoid including sensitive information (such as authentication data) in the directive content.
Contributing
See CONTRIBUTING.md
for details.
License
Apache 2.0; see LICENSE
for details.
Disclaimer
This project is not an official Google project. It is not supported by Google and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sphinxcontrib-screenshot-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 669b17c8da6985d74c51ad739896407a0e6b04f60108a2c346c5fe9af46ee4c7 |
|
MD5 | 893cf4f6fa97343f0a3a48a19e153cae |
|
BLAKE2b-256 | 2122a3973d4202af1b92395762465f7322b9dbbc5892ef62932e0b01ef1029fa |
Hashes for sphinxcontrib_screenshot-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f73f35db9145d8988b3d9130ce0eaace0b95547ec1a1c17b0deaac68b54bf93 |
|
MD5 | 4deb893883a11516bf262b85fd5825c4 |
|
BLAKE2b-256 | 1606b1a9eefc5a862ace4365835ec630722309c67d8f86a024a585d84457c8ab |