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

Review diagrams/images in docs and potentially resize to a consistent maximum or use a plugin to make thumbnails #2643

Open
stichbury opened this issue Jun 6, 2023 · 9 comments
Labels
Component: Documentation 📄 Issue/PR for markdown and API documentation

Comments

@stichbury
Copy link
Contributor

Introduction

in PR #2625 I posted this response on taking a look through the diagrams in our docs:

In the section that @astrojuanlu flags (https://docs.kedro.org/en/stable/visualisation/kedro-viz_visualisation.html#automatic-visualisation-updates) there is a pretty large graphic (long vertical drop) and I'm wondering if it would be sensible for me to go through and resize all the images to either a fixed height or width. I'll ask @Mackay031 what he recommends.

Also, am I right in thinking there is a plugin for Sphinx where if you have an image relatively small, you can click on it and it opens it larger so you can review detail? That may be a good option to add so we can reduce sizes to a common maximum for easy scrolling and reading, whilst retaining details.

@stichbury stichbury added the Component: Documentation 📄 Issue/PR for markdown and API documentation label Jun 6, 2023
@stichbury stichbury changed the title <Title> Review diagrams/images in docs and potentially resize to a consistent maximum or use a plugin to make thumbnails Jun 6, 2023
@stichbury
Copy link
Contributor Author

The plugin might be this one https://github.com/sphinx-contrib/images

@Gundalai-Batkhuu
Copy link

@stichbury I would like to try working on this issue using the plugin

The plugin might be this one https://github.com/sphinx-contrib/images

@astrojuanlu
Copy link
Member

@Gundalai-Batkhuu
Copy link

Gundalai-Batkhuu commented Oct 27, 2023

@astrojuanlu It looks like to use this plugin, the source docs need to have .rst extension. In example, the inline reference of the large image mentioned above should become:

.. thumbnail:: docs/source/meta/images/pipeline_visualisation_with_layers.png

from:

"../meta/images/pipeline_visualisation.png"

If we do that, we can make thumbnails and adjust the size of the photos. What do you think?

@astrojuanlu
Copy link
Member

We will not change the docs to rst - but the good news is that you can evaluate rst inside myst

```{eval-rst}
.. figure:: img/fun-fish.png
  :width: 100px
  :name: rst-fun-fish

  Party time!

A reference from inside: :ref:`rst-fun-fish`

A reference from outside: :ref:`syntax/directives/parsing`
```

@Gundalai-Batkhuu
Copy link

@astrojuanlu Thanks for the help. It worked. I've made the following changes:

  • Register the plugin in conf.py
  • Add the plugin config dict in conf.py
  • Converted inline references of all images in kedro-viz_visualisation.md
  • Set the global config for image width to 70%.

Now the images look like this:

image

image

@Gundalai-Batkhuu
Copy link

I have the following questions:

  • Should I change inline refs of all images in the doc pages?
  • Should I set the global width for all images from the conf.py or should I change widths for large images only?

@astrojuanlu
Copy link
Member

Let's start with a PR of what you already have @Gundalai-Batkhuu , and we can discuss about extending it to other parts of the code

@astrojuanlu
Copy link
Member

For future reference, in #3238 we found that https://pypi.org/project/sphinxcontrib-images/ has a bug when rendering the thumbnails on mobile. alternative solutions (or a fix upstream) are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation 📄 Issue/PR for markdown and API documentation
Projects
Status: No status
Development

No branches or pull requests

3 participants