notfound.utils

Module Contents

Functions

replace_uris(app, doctree, nodetype, nodeattr)

Replace nodetype URIs from doctree to the proper one.

notfound.utils.replace_uris(app, doctree, nodetype, nodeattr)

Replace nodetype URIs from doctree to the proper one.

If nodetype is an image (docutils.nodes.image), the URL is prefixed with Builder.imagedir and the original image path is added to Builder.images so it’s copied using Sphinx’s internals before finalizing the building.

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

  • doctree (docutils.nodes.document) – doctree representing the document

  • nodetype (docutils.nodes.Node) – type of node to replace URIs

  • nodeattr (str) – node attribute to be replaced