Sphinx can render a file text role in a caption: .. code-block:: console :caption: Directory listing of :file:`var/log/` with rotated logs This looks like:  However, guides can not: 