Hello,
It would be very nice if we could add support for Markdown syntax in the Blueprints inputs description.
Since, for some time now, I have been creating Blueprints for my repetitive automations. As a result, I now have some interesting Blueprints in my instance that I would like to share. But some fields in these Blueprints are rather complex to understand and therefore make sharing a bit complicated.
It is complicated to properly explain how an input works since the description of an input is only plain text (does not even support multiple lines), unlike the title of a Blueprint which can use Markdown and multi-line.
I’m sure that several Blueprints including mines would take advantage of this feature to clarify the description of certain inputs that are more complex to understand for an average user.
Update:
I have already built a functional version of this feature on my DEV environment. If you want, you can go see the pull request on the Github of Home Assistant Frontend .
I am also currently confused by the markdown in description. I have tried adding a code block and horizontal rules to no success. The documentation says that description supports markdown. Has anyone else gotten this to work?
The documentation says that description supports markdown
Indeed, the documentation says that the blueprint description supports Markdown.
But for the inputs descriptions , the documentation doesn’t talk about Markdown.
This is why I’m making this post.
I would like to get this feature added. I have already built a functional version of this feature on my DEV environment. If you want, you can go see the pull request on the Github of Home Assistant Frontend .
This has now been added (2022.5) to Automation Blueprints but strangely not to script blueprints.
Perhaps there could be someone with the knowledge to help with this?
Yeah I know, I’m the one that added it , But thanks!
@sisimomo added Markdown support to Blueprint input descriptions, allowing you to add links to, for example, documentation in your Blueprints.
home-assistant:dev
← sisimomo:blueprint-input-descriptions-markdown
opened 02:22AM - 11 Apr 22 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue or discussion
in the additional information section.
-->
It would be very nice if we could add support for Markdown syntax in the Blueprints inputs description.
Since, for some time now, I have been creating Blueprints for my repetitive automations. As a result, I now have some interesting Blueprints in my instance that I would like to share. But some fields in these Blueprints are rather complex to understand and therefore make sharing a bit complicated.
It is complicated to properly explain how an input works since the description of an input is only plain text (does not even support multiple lines), unlike the description of a Blueprint which can use Markdown and multi-line.
I’m sure that several Blueprints including mines would take advantage of this feature to clarify the description of certain inputs that are more complex to understand for an average user.
Here are a side by side comparaison of my blueprint.
<table>
<tr>
<th>Before</th>
<th>After</th>
</tr>
<tr>
<td valign="top"><img src="https://user-images.githubusercontent.com/27745204/162652295-d3caa3f4-6d1a-4b52-aa3a-63e08f99f74f.png" alt="Before"></td>
<td valign="top"><img src="https://user-images.githubusercontent.com/27745204/162859504-93ebfdd7-bfb1-4e78-9f14-7a8cbeea2cc3.png" alt="After"></td>
</tr>
</table>
## Type of change
<!--
What type of change does your PR introduce to the Home Assistant frontend?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (thank you!)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Example configuration
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR.
-->
```yaml
blueprint:
name: Motion Light Tutorial
description: Turn a light on based on detected motion
domain: automation
input:
motion_sensor:
name: Motion Sensor
description: |
This sensor will be synchronized with the light.
## Here is a Markdown and multilne input description
- __This is strong text!__
- *This is emphasized text!*
selector:
entity:
domain: binary_sensor
device_class: motion
target_light:
name: Lights
description: |
The lights to keep in sync.
## Some HTML
<ul>
<li><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean fringilla velit sit amet lectus tincidunt, quis suscipit tortor maximus. Vestibulum facilisis sit amet tortor sed vestibulum.</p>
<p>Sed nec egestas leo. Nam tristique tincidunt venenatis. Vestibulum vel justo tincidunt, aliquet sapien vitae, vestibulum ex.</p>
<p>Donec commodo, nunc in posuere condimentum, diam est gravida ex, quis varius nisi neque et nunc.</p>
<li><p>Nulla facilisi. Mauris eleifend felis a purus pretium egestas</p>
</ul>
selector:
target:
entity:
domain: light
trigger:
- platform: state
entity_id: !input motion_sensor
action:
- service: >
{% if trigger.to_state.state == "on" %}
light.turn_on
{% else %}
light.turn_off
{% endif %}
target: !input target_light
```
## ~~Additional information~~
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- ~~This PR fixes or closes issue: fixes #~~
- ~~This PR is related to issue or discussion:~~
- ~~Link to documentation pull request:~~
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [x] There is no commented out code in this PR.
- [ ] Tests have been added to verify that the new code works.
~~If user exposed functionality or configuration variables are added/changed:~~
- [ ] ~~Documentation added/updated for [www.home-assistant.io][docs-repository]~~
<!--
Thank you for contributing <3
-->
[docs-repository]: https://github.com/home-assistant/home-assistant.io
3 Likes
Ahh, awesome. Thanks for that, I’m using it, but my script blueprints are oh, so lonely…
1 Like
mdolnik
(Matt Dolnik)
June 4, 2022, 7:02pm
7
Don’t know if it has changed since, but as of HA 2022.5.4
, markdown works for me in the main Blueprint Script description, but does not work in the description of individual selectors.
It has always worked in the main description, both places. I have not tried in a few weeks, but the only place it doesn’t work is the script input descriptions, which was what Sisimomo added for the Automation Blueprints.