How to run a @example block and get the result inside a docstring?

Yes. The reason is that docstrings should be consistent in the REPL and the docs, so Documenter does not touch them (except for checking doctests).