Can i make one of node is output as source input , ignore doc.toString options? #544
Replies: 3 comments
-
I'm sorry, I don't understand the question here. Could you rephrase, possibly with example code? |
Beta Was this translation helpful? Give feedback.
-
import { parseDocument } from 'yaml';
let input = `
xxx:
a:
- >-
(silhouette:1.2), jianying,
1girl, nude,
(in river), splash,
({sun rays, sunset|moonlight|dawn|twilight} background, low horizon),
backlighting,
contour light, body contour light, light particles,
__lazy-wildcards/prompts/hair__,
__lazy-wildcards/dataset/background-color__,
(flower, falling petals, petals on liquid, petals, cherry blossom:0.8)
- >-
(silhouette:1.2), jianying,
1girl, nude,
(in river), splash,
({sun rays, sunset|moonlight|dawn|twilight} background, low horizon),
backlighting,
contour light, body contour light, light particles,
__lazy-wildcards/prompts/hair__,
__lazy-wildcards/dataset/background-color__,
(flower, falling petals, petals on liquid, petals, cherry blossom:0.8)
`;
let doc = parseDocument(input);
let out = doc.toString({
blockQuote: true,
defaultKeyType: 'PLAIN',
defaultStringType: 'PLAIN',
collectionStyle: 'block',
});
console.log(out) will be xxx:
a:
- >-
(silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays,
sunset|moonlight|dawn|twilight} background, low horizon), backlighting,
contour light, body contour light, light particles,
__lazy-wildcards/prompts/hair__,
__lazy-wildcards/dataset/background-color__, (flower, falling petals,
petals on liquid, petals, cherry blossom:0.8)
- >-
(silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays,
sunset|moonlight|dawn|twilight} background, low horizon), backlighting,
contour light, body contour light, light particles,
__lazy-wildcards/prompts/hair__,
__lazy-wildcards/dataset/background-color__, (flower, falling petals,
petals on liquid, petals, cherry blossom:0.8) but i want do something make it can be make the first one node is same as source but others is still follow options xxx:
a:
- >-
(silhouette:1.2), jianying,
1girl, nude,
(in river), splash,
({sun rays, sunset|moonlight|dawn|twilight} background, low horizon),
backlighting,
contour light, body contour light, light particles,
__lazy-wildcards/prompts/hair__,
__lazy-wildcards/dataset/background-color__,
(flower, falling petals, petals on liquid, petals, cherry blossom:0.8)
- >-
(silhouette:1.2), jianying, 1girl, nude, (in river), splash, ({sun rays,
sunset|moonlight|dawn|twilight} background, low horizon), backlighting,
contour light, body contour light, light particles,
__lazy-wildcards/prompts/hair__,
__lazy-wildcards/dataset/background-color__, (flower, falling petals,
petals on liquid, petals, cherry blossom:0.8) |
Beta Was this translation helpful? Give feedback.
-
Ah, you want to keep the exact source representation of a node. No, that's not possible with the document-level API. The lower-level |
Beta Was this translation helpful? Give feedback.
-
Can i make one of node is output as source input , ignore doc.toString options?
Beta Was this translation helpful? Give feedback.
All reactions