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

a demo to the sa11y checker to the demo #99

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
6 changes: 3 additions & 3 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
on:
pull_request:
types:
- opened
- opened

jobs:
comment:
Expand All @@ -15,4 +15,4 @@ jobs:
with:
message: |
A preview fo the exported examples will be rendered at
https://iota-school.github.io/notebooks-for-all/branch/${{ github.event.pull_request.head.ref }}/exports/html
https://${{ github.repository_owner }}.github.io/nbconvert-a11y/branch/${{ github.event.pull_request.head.ref }}/exports/html/lorenz-executed-a11y.html
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ jobs:
uses: actions/cache@v2
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 1
CACHE_NUMBER: 2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('test-environment.yml') }}
hashFiles('.github/test-environment.yml') }}
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: test-environment.yml
environment-file: .github/test-environment.yml
cache-environment: true
- name: init plawright
run: |
Expand All @@ -70,12 +70,6 @@ jobs:
# we run this script to generate assets and test the nbconvert-a11y module.
# failures here will stop any docs builds
pytest tests/test_smoke.py
- name: a11y tests
# always build the docs to see what the new versions look like.
continue-on-error: true
run: |
pytest --deselect tests/test_smoke.py \
-n auto --self-contained-html --html=tests/exports/pytest/report.html
- name: build wheel and sdist
run: |
python -m build
Expand All @@ -90,6 +84,12 @@ jobs:
with:
name: site
path: site
- name: a11y tests
# always build the docs to see what the new versions look like.
# continue-on-error: true
run: |
pytest --deselect tests/test_smoke.py \
-n auto --self-contained-html --html=tests/exports/pytest/report.html
publish:
name: publish the mkdocs build to github pages
needs: [test]
Expand Down Expand Up @@ -154,4 +154,4 @@ jobs:
- uses: ncipollo/release-action@v1
with:
artifacts: "dist/.*"
draft: true # does not trigger a created event
draft: true # does not trigger a created event
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
# Astronomy Notebooks for All
Jupyter Notebooks play a central role in modern data science workflows. Despite their importance, these notebooks are inaccessible to people with disabilities, especially those who rely on assistive technology. Impacted users must find extreme workarounds or [give up using them entirely.](https://www.freelists.org/post/program-l/Accessability-of-Jupyter-notebooks) Students with disabilities have [reported leaving their field](https://github.com/jupyterlab/jupyterlab/issues/9399#issuecomment-740524422) once they learn their chosen career’s foundational tools are inaccessible to them.
# `nbconvert-a11y`

This is a challenging problem to solve. The Notebooks for All project is taking the first steps, initially focusing on static notebooks:
- Running usability feedback sessions with impacted users who rely on a variety of assistive technology
- Capturing what makes notebooks inaccessible with assistive technology, and compiling documents that describe the issues and feedback
- Editing notebooks based on the feedback
- Organizing events to spread awareness in the scientific community about this issue
`nbconvert-a11y` contains templates for accessible notebook representations and accessibility tests for Jupyter notebook products.

## Collaborators
[Space Telescope Science Institute](https://www.stsci.edu/) produces extensive community resources and infrastructure in Jupyter. The Institute has committed to fostering an inclusive environment and has funded this project in 2022-2023 as part of the Director’s Discretionary Fund. Other collaborators include community contributions and work from STEM- and accessibility-focused organizations such as [Iota School](https://iotaschool.com/) and [Quansight Labs](https://www.quansight.com/labs).
```bash
pip install nbconvert-a11y
```

## Resources
[A Curated List of STScI notebooks](https://github.com/spacetelescope/notebooks)
[Accessibility Analysis of Jupyter Notebook HTML Output](https://www.youtube.com/watch?v=KsUF_HjA97U&t=253s)
[Astronomy Notebooks For All full proposal](resources/proposal-astronomy-notebooks-for-all.md)
`nbconvert-a11y` can be used with the [`nbconvert` command line tool](https://nbconvert.readthedocs.io/en/latest/usage.html).
it provides the `a11y` exporter with several variants that can be used. the default theme uses a flexible table representation

```bash
jupyter nbconvert --to a11y Untitled.ipynb # flexible table navigation
jupyter nbconvert --to a11y-table Untitled.ipynb # a11y is an alias for a11y-table
jupyter nbconvert --to a11y-landmark Untitled.ipynb # cells are section landmarks
jupyter nbconvert --to a11y-list Untitled.ipynb # cells are list items
```

```python
from nbconvert_a11y.exporter import A11y, Table, Section, List
```

## History

the `nbconvert-a11y` project is forked from initial development in the [`notebook-for-all`]() repository.
this collaboration between [Space Telescope Science Institute](https://www.stsci.edu/), [Iota School](https://iotaschool.com/) and [Quansight Labs](https://www.quansight.com/labs)
brought input from blind and visual impaired notebook users as to what their most assistive experiences could be.

## License
This repository hosts mixed content types. Suitable licenses apply to each type. All of the repository except the `[user-tests](user-tests)` directory are under a [3-Clause BSD license](LICENSE). All content in the `[user-tests](user-tests)` directory is under a [CC-BY license](https://creativecommons.org/licenses/by/4.0/).
Licensed e under a [3-Clause BSD license](LICENSE).
9 changes: 0 additions & 9 deletions convert.py

This file was deleted.

24 changes: 12 additions & 12 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,18 @@ def readme(target, ext, title):
}
# this is missing the file_deps and targets
# they can be computed
for d in "user-tests resources".split():
DIR = Path(d)
files = [x for x in DIR.rglob("*") if x.is_file()]
targets = [EXPORTS / x for x in files]
print(EXPORTS / DIR)
yield {
"name": d,
"actions": [(cp, (DIR, EXPORTS / DIR))],
"clean": [f"""rm -rf {EXPORTS / DIR}"""],
"file_dep": files,
"targets": targets,
}
# for d in "user-tests resources".split():
# DIR = Path(d)
# files = [x for x in DIR.rglob("*") if x.is_file()]
# targets = [EXPORTS / x for x in files]
# print(EXPORTS / DIR)
# yield {
# "name": d,
# "actions": [(cp, (DIR, EXPORTS / DIR))],
# "clean": [f"""rm -rf {EXPORTS / DIR}"""],
# "file_dep": files,
# "targets": targets,
# }


# @task_params(
Expand Down
7 changes: 0 additions & 7 deletions nbconvert_a11y/_selectors.py

This file was deleted.

Loading
Loading