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

Currently, I am using DocStringExtensions and the abbreviations, e.g. $SIGNATURES, are helping me a lot by generating information inside the docstrings.

I was expecting something similar with Documenter and the @example block to get examples results.

For instance:

"""
    f(a)

A fancy function.

```@example
a=1
f(a)
```
"""
f(a) = a+1

In this example, the resulting HTML generated by Documenter contains the example but not the result. Is there a way to get this working? Is the @example block intended to work only in the markdown file?

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).

Got it. Maybe the DocStringExtensions package guys will propose a new abbreviation for this purpose in the future.