Run doctest (in PRs) only when some doc example(s) are modified
# What does this PR do?

Run doctest (in PRs) only when some doc example(s) are modified.

This is a fix for #23327 (which is reverted in #23371 due to the wrong logic) .

This PR implements the correct logic for

> for now the tests are launched on a file if we modify it, but I would only launch it if docstrings are modified (e.g. check the modifications are correct) to go faster.

where I go one step further to make it 

> only launch it if some _**doc examples**_ are modified`

(instead of any docstring)
_The documentation is not available anymore as the PR was closed or merged._