Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update how-it-works.rst #77

Merged
merged 1 commit into from
Sep 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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