Skip to content

Commit

Permalink
Update how-it-works.rst (#77)
Browse files Browse the repository at this point in the history
Update how-it-works.rst
  • Loading branch information
humitos committed Sep 15, 2019
2 parents 3e1159e + 75a0116 commit d78a01a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/how-it-works.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
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.


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.

Expand All @@ -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``.


Expand Down

0 comments on commit d78a01a

Please sign in to comment.