From ff73e325024becd2c63187faef82cf4c558ef38e Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 5 Sep 2026 22:53:55 +0200 Subject: [PATCH] Images guide entry stub --- nomadnet/ui/textui/Guide.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/nomadnet/ui/textui/Guide.py b/nomadnet/ui/textui/Guide.py index aa97121..d245d26 100644 --- a/nomadnet/ui/textui/Guide.py +++ b/nomadnet/ui/textui/Guide.py @@ -91,6 +91,7 @@ class GuideColumns(urwid.Columns): class GuideLinkDelegate: def __init__(self, app, reader=None): self.app = app + self.g = app.ui.glyphs self.reader = reader self.last_keypress = 0 @@ -100,6 +101,17 @@ class GuideLinkDelegate: def micron_released_focus(self): self.reader.focus_topics() + def resolve_image(self, url): + RNS.log(f"RESOLVE {url}") + if url.endswith("demo.webp"): + import os + import nomadnet.ui.textui.images as images_module + path = f"{os.path.dirname(images_module.__file__)}/demo.webp" + RNS.log(path) + return path + + return None + def handle_link(self, target, fields=None): if not target: return @@ -1450,6 +1462,7 @@ With micron you can easily create structured documents and pages with formatting `F79d`_`[Links`#links]`_`f `F79d`_`[Anchors`#anchors]`_`f `F79d`_`[Tables`#tables]`_`f + `F79d`_`[Images`#images]`_`f `F79d`_`[Fields & Requests`#fields-requests]`_`f `F79d`_`[Comments`#comments]`_`f `F79d`_`[Partials`#partials]`_`f @@ -1776,6 +1789,20 @@ The above markup produces the following table: | Orange | Ask, nicely | 3 | `t +>Images + +You can include images. + +`Faaa +`= +`(The RNS logo`w=60%`a=center`:/media/demo.webp) +`= +`` + +If your terminal supports image rendering, the image will be displayed as specified. If not, a text placeholder is shown instead: + +`(The RNS logo`w=60%`a=center`:/media/demo.webp) + >Fields & Requests Nomad Network lets you use simple input fields for submitting data to node-side applications. Submitted data, along with other session variables will be available to the node-side script / program as environment variables.