How to get and work on all flashcards from namespaced pages?

Hello, is there a way to recursively search for all flashcards in namespaced pages and work on them?
Up until now I found a way to manually add them using {{cards (or [[Main1/subtopic1/subtopic1]] Main2/subtopic2/subtopic2 … ) }}
But the problem is that i would need manually, every time i create a new namespaced page to update query as well