implement reStructuredText directive 'contents'