Can i make one of node is output as source input , ignore doc.toString options? #544
Unanswered
bluelovers
asked this question in
Q&A
Replies: 3 comments
|
I'm sorry, I don't understand the question here. Could you rephrase, possibly with example code? |
0 replies
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) |
0 replies
|
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 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Can i make one of node is output as source input , ignore doc.toString options?
All reactions