Move around files so the repo will be organized as a monorepo.
This commit is contained in:
parent
65d1880a84
commit
08c69f0fd3
365 changed files with 1477 additions and 1262 deletions
31
tools/amend-readme/src/md-format-tools.mjs
Normal file
31
tools/amend-readme/src/md-format-tools.mjs
Normal file
|
@ -0,0 +1,31 @@
|
|||
export class MdCol {
|
||||
constructor(sectionName) {
|
||||
this.data = "";
|
||||
this.sectionName = sectionName;
|
||||
this.matchRegex = new RegExp(
|
||||
`^([ \\t]*)<!-- BEGIN ${sectionName} -->\\n[\\s\\S]*?<!-- END ${sectionName} -->\\n`,
|
||||
`m`
|
||||
);
|
||||
}
|
||||
log(...s) {
|
||||
this.data += s.join("") + "\n";
|
||||
}
|
||||
apply(s) {
|
||||
return s.replace(this.matchRegex, (m, $1) => {
|
||||
return (
|
||||
`<!-- BEGIN ${this.sectionName} -->\n` +
|
||||
`<!-- THIS SECTION IS AUTOMATICALLY GENERATED. DO NOT EDIT. -->\n\n` +
|
||||
this.data +
|
||||
`\n<!-- END ${this.sectionName} -->\n`
|
||||
).replace(/^/gm, $1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function ImgX(path, w) {
|
||||
const widthProp = w ? ` width=${w}` : ``;
|
||||
return (
|
||||
`<img src="${path}.light.svg#gh-light-mode-only"${widthProp}/>` +
|
||||
`<img src="${path}.dark.svg#gh-dark-mode-only"${widthProp}/>`
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue