View Single Post
Old 06-10-2025, 04:08 PM   #20
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
Hi All,

To make thigns clearer, I coded up a proof of concept. Nothing is final but I would like people's thoughts.

Here is a sequence of screenshots:

1. initial_xhtml.png shows a blank xhtml epub3 page
2. I highlight the contents of the body tag and then use the "section" tag on my clips bar.
3. It add in the section and then I place my cursor in it and use the Insert menu and select Role...
4. It pops up a full menu of possible Aria Roles and their official descriptions for the user to select from
5. The resulting xhtml screenshot shows it properly added the aria role and any mapped epub:types to the current tag.

Old values of either attributes are replaced. The destination tag is first checked to see if the Aria Role you selected can be used on a tag of that type, and warns you if otherwise.

This provides the full interface for all Aria Publishing roles and forces them to be only used on correct tags. It adds any epub:type that corresponds with it, and properly handles the updating of old attributes or creation of new ones. It also registers the Insert Role menu so that it can be assigned a keyboard shortcut.

This is a time consuming given the almost 40 different Aria publishing roles, but as many have said, users can sidestep this process using their own clips for their most frequently used structures with roles that fill in all the pieces.

I still have to figure out how to disable or grey these menu items out when editing an epub2 but if people like the following approach I will work on that.

1. clips for most often used roles and their associated structures
2. an insert menu that gives you access to all roles and provides descriptions of each role and that check for proper destination tag.

If anyyone wants to play with this proof of concept I have pushed it to my personal repo so it can be cloned from:

https://github.com/kevinhendricks/Sigil.git


I also have attached screenshots.

Any feedback or thoughts welcome.
Attached Thumbnails
Click image for larger version

Name:	intial_xhtml.png
Views:	31
Size:	71.0 KB
ID:	216136   Click image for larger version

Name:	section_clip.png
Views:	28
Size:	12.2 KB
ID:	216137   Click image for larger version

Name:	Insert Menu.png
Views:	34
Size:	116.7 KB
ID:	216138   Click image for larger version

Name:	Add Role.png
Views:	38
Size:	192.2 KB
ID:	216139   Click image for larger version

Name:	result.png
Views:	39
Size:	88.0 KB
ID:	216140  

Last edited by KevinH; 06-10-2025 at 04:13 PM.
KevinH is offline   Reply With Quote