Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new playground to the docs #1184

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

ericwb
Copy link
Member

@ericwb ericwb commented Oct 4, 2024

This change introduces a new playground in the docs where a user can test out Bandit right within their browser. This code uses PyScript (and sphinx-pyscript) to generate an editor window on a sphinx page in our docs. When the user clicks the play button, it runs Bandit against the example code they have provided.

If Bandit finds issues it renders them in a box on the same page under the editable code.

The editor windows by default includes an example of correct and incorrect usage of ssl context.

@ericwb
Copy link
Member Author

ericwb commented Oct 4, 2024

Screenshot 2024-10-04 at 3 30 45 PM

@ericwb
Copy link
Member Author

ericwb commented Oct 4, 2024

Note, this PR is a draft because its utilizing a few hacks to enable it to work properly. Once sphinx-extensions2/sphinx-pyscript#6 has merged and a release issued to PyPI, then this change could be more appropriately merged.

This change introduces a new playground in the docs where a
user can test out Bandit right within their browser. This
code uses PyScript (and sphinx-pyscript) to generate an editor
window on a sphinx page in our docs. When the user clicks the
play button, it runs Bandit against the example code they have
provided.

If Bandit finds issues it renders them in a box on the same page
under the editable code.

The editor windows by default includes an example of correct and
incorrect usage of ssl context.

Signed-off-by: Eric Brown <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant