You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
615 B
24 lines
615 B
4 years ago
|
"""
|
||
|
sphinx.environment.adapters.asset
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
|
||
|
Assets adapter for sphinx.environment.
|
||
|
|
||
|
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
|
||
|
:license: BSD, see LICENSE for details.
|
||
|
"""
|
||
|
|
||
|
from sphinx.environment import BuildEnvironment
|
||
|
|
||
|
|
||
|
class ImageAdapter:
|
||
|
def __init__(self, env: BuildEnvironment) -> None:
|
||
|
self.env = env
|
||
|
|
||
|
def get_original_image_uri(self, name: str) -> str:
|
||
|
"""Get the original image URI."""
|
||
|
while name in self.env.original_image_uri:
|
||
|
name = self.env.original_image_uri[name]
|
||
|
|
||
|
return name
|