Skip to content

Conversation

@siwelwerd
Copy link
Contributor

Closes #903 . I don't know if this is the "right" solution, but I tried to write this in a way that it could be adapted to apply to #764 .

Example usages:

root@773dafec85fa:/workspaces/library $ python scripts/xpath_wrapper.py --element image --element interactive --no-child description  source/linear-algebra/source/*/*.ptx --display-query
Applying query //*[(self::image or self::interactive)and not(child::description)]
Found in source/linear-algebra/source/01-LE/02.ptx:
Line 336
Found in source/linear-algebra/source/02-EV/02.ptx:
Line 45
Line 65
Line 111
Line 158
Found in source/linear-algebra/source/02-EV/04.ptx:
Line 87
Found in source/linear-algebra/source/03-AT/01.ptx:
Line 86
Line 121
Found in source/linear-algebra/source/03-AT/03.ptx:
Line 95
Line 259
Found in source/linear-algebra/source/03-AT/04.ptx:
Line 47
Line 202
Line 411
Line 487
Line 712
Found in source/linear-algebra/source/04-MX/01.ptx:
Line 47
Found in source/linear-algebra/source/05-GT/01.ptx:
Line 48
Line 65
Line 101
Line 150
Line 184
Line 228
Line 269
Line 300
Line 318
Line 343
Line 416
Line 463
Line 571
Found in source/linear-algebra/source/05-GT/02.ptx:
Line 59
Found in source/linear-algebra/source/05-GT/03.ptx:
Line 86
Line 133
Line 167
Found in source/linear-algebra/source/applications/pagerank.ptx:
Line 19
Line 89
Line 130
Line 219
Line 288
Line 347
Line 405
Line 450
Found in source/linear-algebra/source/applications/truss.ptx:
Line 14
Line 18
Line 37
Line 68
Line 88
Line 117
Line 248
Line 266
Line 294
Line 323
Line 358
Line 462
root@773dafec85fa:/workspaces/library $ python scripts/xpath_wrapper.py --query '//*[(self::image or self::interactive) and not(child::description)]' source/linear-algebra/source/02-EV/*.ptx
Found in source/linear-algebra/source/02-EV/02.ptx:
Line 45
Line 65
Line 111
Line 158
Found in source/linear-algebra/source/02-EV/04.ptx:
Line 87

@siwelwerd siwelwerd added the technical Requires modifying project's technology infrastructure or non-trivial programming label Jan 5, 2026
@siwelwerd siwelwerd requested a review from StevenClontz January 5, 2026 23:58
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

🚀 Preview available 🚀

https://0caf4b83.tbil.pages.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical Requires modifying project's technology infrastructure or non-trivial programming

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Xpath lxml python wrapper

2 participants