This commit is contained in:
gilesb 2023-11-22 22:24:34 +00:00
parent 8e9110e9f6
commit fed0fc019a
1 changed files with 187 additions and 253 deletions

440
index.js
View File

@ -29539,16 +29539,11 @@ const getMin = (number) => {
// myGlobalFields, // myGlobalFields,
parameters, parameters,
}) => { }) => {
await external_fs_.promises.appendFile( if (parameters.length) {
fileName,
'#### parameters\n\n',
);
if (!parameters.length) {
await external_fs_.promises.appendFile( await external_fs_.promises.appendFile(
fileName, fileName,
'*[none]*\n', '#### parameters\n\n',
); );
} else {
await table_header({ await table_header({
headings: [ headings: [
['name'], ['name'],
@ -29584,41 +29579,31 @@ const getMin = (number) => {
myDisplayFields, myDisplayFields,
display, display,
}) => { }) => {
await external_fs_.promises.appendFile(
fileName,
'\n## reference objects\n',
);
const referenceObjects = myDisplayFields(display) const referenceObjects = myDisplayFields(display)
.referenceObjects(); .referenceObjects();
await sequence( if (referenceObjects.length) {
referenceObjects
.map(
(referenceObject) => () => external_fs_.promises.appendFile(
fileName,
`\n### ${
referenceObject.name
}\n\n**${
referenceObject.type
}**\n\n[${
referenceObject.linkBaseObject
}](../globals/${
referenceObject.linkBaseObject.split('.')[0]
}/${
referenceObject.linkBaseObject
}.md)\n\n`,
).then(
() => parameters({
fileName,
parameters: referenceObject.parameters,
}),
),
),
);
if (!referenceObjects.length) {
await external_fs_.promises.appendFile( await external_fs_.promises.appendFile(
fileName, fileName,
'\n*[none]*\n', '\n## reference objects\n',
);
await sequence(
referenceObjects
.map(
(referenceObject) => () => external_fs_.promises.appendFile(
fileName,
`\n### ${referenceObject.name
}\n\n**${referenceObject.type
}**\n\n[${referenceObject.linkBaseObject
}](../globals/${referenceObject.linkBaseObject.split('.')[0]
}/${referenceObject.linkBaseObject
}.md)\n\n`,
).then(
() => parameters({
fileName,
parameters: referenceObject.parameters,
}),
),
),
); );
} }
}); });
@ -29632,14 +29617,13 @@ const getMin = (number) => {
myDisplayFields, myDisplayFields,
display, display,
}) => { }) => {
await external_fs_.promises.appendFile(
fileName,
'\n## display-references\n\n',
);
const references = myDisplayFields(display) const references = myDisplayFields(display)
.displayReferences(); .displayReferences();
if (references.length) { if (references.length) {
console.log({ displayRef: fileName }); await external_fs_.promises.appendFile(
fileName,
'\n## display-references\n\n',
);
await sequence( await sequence(
references references
.map( .map(
@ -29649,11 +29633,6 @@ const getMin = (number) => {
), ),
), ),
); );
} else {
await external_fs_.promises.appendFile(
fileName,
'*[none]*\n',
);
} }
}); });
@ -29667,11 +29646,11 @@ const getMin = (number) => {
fileName, fileName,
animations, animations,
}) => { }) => {
await external_fs_.promises.appendFile(
fileName,
'\n#### animations\n\n',
);
if (animations.length) { if (animations.length) {
await external_fs_.promises.appendFile(
fileName,
'\n#### animations\n\n',
);
await table_header({ await table_header({
fileName, fileName,
headings: [ headings: [
@ -29691,11 +29670,6 @@ const getMin = (number) => {
}), }),
), ),
); );
} else {
await external_fs_.promises.appendFile(
fileName,
'*[none]*\n',
);
} }
}); });
@ -29709,11 +29683,11 @@ const getMin = (number) => {
fileName, fileName,
connections, connections,
}) => { }) => {
await external_fs_.promises.appendFile(
fileName,
'\n#### connections\n\n',
);
if (connections.length) { if (connections.length) {
await external_fs_.promises.appendFile(
fileName,
'\n#### connections\n\n',
);
await table_header({ await table_header({
fileName, fileName,
headings: [ headings: [
@ -29733,11 +29707,6 @@ const getMin = (number) => {
}), }),
), ),
); );
} else {
await external_fs_.promises.appendFile(
fileName,
'*[none]*\n',
);
} }
}); });
@ -29806,11 +29775,6 @@ const findDisplay = (line, link) => {
), ),
); );
} }
} else {
await external_fs_.promises.appendFile(
fileName,
'*[none]*\n',
);
} }
}); });
@ -29824,15 +29788,17 @@ const findDisplay = (line, link) => {
command, command,
link, link,
}) => { }) => {
await external_fs_.promises.appendFile( if (command) {
fileName, await external_fs_.promises.appendFile(
'\n#### command\n\n', fileName,
); '\n#### command\n\n',
await lines({ );
fileName, await lines({
command, fileName,
link, command,
}); link,
});
}
}); });
;// CONCATENATED MODULE: ./src/document/lib/animated/touch.js ;// CONCATENATED MODULE: ./src/document/lib/animated/touch.js
@ -29845,15 +29811,17 @@ const findDisplay = (line, link) => {
touch, touch,
link, link,
}) => { }) => {
await external_fs_.promises.appendFile( if (touch) {
fileName, await external_fs_.promises.appendFile(
'\n#### touch\n\n', fileName,
); '\n#### touch\n\n',
await lines({ );
fileName, await lines({
command: touch, fileName,
link, command: touch,
}); link,
});
}
}); });
;// CONCATENATED MODULE: ./src/document/displays/animateds/index.js ;// CONCATENATED MODULE: ./src/document/displays/animateds/index.js
@ -29870,75 +29838,72 @@ const findDisplay = (line, link) => {
display, display,
xml, xml,
}) => { }) => {
await external_fs_.promises.appendFile(
fileName,
'\n## animated\n',
);
const animateds = myDisplayFields(display) const animateds = myDisplayFields(display)
.animated(); .animated();
await sequence(
animateds
.map(
(animated) => () => external_fs_.promises.appendFile(
fileName,
`\n### ${animated.name}\n\n *${animated.type}*\n`,
)
.then(
() => {
const l1 = animated.xml().split(/\r?\n/)[0];
const l = xml.split(/\r?\n/)
.reduce(
(acc, line, index) => {
if (line.indexOf(l1) > -1) {
return index;
}
return acc;
},
-1,
);
return external_fs_.promises.appendFile(
fileName,
`\n[xml](${'../'.repeat(fileName.split('/').length - 1)}${display.file.replaceAll(' ', '%20')}#L${l + 1})\n`,
);
},
)
.then(
() => animations({
fileName,
animations: animated
.animations(),
}),
).then(
() => connections({
fileName,
connections: animated
.connections(),
}),
)
.then(
() => command({
fileName,
command: animated
.command(),
link: './',
}),
)
.then(
() => touch({
fileName,
touch: animated
.touch(),
link: './',
}),
),
),
);
if (!animateds.length) { if (!animateds.length) {
await external_fs_.promises.appendFile( await external_fs_.promises.appendFile(
fileName, fileName,
'*[none]*\n', '\n## animated\n',
); );
await sequence(
animateds
.map(
(animated) => () => external_fs_.promises.appendFile(
fileName,
`\n### ${animated.name}\n\n *${animated.type}*\n`,
)
.then(
() => {
const l1 = animated.xml().split(/\r?\n/)[0];
const l = xml.split(/\r?\n/)
.reduce(
(acc, line, index) => {
if (line.indexOf(l1) > -1) {
return index;
}
return acc;
},
-1,
);
return external_fs_.promises.appendFile(
fileName,
`\n[xml](${'../'.repeat(fileName.split('/').length - 1)}${display.file.replaceAll(' ', '%20')}#L${l + 1})\n`,
);
},
)
.then(
() => animations({
fileName,
animations: animated
.animations(),
}),
).then(
() => connections({
fileName,
connections: animated
.connections(),
}),
)
.then(
() => command({
fileName,
command: animated
.command(),
link: './',
}),
)
.then(
() => touch({
fileName,
touch: animated
.touch(),
link: './',
}),
),
),
);
} }
}); });
@ -29953,13 +29918,13 @@ const findDisplay = (line, link) => {
display, display,
displays, displays,
}) => { }) => {
await external_fs_.promises.appendFile(
fileName,
'\n## reference-object-references\n',
);
const references = myDisplayFields(display) const references = myDisplayFields(display)
.referenceObjectReferences(); .referenceObjectReferences();
if (references.length) { if (references.length) {
await external_fs_.promises.appendFile(
fileName,
'\n## reference-object-references\n',
);
await sequence( await sequence(
references references
.map( .map(
@ -29985,11 +29950,6 @@ const findDisplay = (line, link) => {
), ),
), ),
); );
} else {
await external_fs_.promises.appendFile(
fileName,
'\n*[none]*\n',
);
} }
}); });
@ -30002,14 +29962,13 @@ const findDisplay = (line, link) => {
myDisplayFields, myDisplayFields,
display, display,
}) => { }) => {
await external_fs_.promises.appendFile(
fileName,
'\n## global-references\n\n',
);
const references = myDisplayFields(display) const references = myDisplayFields(display)
.globalReferences(); .globalReferences();
if (references.length) { if (references.length) {
console.log({global: fileName}); await external_fs_.promises.appendFile(
fileName,
'\n## global-references\n\n',
);
await sequence( await sequence(
references references
.map( .map(
@ -30019,11 +29978,6 @@ const findDisplay = (line, link) => {
), ),
), ),
); );
} else {
await external_fs_.promises.appendFile(
fileName,
'*[none]*\n',
);
} }
}); });
@ -30100,16 +30054,11 @@ const findDisplay = (line, link) => {
// myGlobalFields, // myGlobalFields,
object, object,
}) => { }) => {
await external_fs_.promises.appendFile( if (object.parameters.length) {
fileName,
'\n## parameters\n\n',
);
if (!object.parameters.length) {
await external_fs_.promises.appendFile( await external_fs_.promises.appendFile(
fileName, fileName,
'*[none]*\n', '\n## parameters\n\n',
); );
} else {
await table_header({ await table_header({
headings: [ headings: [
['name'], ['name'],
@ -30162,16 +30111,11 @@ const findDisplay = (line, link) => {
); );
const references = object.references(); const references = object.references();
await external_fs_.promises.appendFile( if (references.length) {
fileName,
'\n## references\n\n',
);
if (!references.length) {
await external_fs_.promises.appendFile( await external_fs_.promises.appendFile(
fileName, fileName,
'*[none]*\n\n', '\n## references\n\n',
); );
} else {
await sequence( await sequence(
references references
.map( .map(
@ -30207,16 +30151,11 @@ const findDisplay = (line, link) => {
line: objectLine, line: objectLine,
file, file,
}) => { }) => {
await external_fs_.promises.appendFile( if (object.animated.length) {
fileName,
'\n## animated\n',
);
if (!object.animated.length) {
await external_fs_.promises.appendFile( await external_fs_.promises.appendFile(
fileName, fileName,
'*[none]*\n\n', '\n## animated\n',
); );
} else {
await sequence( await sequence(
object.animated object.animated
.map( .map(
@ -30287,76 +30226,71 @@ const findDisplay = (line, link) => {
/* harmony default export */ const objects = (async ({ /* harmony default export */ const objects = (async ({
fileName, fileName,
dir, dir,
myObjectFields,
myGlobalFields, myGlobalFields,
myDisplayFields, myDisplayFields,
global, global,
displays, displays,
}) => { }) => {
await external_fs_.promises.appendFile(
fileName,
'\n## objects\n\n',
);
const objects = myGlobalFields(global) const objects = myGlobalFields(global)
.objects(); .objects();
await sequence( if (objects.length) {
objects
.map(
(object) => () => external_fs_.promises.appendFile(
fileName,
`* [${object.id}](./${object.id}.md)\n`,
).then(
() => external_fs_.promises.appendFile(
`${dir}/${object.id}.md`,
`# ${object.id}\n\n*object*\n`,
).then(
() => {
const l1 = object.xml().split(/\r?\n/)[0];
const l = global.xml().split(/\r?\n/)
.reduce(
(acc, line, index) => {
if (line.indexOf(l1) > -1) {
return index;
}
return acc;
},
-1,
);
return external_fs_.promises.appendFile(
`${dir}/${object.id}.md`,
`\n[xml](${'../'.repeat(fileName.split('/').length - 1)}${global.file.replaceAll(' ', '%20')}#L${l + 1})\n`,
).then(() => l + 1);
},
)
.then(
(l) => objects_parameters({
fileName: `${dir}/${object.id}.md`,
object,
}).then(
() => references({
fileName: `${dir}/${object.id}.md`,
object,
displays,
myDisplayFields,
}),
)
.then(
() => animated({
file: global.file,
line: l,
fileName: `${dir}/${object.id}.md`,
object,
}),
),
),
),
),
);
if (!objects.length) {
await external_fs_.promises.appendFile( await external_fs_.promises.appendFile(
fileName, fileName,
'*[none]*\n', '\n## objects\n\n',
);
await sequence(
objects
.map(
(object) => () => external_fs_.promises.appendFile(
fileName,
`* [${object.id}](./${object.id}.md)\n`,
).then(
() => external_fs_.promises.appendFile(
`${dir}/${object.id}.md`,
`# ${object.id}\n\n*object*\n`,
).then(
() => {
const l1 = object.xml().split(/\r?\n/)[0];
const l = global.xml().split(/\r?\n/)
.reduce(
(acc, line, index) => {
if (line.indexOf(l1) > -1) {
return index;
}
return acc;
},
-1,
);
return external_fs_.promises.appendFile(
`${dir}/${object.id}.md`,
`\n[xml](${'../'.repeat(fileName.split('/').length - 1)}${global.file.replaceAll(' ', '%20')}#L${l + 1})\n`,
).then(() => l + 1);
},
)
.then(
(l) => objects_parameters({
fileName: `${dir}/${object.id}.md`,
object,
}).then(
() => references({
fileName: `${dir}/${object.id}.md`,
object,
displays,
myDisplayFields,
}),
)
.then(
() => animated({
file: global.file,
line: l,
fileName: `${dir}/${object.id}.md`,
object,
}),
),
),
),
),
); );
} }
}); });