πΌοΈ Working with ImagesΒΆ
How to include and work with images in documentation
OverviewΒΆ
Images are an essential component of documentation, serving to illustrate concepts, display screenshots, and visualize data. Introligo supports images through markdown includes, simplifying the integration of visual content into documentation.
Image OrganizationΒΆ
Directory StructureΒΆ
For Sphinx documentation, images should be placed in the _static directory:
docs/
βββ _static/
β βββ images/ # Images for documentation
β βββ logo.png
β βββ screenshot1.png
β βββ diagram.svg
βββ composition/
β βββ markdown/
β βββ md_tutorial/
β βββ working_with_images.md
βββ generated/ # Generated RST files
βββ user_guide/
βββ markdown_includes/
βββ working_with_images.rst
Rationale for using `_static`:
The _static directory is Sphinxβs standard location for static assets including images, CSS, and JavaScript. Files in _static are automatically copied to the build output and remain accessible via the _static/ path in generated documentation.
Including Images in MarkdownΒΆ
Basic Image SyntaxΒΆ
Use standard markdown image syntax with paths to _static/images:

Image with TitleΒΆ

Understanding Image PathsΒΆ
Important: Paths must be relative to where the generated RST files will be located, not relative to the markdown source file.
For Introligo with default settings: - Markdown files are in: docs/composition/markdown/md_tutorial/ - Generated RST files end up in: docs/generated/user_guide/markdown_includes/ - Images should be in: docs/_static/images/ - Therefore, use path: ../../../_static/images/filename.png (go up 3 levels, then into _static/images)
# Standard path for images in Introligo documentation

Image ExamplesΒΆ
Example 1: Simple ImageΒΆ
The first example demonstrates basic image inclusion:
This image demonstrates a basic image inclusion. The syntax used:

Note: The path ../../../_static/images/ works because: - Generated RST files are in docs/generated/user_guide/markdown_includes/ - Go up 3 levels (../../../) to reach docs/ - Then access _static/images/ directory where images are stored
Example 2: Image with CaptionΒΆ
The second example demonstrates the use of descriptive alt text:
This image includes more descriptive alt text for better accessibility:

Best PracticesΒΆ
1. Use Descriptive Alt TextΒΆ
Always provide meaningful alt text for accessibility:
Recommended: 
Not recommended: 
2. Optimize Image SizesΒΆ
PNG: Good for screenshots, diagrams, logos
JPG/JPEG: Good for photos, complex images
SVG: Best for diagrams, icons (scalable)
GIF: For simple animations
Recommended maximum dimensions: - Screenshots: 1920px width maximum - Diagrams: 1200px width maximum - Icons/logos: 512px maximum
3. Consistent Naming ConventionΒΆ
Use clear, descriptive filenames:
Recommended:
- user-login-flow.png
- architecture-diagram.svg
- installation-screenshot-01.png
Not recommended:
- img1.png
- screenshot.png
- pic.jpg
4. Image Directory OrganizationΒΆ
For large projects, organize by category in _static/images:
docs/_static/images/
βββ screenshots/
β βββ installation/
β β βββ step1.png
β β βββ step2.png
β βββ usage/
β βββ interface.png
βββ diagrams/
β βββ architecture.svg
β βββ workflow.svg
βββ logos/
βββ project-logo.png
Reference with subdirectories (adjust ../../../ based on your RST depth):


Advanced TechniquesΒΆ
Responsive ImagesΒΆ
While markdown doesnβt support responsive images directly, you can use RST directives in your markdown when needed. Introligo converts markdown to RST, so you can mix formats:
This is markdown text.
.. figure:: ../../../_static/images/diagram.png
:width: 80%
:align: center
:alt: System Architecture
System Architecture Diagram
Image AlignmentΒΆ
For centered images in RST (mixed with markdown):
.. image:: ../../../_static/images/logo.png
:align: center
:width: 300px
Multiple Images in a RowΒΆ
Using RST table syntax for side-by-side images (using your actual images):
.. list-table::
:widths: 50 50
* - .. figure:: ../../../_static/images/image1.png
:width: 100%
Caption for Image 1
- .. figure:: ../../../_static/images/image2.png
:width: 100%
Caption for Image 2
Image ChecklistΒΆ
Before adding images to documentation:
- Image is optimized for web (reasonable file size)
- Filename is descriptive and uses kebab-case
- Alt text is meaningful and descriptive
- Image is in the
_static/imagesdirectory or subdirectory - Relative path is correct from generated RST location
- Image format is appropriate (PNG/JPG/SVG)
- Image is version controlled (committed to git)
- Copyright/license is clear (if not your own image)
Example ConfigurationΒΆ
The following demonstrates how to include this tutorial with images in introligo_config.yaml:
modules:
markdown_images:
parent: "markdown_includes"
title: "πΌοΈ Working with Images"
description: "How to include and work with images in documentation"
markdown_includes: "markdown/md_tutorial/working_with_images.md"
Additional RecommendationsΒΆ
Version Control for ImagesΒΆ
Always commit images to your repository so the documentation builds correctly for all team members:
git add docs/_static/images/new-image.png
git commit -m "docs: Add new diagram to image tutorial"
Preview Before CommittingΒΆ
Build and preview documentation locally before committing changes:
python -m introligo docs/composition/introligo_config.yaml -o docs
cd docs && sphinx-build -b html . _build/html
Dark Mode ConsiderationsΒΆ
For documentation supporting dark mode themes, consider providing alternative images or using SVGs with appropriate colors.
Accessibility ConsiderationsΒΆ
Proper alt text provides multiple benefits: - Assists screen reader users in understanding content - Provides fallback when images fail to load - Improves search engine indexing of documentation