Add docinfo API in extension

Resolves #1162
> I think it would be good to add the pos attribute to the DSL

Definitely.
I didn't add it because the `use_dsl` was a bit "voodoo magic" for me :smile: 

> do you like the name `at_position`

Yes, `pos` or `position` is a bit vague