Skip to content

Add documentation for regenerate rule from template - #2518

Merged
stefan-hoehn merged 1 commit into
openhab:mainfrom
Nadahar:regenerate-rules-from-template
Jul 21, 2025
Merged

Add documentation for regenerate rule from template#2518
stefan-hoehn merged 1 commit into
openhab:mainfrom
Nadahar:regenerate-rules-from-template

Conversation

@Nadahar

@Nadahar Nadahar commented Jul 14, 2025

Copy link
Copy Markdown
Contributor

This is more of a suggestion than a "full PR" at this point.

Since regeneration of rules from template is possible from 5.0, we should modify the documentation to reflect this.

@netlify

netlify Bot commented Jul 14, 2025

Copy link
Copy Markdown

Thanks for your pull request to the openHAB documentation! The result can be previewed at the URL below (this comment and the preview will be updated if you add more commits).

Built without sensitive environment variables

Name Link
🔨 Latest commit a911689
🔍 Latest deploy log https://app.netlify.com/projects/openhab-docs-preview/deploys/687a6ed66f2ff30008fa8bfa
😎 Deploy Preview https://deploy-preview-2518--openhab-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Nadahar

Nadahar commented Jul 14, 2025

Copy link
Copy Markdown
Contributor Author

@rkoshak Since you have written the existing documentation for this, I don't feel comfortable modifying it as I'm not sure I fully "follow your train of thoughts". Therefore, I've created this PR more as an input of where different bits might fit in. I think it would be preferable if you used "your words and style", but I hope it's helpful that I've tried to figure out what information could be put where.

However pay attention and if there is more information that might be useful to you later add that.
~~The title and description are optional and will be automatically populated with meaningful information when you select the trigger.
However pay attention and if there is more information that might be useful to you later add that.~~

@Nadahar Nadahar Jul 14, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkoshak I made a change here just as a reminder that this no longer matches how MainUI looks. You can no longer enter title and description at this stage of the "wizard", so it might be confusing to the user when what's shown doesn't match what they see.

@Nadahar

Nadahar commented Jul 14, 2025

Copy link
Copy Markdown
Contributor Author

It should probably also be mentioned somewhere that rules generated from templates in previous versions of OH cannot be regenerated, since they lack the reference to the template. It's thus only rules that have been created in 5.0 or later that can be regenerated.

@rkoshak

rkoshak commented Jul 14, 2025

Copy link
Copy Markdown
Contributor

I don't claim ownership for any part of the docs. I'm not even a maintainer on this repo. It wouldn't be fair to the project if I tried to claim such control as I rarely have the time to devote to it these days. I have no problems with contributions from others and in fact encourage it.

At this point, if we want these changes in before OH 5.0 release someone who is not me needs to complete it.

But upon review I have no issue with what's here. Remove that one section that doesn't match any more and the additions look good as written. I don't really have anything to add or correct.

I'm really happy with the feature. It saves me a lot of time.

LGTM!

@lolodomo

Copy link
Copy Markdown
Contributor

@Nadahar : in case it is ready and inline with what will be available inb OH 5, you have to exit the draft mode and ping @stefan-hoehn for a review & merge.

@Nadahar

Nadahar commented Jul 15, 2025

Copy link
Copy Markdown
Contributor Author

in case it is ready and inline with what will be available inb OH 5, you have to exit the draft mode and ping @stefan-hoehn for a review & merge.

I know, I'm still trying to address some issues.

In particular, I've been trying to figure out a way to have inline images/icons, so that you can e.g. show the button that should be clicked instead of just describing it. But, to no avail this far. The layout options of vuepress seem very limited.

@rkoshak

rkoshak commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

In particular, I've been trying to figure out a way to have inline images/icons, so that you can e.g. show the button that should be clicked instead of just describing it. But, to no avail this far. The layout options of vuepress seem very limited.

I couldn't figure that out way back when I wrote this either, which is why the screenshots are shown the way they are. Things may have changed since then but at least as of a couple years ago inline images were not supported in any way I could figure out.

@Nadahar

