-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add markdown to persistent notifications #128
Conversation
This will not work. Scripts need to be included via bower and importHref need a url that works, this won't work in prod. I don't have too much time lately so I won't have time to hand hold you through this PR. |
No problem I will add through bower and get it working I ran out of time to On Fri, Oct 14, 2016, 10:35 AM Paulus Schoutsen [email protected]
|
I think I have the frontend ready. Just need some help from @kellerza on the backend so we can do some testing. |
Closing pull request for now, will resubmit once its ready. |
@balloob This is working now. There are a few items to note.
|
@@ -0,0 +1,6 @@ | |||
<script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this file and it's dependencies and put it in the static
folder inside Home Assistant. The polymer dir and bower_components dir are not included in production.
value: false, | ||
}, | ||
|
||
loaded: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have this parameter, this is always exactly the same as scriptLoaded
var el = ''; | ||
var message = ''; | ||
if (loaded) { | ||
el = document.getElementById('pnContent'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polymer will make all DOM elements with an id available at this.$
, so use this.$.pnContent
. It's better that way because otherwise you would only be ever able to have 1 card with markdown syntax
@@ -18,6 +18,7 @@ | |||
"paper-scroll-header-panel": "~1.0.16", | |||
"app-layout": "~0.10.2", | |||
"fecha": "~2.2.0", | |||
"paper-range-slider": "IftachSadeh/paper-range-slider#~0.1.2" | |||
"paper-range-slider": "IftachSadeh/paper-range-slider#~0.1.2", | |||
"micromarkdown.js": "SimonWaldherr/micromarkdown.js#~0.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason to add this to bower.json since we don't import it. However, please include the version number and license inside the new micromarkdown.js folder in Home Assistant repo.
@balloob This should be ready to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to merge when comments addressed.
}; | ||
|
||
this.importHref( | ||
'/static/micromarkdown/micromarkdown-js.html', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script is not located in a micromarkdown
folder.
var message = ''; | ||
if (scriptLoaded) { | ||
el = this.$.pnContent; | ||
message = micromarkdown.parse(stateObj.state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justweb1 Can we try to pass a second parameter of 'True' here? It might fix relative links SimonWaldherr/micromarkdown.js#29
…pdate Add breaking change
This is still a WIP and I have not tested just yet. I wanted to leave it here for feedback from @balloob before I go much further. @kellerza I could use your help modifying the backend to include markdown on the demo for testing.
Related Issue
#123
Related Pull Request
home-assistant/core#3908
home-assistant/core#3919