Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/markdown/capabilities/app-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Namely, it described the concept of a smart contract development lifecycle:
1. **Validate** the deployed app via automated testing of the smart contracts to provide confidence in their correctness
2. **Call** deployed smart contract with runtime parameters to utilise it

![App deployment lifecycle](images/lifecycle.jpg)
![App deployment lifecycle](../images/lifecycle.jpg)

The App deployment capability provided by AlgoKit Utils helps implement **#2 Deployment**.

Expand Down
13 changes: 13 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import os
import shutil
from pathlib import Path
from docutils import nodes

def copy_images_for_markdown(app, exception):
"""Copy images from source/images to markdown/images for markdown builds."""
Expand All @@ -82,9 +83,21 @@ def copy_images_for_markdown(app, exception):
shutil.copy2(image_file, dest_images / image_file.name)
print(f"Copied {image_file.name} to {dest_images}")

def fix_image_paths_in_doctree(app, doctree, docname):
"""Fix image paths in doctree to preserve relative paths for markdown output."""
if app.builder.name == 'markdown':
for node in doctree.traverse(nodes.image):
if 'uri' in node:
uri = node['uri']
# If the URI was resolved from ../images/ to images/, change it back
if uri.startswith('images/') and not uri.startswith('../'):
node['uri'] = '../' + uri
print(f"Fixed image path: {uri} -> {node['uri']}")

def setup(app):
"""Sphinx extension setup function."""
app.connect('build-finished', copy_images_for_markdown)
app.connect('doctree-resolved', fix_image_paths_in_doctree)
return {
'version': '1.0',
'parallel_read_safe': True,
Expand Down
Loading