UIbuilder markweb - minor issue with url paths

Using markweb on uibuilder, I have the node-red folder /home/me/nodered In there I have the markweb root markweb and under that a folder _assets containing images. The markweb demo site suggests that to show an image on a page I should be able to use any of these

![Description](_assets/image.png)
![Description](./_assets/image.png)
![Description](/_assets/image.png)

In the markweb node I have configured the url to be blog and the first two do work and in the browser developer tools it fetches http://server:port/blog/_assets/image.png. The third one, however, fails attempting to fetch http://server:port/_assets/image.png.

I don't need that to work, so it does not bother me if this is simply a documentation error.

Hi Colin, I'll check the docs. Obviously that last one will always try to access from the site root URL whereas the others are from the current page's URL. If that is in the docs, it is likely me being careless with the words. :smiley:

Since Node-RED as a LOT of flexibility around URL paths, some awareness of the different URL formats is helpful. I always recommend that people use the leading dot format for references relative to the current page (in Markweb's case, that translates to the Markweb instance root URL). So ![Image of frog](./_assets/frog.png) would be the preferred format as it helps you to avoid mistakes.

As a reminder to others who may see this thread, people may also see relative URL paths starting with ../uibuilder which points to uibuilder's core end-points.

If people use / as the start of the URL, they must provide everything after the http://<server>:1880 which some may prefer but it can be fragile if you decide to change core node-red settings or Markweb/uibuilder URL names.


Again, thanks for reporting this. It has highlighted a couple of issues with the demo content that I will fix for the next release.

Yes, that is my preferred option too.

By 'docs' I was referring to the demo site.

On a different issue, have you considered providing a copy button on code blocks?

Yes, I found the issue you are referring to, it will be fixed.

Thought about it. It is quite complex to add since I need to further hack the Markdown render library to insert the data for the button and then make changes to the front-end to catch clicks on one of the buttons.

Since it is very easy to select/copy the text anyway, I didn't bother with it in the first release.

It is possible though and so will be in a future release.

Is there a shortcut other than mouse dragging over the text, which is a bit of a pain if it flows over multiple screens full?

Sadly not I'm afraid. I automatically hold down the left mouse button while scrolling with the scroll-wheel which works on many different web sites.

Of course, since the Markweb front-end is simply a vanilla HTML/CSS/JavaScript web site, you are able to add your own work-around if it is critical for you before I can release a new version.

image

Above is the HTML code that is generated for code blocks. AI can help with the code. You can add custom <style> and <script> tags to the page template. The CSS should be able to add the button. The script can add the button handler.

Understood, thanks. No, not critical.