diff options
author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2021-10-15 16:03:31 +0000 |
---|---|---|
committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2021-10-15 16:03:31 +0000 |
commit | 161284ecacc4bc7effb7532c7a2a2d6061ee93cd (patch) | |
tree | f03051df0ba25ce58855572ca0ae0ec1e6255ad6 | |
parent | f0bd2c6fbeaf4cc32d57afc8b5db15f509e0a90c (diff) | |
download | docutils-161284ecacc4bc7effb7532c7a2a2d6061ee93cd.tar.gz |
Config setting image_loading: use value "link" instead of "eager".
The name "eager" is too HTML5-centric. The distinction
link/embed may be supported in future also by the ODF/ODT writer.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8854 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r-- | docs/user/config.txt | 12 | ||||
-rw-r--r-- | docutils/writers/_html_base.py | 4 | ||||
-rw-r--r-- | docutils/writers/html5_polyglot/__init__.py | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/docs/user/config.txt b/docs/user/config.txt index eae7feccf..815692ad5 100644 --- a/docs/user/config.txt +++ b/docs/user/config.txt @@ -1342,15 +1342,15 @@ image_loading Suggest at which point images should be loaded. -:embed: If the image can be read from the local file system, it is - base64_ encoded and included as a `data URI`_. - (In future, SVG images will be converted to inline SVG) +:embed: If the image can be read from the local file system, + the image data is embedded into the HTML document. -:eager: load image immediately when opening the HTML document (default). +:link: Link to image in the HTML document (default). -:lazy: Specify the `lazy loading attribute`_ to defer fetching the image. +:lazy: Link to image. Specify the `lazy loading attribute`_ to defer + fetching the image. -Default: "eager". Option: ``--image-loading``. +Default: "link". Option: ``--image-loading``. New in Docutils 0.18. diff --git a/docutils/writers/_html_base.py b/docutils/writers/_html_base.py index 9dcc97179..fb64c509c 100644 --- a/docutils/writers/_html_base.py +++ b/docutils/writers/_html_base.py @@ -319,9 +319,9 @@ class HTMLTranslator(nodes.NodeVisitor): self.section_level = 0 self.initial_header_level = int(settings.initial_header_level) # image_loading only defined for HTML5 writer - self.image_loading = getattr(settings, 'image_loading', 'eager') + self.image_loading = getattr(settings, 'image_loading', 'link') if (getattr(settings, 'embed_images', False) - and self.image_loading == 'eager'): + and self.image_loading == 'link'): self.image_loading = 'embed' self.math_output = settings.math_output.split() self.math_output_options = self.math_output[1:] diff --git a/docutils/writers/html5_polyglot/__init__.py b/docutils/writers/html5_polyglot/__init__.py index f02e6fc14..030124f75 100644 --- a/docutils/writers/html5_polyglot/__init__.py +++ b/docutils/writers/html5_polyglot/__init__.py @@ -93,10 +93,10 @@ class Writer(writers._html_base.Writer): ['--link-images'], {'dest': 'embed_images', 'action': 'store_false'}), ('Suggest at which point images should be loaded: ' - '"embed", "eager" (default), or "lazy".', + '"embed", "link" (default), or "lazy".', ['--image-loading'], - {'choices': ('embed', 'eager', 'lazy'), - 'default': 'eager'}), + {'choices': ('embed', 'link', 'lazy'), + 'default': 'link'}), ('Append a self-link to section headings.', ['--section-self-link'], {'default': 0, 'action': 'store_true'}), |