xml-links

This commit is contained in:
gilesb 2023-11-22 20:53:14 +00:00
parent be08436d62
commit 23b97a1322
1 changed files with 147 additions and 80 deletions

133
index.js
View File

@ -29402,6 +29402,7 @@ var lib_default = /*#__PURE__*/__nccwpck_require__.n(lib);
`${dir}/${name}`,
).then(
(buffer) => ({
file: `${dir}/${name}`,
name: external_path_default().basename(name, '.xml').toLowerCase(),
buffer,
}),
@ -29863,6 +29864,7 @@ const findDisplay = (line, link) => {
fileName,
myDisplayFields,
display,
xml,
}) => {
await external_fs_.promises.appendFile(
fileName,
@ -29876,7 +29878,27 @@ const findDisplay = (line, link) => {
(animated) => () => external_fs_.promises.appendFile(
fileName,
`\n### ${animated.name}\n\n *${animated.type}*\n`,
).then(
)
.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)}${display.file}#L${l + 1})\n`,
);
},
)
.then(
() => animations({
fileName,
animations: animated
@ -29888,7 +29910,8 @@ const findDisplay = (line, link) => {
connections: animated
.connections(),
}),
).then(
)
.then(
() => command({
fileName,
command: animated
@ -29903,12 +29926,6 @@ const findDisplay = (line, link) => {
.touch(),
link: './',
}),
)
.then(
() => external_fs_.promises.appendFile(
fileName,
`\n#### xml\n\n\`\`\`xml\n${animated.xml()}\n\`\`\`\n`,
),
),
),
);
@ -30029,6 +30046,10 @@ const findDisplay = (line, link) => {
fileName,
`# ${display.name}\n\n*display*\n`,
);
await external_fs_.promises.appendFile(
fileName,
`\n[xml](${'../'.repeat(root.split('/').length)}${display.file})\n`,
);
await reference_objects({
fileName,
@ -30039,6 +30060,7 @@ const findDisplay = (line, link) => {
fileName,
display,
myDisplayFields,
xml: display.xml(),
});
await display_references({
fileName,
@ -30056,10 +30078,6 @@ const findDisplay = (line, link) => {
display,
myDisplayFields,
});
await external_fs_.promises.appendFile(
fileName,
`\n## xml\n\n\`\`\`xml\n${display.xml()}\n\`\`\`\n`,
);
}),
);
});
@ -30183,6 +30201,8 @@ var ft_view_fields_build = __nccwpck_require__(3204);
// dir,
// myGlobalFields,
object,
line: objectLine,
file,
}) => {
await external_fs_.promises.appendFile(
fileName,
@ -30201,6 +30221,25 @@ var ft_view_fields_build = __nccwpck_require__(3204);
fileName,
`\n### ${animated.id} - ${animated.name} - ${animated.type}\n`,
).then(
() => {
const l1 = animated.xml().split(/\r?\n/)[0];
const l = object.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)}${file}#L${objectLine + l})\n`,
).then(l + 1);
},
)
.then(
() => animations({
fileName,
animations: animated
@ -30228,12 +30267,6 @@ var ft_view_fields_build = __nccwpck_require__(3204);
.touch(),
link: '../../displays/',
}),
)
.then(
() => external_fs_.promises.appendFile(
fileName,
`\n#### xml\n\n\`\`\`xml\n${object.xml()}\n\`\`\`\n`,
),
),
),
);
@ -30273,27 +30306,43 @@ var ft_view_fields_build = __nccwpck_require__(3204);
`${dir}/${object.id}.md`,
`# ${object.id}\n\n*object*\n`,
).then(
() => objects_parameters({
() => {
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(
fileName,
`\n[xml](${'../'.repeat(fileName.split('/').length)}${global.file}#L${l + 1})\n`,
).then(l + 1);
},
)
.then(
(l) => objects_parameters({
fileName: `${dir}/${object.id}.md`,
object,
}),
).then(
}).then(
() => references({
fileName: `${dir}/${object.id}.md`,
object,
displays,
myDisplayFields,
}),
).then(
)
.then(
() => animated({
file: object.file,
line: l,
fileName: `${dir}/${object.id}.md`,
object,
}),
)
.then(
() => external_fs_.promises.appendFile(
`${dir}/${object.id}.md`,
`\n## xml\n\n\`\`\`xml\n${object.xml()}\n\`\`\`\n`,
),
),
),
@ -30334,6 +30383,7 @@ var ft_view_fields_build = __nccwpck_require__(3204);
);
await Promise.all(
globals.map(async (global) => {
console.log(global.file);
await external_fs_.promises.appendFile(
`${root}/globals/README.md`,
`* [${global.name}](./${global.name})\n`,
@ -30371,7 +30421,7 @@ var ft_view_fields_build = __nccwpck_require__(3204);
/* harmony default export */ const src_document = ((root) => async ({
/* harmony default export */ const src_document = (({ root }) => async ({
displays,
globals,
}) => {
@ -30418,14 +30468,27 @@ var ft_view_fields_build = __nccwpck_require__(3204);
const displayFolder = process.env.DISPLAYFOLDER || core.getInput('display-folder');
const displayExcludeFile = process.env.DISPLAYEXCLUDEFILE || core.getInput('display-exclude-file');
const root = process.env.FOLDER || core.getInput('folder');
const globalFolder = process.env.GLOBALFOLDER || core.getInput('global-folder');
const globalExcludeFile = process.env.GLOBALEXCLUDEFILE || core.getInput('global-exclude-file');
console.log({
displayFolder,
displayExcludeFile,
folder: root,
globalFolder,
globalExcludeFile,
});
data({
dir: process.env.DISPLAYFOLDER || core.getInput('display-folder'),
exclude: process.env.DISPLAYEXCLUDEFILE || core.getInput('display-exclude-file'),
dir: displayFolder,
exclude: displayExcludeFile,
})
.then(
(displays) => data({
dir: process.env.GLOBALFOLDER || core.getInput('global-folder'),
exclude: process.env.GLOBALEXCLUDEFILE || core.getInput('global-exclude-file'),
dir: globalFolder,
exclude: globalExcludeFile,
})
.then(
(globals) => ({
@ -30434,7 +30497,11 @@ data({
}),
),
)
.then(src_document(process.env.FOLDER || core.getInput('folder')))
.then(src_document({
root,
displayFolder,
globalFolder,
}))
.then(
() => console.log('done'),
)