Hello,
I'm sorry, I didn't mention, how to add a macro to a field, so the repeater web part contains the
Select top N documents property and there is a small black arrow next to it -> click it and paste the macro there.
Please make sure, that you are using Kentico
CMS with the latest hotfix, because there was some difficulties with macros in integer's fields.
Best regards,
Jan Hermann