You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
i could not find an earlier post about this, i'm sure this must have been talked about many times before.
I use YAML to program code for (esphome)[www.esphome.io] for some time now. And YAML is good way to be used in this context.
But sometime I would love to block out data without removing the whole "code" block. i know you could add a # for every line but when you need a lot of line it is not that nice. Having a way to easily blockout some parts would be preferable to me.
Now i was wondering of it could be possible to think of a way to make this happen.
Option 1 could be the introducing of for example "##" that everything blocks until the second "##". The "##" should be place on a new line without any text after it. This will mean that YAML scripts are not backward compatible anymore.
like:
american:
- Boston Red Sox
- Detroit Tigers
- New York Yankees### de below 4 lines are commented outnational:
- New York Mets
- Chicago Cubs
- Atlanta Braves##
Option 2 could be that a "#" before a key, without a space between, and ended with the : will comment out all Sequence and/or mappings below it below the key. For commenting out a sequenced mapping you add the "#" direct before the "-" like #- key: value.
Like:
NormalKey: Valuepairnational:
- New York Mets
- Chicago Cubs
- Atlanta Braves#avg: 0.278 # Batting average # this comment out only this line.# american: # this will only comment out this line
- Boston Red Sox
- Detroit Tigers
- New York Yankees# The following "#" comment out the whole stack block#Stack:
- file: TopClass.pyline: 23code: | x = MoreObject("345\n")
- file: MoreClass.pyline: 58code: |- foo = barproduct:
- sku : BL394Dquantity : 4description : Basketballprice : 450.00# the below sequenced mapping will be commented out#- sku : BL4438Hquantity : 1description : Super Hoopprice : 2392.00
The text was updated successfully, but these errors were encountered:
Hello,
i could not find an earlier post about this, i'm sure this must have been talked about many times before.
I use YAML to program code for (esphome)[www.esphome.io] for some time now. And YAML is good way to be used in this context.
But sometime I would love to block out data without removing the whole "code" block. i know you could add a # for every line but when you need a lot of line it is not that nice. Having a way to easily blockout some parts would be preferable to me.
Now i was wondering of it could be possible to think of a way to make this happen.
Option 1 could be the introducing of for example "##" that everything blocks until the second "##". The "##" should be place on a new line without any text after it. This will mean that YAML scripts are not backward compatible anymore.
like:
Option 2 could be that a "#" before a key, without a space between, and ended with the : will comment out all Sequence and/or mappings below it below the key. For commenting out a sequenced mapping you add the "#" direct before the "-" like
#- key: value
.Like:
The text was updated successfully, but these errors were encountered: