notfound.extension — sphinx-notfound-page 0.4 documentation

# `notfound.extension`

## Module Contents

exception `notfound.extension.` `BaseURIError`(: unicode, message: Exception, orig_exc=None)

  Bases: `sphinx.errors.ExtensionError`

  Exception for malformed base URI.

`notfound.extension.` `html_collect_pages`(app)

  Create a `404.html` page.

  Uses `notfound_template` as a template to be rendered with `notfound_context` for its context. The resulting file generated is `notfound_pagename`.html.

  If the user already defined a page with pagename title `notfound_pagename`, we don’t generate this page.

  Parameters: | app (sphinx.application.Sphinx) – Sphinx Application

`notfound.extension.` `finalize_media`(app, pagename, templatename, context, doctree)

  Point media files at our media server.

  Generate absolute URLs for resources (js, images, css, etc) to point to the right. For example, if a URL in the page is `_static/js/custom.js` it will be replaced by `<notfound_urls_prefix>/_static/js/custom.js`.

  On the other hand, if `notfound_no_urls_prefix` is set, it will be replaced by `/_static/js/custom.js`.

  Also, all the links from the sidebar (toctree) are replaced with their absolute version. For example, `../section/pagename.html` will be replaced by `/section/pagename.html`.

  Parameters: | app (sphinx.application.Sphinx) – Sphinx Application pagename (str) – name of the page being rendered templatename (str) – template used to render the page context (dict) – context used to render the page doctree (docutils.nodes.document) – doctree of the page being rendered

`notfound.extension.` `doctree_resolved`(app, doctree, docname)

  Generate and override URLs for `.. image::` Sphinx directive.

  When `.. image::` is used in the `404.rst` file, this function will override the URLs to point to the right place.

  Parameters: | app (sphinx.application.Sphinx) – Sphinx Application doctree (docutils.nodes.document) – doctree representing the document docname (str) – name of the document

class `notfound.extension.` `OrphanMetadataCollector`

  Bases: `sphinx.environment.collectors.EnvironmentCollector`

  Force the 404 page to be `orphan`.

  This way we remove the WARNING that Sphinx raises saying the page is not included in any toctree.

  This collector has the same effect than `:orphan:` at the top of the page.

  `clear_doc`(self, app, env, docname)
  `process_doc`(self, app, doctree)

`notfound.extension.` `handle_config`(app, config)

  Handle deprecated configurations.

  Looks for old deprecated configurations, define the new ones and triggers warnings for old configs.

`notfound.extension.` `setup`(app)

← notfound">`notfound.utils`">`© Copyright 2019, Manuel Kaufmann.
A typlog sphinx theme, designed by Hsiaoming Yang.`