Nadahar commented Jul 16, 2025

Copy link
Copy Markdown
Contributor Author

I found a way to make inline icons/images, but I had to create a Vue component to do it. I don't know if this approach is acceptable, but it seems to work, as can be seen from the preview.

I'm not sure who to ask if this is an acceptable approach, input is appreciated. If this is deemed acceptable, I can prepare the PR for review.

@openhab-bot

Copy link
Copy Markdown
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/inline-images-icons-in-documentation/164965/4

@rkoshak

rkoshak commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

@stefan-hoehn is probably the main person who can comment on the approach.

@Nadahar

Nadahar commented Jul 16, 2025

Copy link
Copy Markdown
Contributor Author

@stefan-hoehn What do you think of the solution I made for inline icons/small images? I'm thinking specifically of InlineIcon.vue.

Comment thread .vuepress/components/InlineIcon.vue Outdated
@Nadahar

Nadahar commented Jul 17, 2025

Copy link
Copy Markdown
Contributor Author

I've created openhab/openhab-website#527 which hopefully is what's needed to make this work. That means that this PR depends on openhab/openhab-website#527.

Apart from that, I think it's now ready for review.

@Nadahar
Nadahar marked this pull request as ready for review July 17, 2025 01:46

@florian-h05 florian-h05 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just two comments.

Comment thread tutorials/getting_started/rules_basic.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather name this component InlineImage.
Please also add a section documenting it to https://github.com/openhab/openhab-docs?tab=readme-ov-file#contributing-to-the-documentation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather name this component InlineImage

That was the name I used originally. But then I thought it was too generic, indicating that it was meant for inline images of any size, not aligned to the text, so I changed it. But, I've changed it back now ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@florian-h05 Please check out my addition to the README. As always, brevity isn't my strength, so tell me if there's something I should remove.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the name I used originally. But then I thought it was too generic, indicating that it was meant for inline images of any size, not aligned to the text, so I changed it. But, I've changed it back now ;)

This is a good point, though I think both names can be confusing. Icon means icon for me, not any small image.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs look good, thanks.

@Nadahar
Nadahar force-pushed the regenerate-rules-from-template branch 3 times, most recently from 02af906 to 0c1b086 Compare July 18, 2025 15:55
Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
@Nadahar
Nadahar force-pushed the regenerate-rules-from-template branch from 0c1b086 to a911689 Compare July 18, 2025 15:57
Comment thread README.md

@florian-h05 florian-h05 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Nadahar

Nadahar commented Jul 19, 2025

Copy link
Copy Markdown
Contributor Author

@stefan-hoehn openhab/openhab-website#527 is merged, this should be good to go.

@stefan-hoehn

Copy link
Copy Markdown
Contributor

Did you run and test this locally?

@florian-h05

Copy link
Copy Markdown
Contributor

The deploy preview works fine, why do we need to test that locally?

@Nadahar

Nadahar commented Jul 19, 2025

Copy link
Copy Markdown
Contributor Author

Did you run and test this locally?

Yes, I've used the local build to test this all the way since the inception of the component. How else would I figure out what works and doesn't work?

@Nadahar

Nadahar commented Jul 21, 2025

Copy link
Copy Markdown
Contributor Author

@stefan-hoehn I'm not sure what more to do with this, as far as I can tell it's ready. If you need me to do something more, please tell me.

@stefan-hoehn stefan-hoehn added this to the 5.0 milestone Jul 21, 2025
@stefan-hoehn
stefan-hoehn merged commit c7c7ef9 into openhab:main Jul 21, 2025
5 checks passed
@Nadahar
Nadahar deleted the regenerate-rules-from-template branch July 21, 2025 15:48
florian-h05 pushed a commit that referenced this pull request Jul 21, 2025
Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
Co-authored-by: Ravi Nadahar <nadahar@rediffmail.com>
(cherry picked from commit c7c7ef9)
@florian-h05

Copy link
Copy Markdown
Contributor

Now this needs to be cherry-picked to final-stable to get into the 5.0.x docs ... I have just done this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants