diff --git a/docs/how-it-works.rst b/docs/how-it-works.rst index 8d71c09..06377b5 100644 --- a/docs/how-it-works.rst +++ b/docs/how-it-works.rst @@ -1,7 +1,7 @@ How It Works ============ -The extension subscribes to some events emitted by Sphinx application. +The extension subscribes to some events emitted by the Sphinx application. When these events are triggered, our functions are called and they manipulate the doctree and context passed to the template. @@ -9,20 +9,20 @@ our functions are called and they manipulate the doctree and context passed to t Events subscribed ----------------- -There are 3 main events that this extension subscribes, +There are 3 main events that this extension subscribes: * ``doctree-resolved`` * ``html-collect-pages`` * ``html-page-context`` Each one has an specific goal persuading the same objective: -make all the resources URLs absolutes. +make all resources URLs absolutes. doctree-resolved ~~~~~~~~~~~~~~~~ -Once Sphinx has parsed our source files, this event is triggered. +After Sphinx has parsed our source files, this event is triggered. Here, we check if the page being rendered is ``notfound_pagename`` and in that case, we replace all the URLs for ``.. image::``, ``.. figure::`` and other directives to point the right path. @@ -32,8 +32,8 @@ html-collect-pages After all HTML pages are collected and this event is emitted, we check for the existence of a ``404`` page already. -If the is one, we do nothing here. -On the other hand, if the user has not defined this page, +If there is one, we do not need to do anything here. +If the user has not defined this page, we render the template ``notfound_template`` with the context ``notfound_context``.