Inline images/icons in documentation

I’ve been trying to figure out a way to display small images/icons inline in text in the documentation, but have failed so far. I’m writing this in the hope of getting some advice as to if this is at all possible, or if not, the knowledge that I should just give up.

The use for this is typically when you want to document a part of the UI.

If you use a full screenshot, it might not be clear what part of the screenshot you’re referring to, and it might require you to edit the image with arrows, circles or dim out the surroundings. This is both “labor-intensive” and highly likely to have a very inconsistent look from one author to another.

The alternative, and what seems to be what’s most used at the moment, is to just describe where to find the button/control in question, “at the far left near the top, click ‘Foo’ then ‘Bar’”. This is clumsy because the layout might be different on different devices, might not stay consistent over time, and can generally require the user to open the UI in the same location while reading the documentation to try to figure out what element is described.

I think it would be much better if you could include a picture of the button/control in question in the documentation: “Click the [picture of magic button] to start the magic”.

Is there any way to make this happen? From what I understand, the documentation is generated using VuePress. VuePress has a number of extensions, and it seems quite a lot of customization ability, but it’s frankly a bit over my head, and it seems like most of it isn’t enabled for the OH documentation build.

I’ve not found a VuePress extension that seems to be close to providing what I want, but it is mentoned that you can use Vue components, for example:

This is default theme built-in `<Badge />` component <Badge text="demo" />

This is where my limited knowledge of Vue blocks further investigation. I’ve looked at the “default components” in the documentation, and none of them seem to be capable of presenting inline images, but does that mean that such a component doesn’t exist, or couldn’t be made for that sake? I don’t know.

Any input is appreciated.

I’ve found icon | VuePress Ecosystem, but it’s not entirely clear to me if it would do what I’m after. Since OH seems to be using VuePress 1.9.10, and vuepress/plugin-icon seems to require 2.0.0, I can’t easily test it either. In either case, this seems like a dead end because of the version.

The Main UI rules docs do this at the end with the blue plus, see Settings - Rules | openHAB.

I don’t quite understand, when looking at the source, it looks just like a regular image:

To add a rule press the plus icon ![add rule](../images/plus.png) in the

Is it simply that you made the image very small?

Anyway, I came up with something closer to what I imagined (it will scale and align itself relative to the text):

This has been done in

https://github.com/openhab/openhab-docs/pull/2518

…but I’m not sure if “I’m allowed” to make/use a component like that in the documentation.

For anybody wondering about the same, this has been resolved and is now documented in the documentation README