Skip to content

differentiating strings in dataframes for nonvisual representations¤

this started because our accessible tables need to be smarter about strings and what they mean.

%%
    import nbconvert_a11y.table
    table = DataFrame([[
```css
.jp-Cell {background: green;}
```
    ,
```css
.jp-Cell {border: solid 3px;}
```
    ]]).T.table(nbconvert_a11y.table.TableOptions(
        ipython_display=False, schema= (schema :=
```toml
title = "a dataframe containing css strings"
[properties.0]
contentMediaType = "text/css"
```
    )))
    schema["$comment"] =\
we need to be able differentiate strings from a table to reason with their nonvisual and visual properties.
for example, some strings may be valid css and others may not be valid.
do we need to access the string on `::before` and `::after` pseudoelements?

futher, i realized that caption and description from the schema should be used in the presentation.

    display(table, schema)
pandas dataframe with 2 rows, 1 columns with 1 index levels and 1 columns levels.
None 0
type
0 .jp-Cell {background: green;}
1 .jp-Cell {border: solid 3px;}
min .jp-Cell {background: green;}
max .jp-Cell {border: solid 3px;}
diff nan

schema

title
a dataframe containing css strings
properties
0
contentMediaType
text/css
{'title': 'a dataframe containing css strings',
 'properties': {'0': {'contentMediaType': 'text/css'}},
 '$comment': 'we need to be able differentiate strings from a table to reason with their nonvisual and visual properties.\nfor example, some strings may be valid css and others may not be valid.\ndo we need to access the string on `::before` and `::after` pseudoelements?\n\nfuther, i realized that caption and description from the schema should be used in the presentation.'}
import nbconvert_a11y.table
table = DataFrame([[
.jp-Cell {background: green;}
,
.jp-Cell {border: solid 3px;}
]]).T.table(nbconvert_a11y.table.TableOptions(
    ipython_display=False, schema= (schema :=
title = "a dataframe containing css strings"
[properties.0]
contentMediaType = "text/css"
)))
schema["$comment"] =\

we need to be able differentiate strings from a table to reason with their nonvisual and visual properties. for example, some strings may be valid css and others may not be valid. do we need to access the string on ::before and ::after pseudoelements?

futher, i realized that caption and description from the schema should be used in the presentation.

display(table, schema)

marginalia¤

i really like this idea because the one cell demonstrates several languages because used in code together.