-
Notifications
You must be signed in to change notification settings - Fork 62
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
Availability of block remarks/comment's #330
Comments
Conceptually I like this idea. Clojure (a Lisp) has Your Tags might work out here. Something like YAMLScript (see #339 (comment) for context) could support this fairly easily. The question is where to put them and what they do.
which makes this:
But most likely you want this:
You can get that with
But that's way too difficult. I'll need to think on it more but I can imagine something like this working:
|
This solves the problem by pruning a sub-tree from the output. Please consider the poor people that have to write parsers for syntax highlighting! And, even though I like to comment out an entire tree of nodes, they all still have to be valid YAML, right? Maybe a more backwards-compatible route could be to end the current document, have an "I don't care, just throw the content away" type for an intermittent document and a document type that can continue in the context where the over-last document left off? |
Hi @ingydotnet for thinking about my proposal. |
@nielsnl68 YAMLScript is written in Clojure and evaluated by Clojure's SCI :)
Maybe I still need to think about what @UnePierre said. |
@nielsnl68 (and @UnePierre) I was in an airport when I wrote the last comment and not thinking clearly. I missed/forgot that I had already told you about Clojure and Thinking through this all point by point now (that I have the time to do it)... Assumptions
Primary purposeI see this a way to quickly ignore nodes while getting things to work, Tag to useWhen I suggested That reminds me, YS (YAMLScript) already support function call tags of the form In Clojure you can ignore the next We might want that, like Syntax Highlighting.Currently YS has none. And all the YAML ones are not great (my experience). Invalid YAMLThere's no good way to make YAML or YS (which is always valid YAML) ignore invalid parts, One way you could ignore to the end of file is:
but that requires indenting the bad part, and at that point why not use Pruning vs wrappingI can see this used in 3 ways:
The last 2 are what I think @nielsnl68 wants. The YS compiler could do this by not generating anything for those parts.
which would result in:
note that the tag there is on the For sequences:
makes
Function tagsLet's try out
So you can see this works now in YS, and it's easy to see what it does, but I don't find it particularly useful. |
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: