mirror of
https://github.com/markqvist/NomadNet.git
synced 2026-10-05 23:27:24 +00:00
Images guide entry stub
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user