YAML Comments/header (Expression) — skript-yaml

Addon: skript-yaml · Category: Expression · Since: 1.1.0

Syntax

[the] comment[s] (of|from) y[a]ml node[s] %strings% (of|in|from) %string% [(with [an] extra line)]

Description

Gets, sets, deletes comments or the header of a cached yaml file - Headers don't contain '#' so add it yourself if you want it - Comments can only be at root level ie. 'root' not 'root.something' - Both comment and header expressions can be set to multiple elements - This expression does not save to file - Option to have an extra line or not depending if you use comment or header - Any 'extra lines' are removed when deleting comments/headers

Examples

set the comments of yaml node "test" from "config" to "First line" and "Second line"
delete the comments of yaml node "test" from "config"
 
set {_header::*} to "First line" and "Second line"
set the comments at the top of "config" to {_header::*}
delete the comments at the top of "config"
 
set the header of "config" to {_header::*}

View source