docs: add starlight (#1859)
Co-authored-by: uncenter <[email protected]> Co-authored-by: Hammy <[email protected]> Co-authored-by: WalkQuackBack <[email protected]>
This commit is contained in:
46 files changed
+5967
-522
No files matched your search
@@ -7,27 +7,3 @@ export function writeWithPreamble(
|
||||
"# THIS FILE IS AUTOGENERATED. DO NOT EDIT IT BY HAND.\n" + fileContent,
|
||||
);
|
||||
}
|
||||
|
||||
export function updateReadme({
|
||||
readme,
|
||||
section,
|
||||
newContent,
|
||||
}: {
|
||||
readme: string;
|
||||
section: string;
|
||||
newContent: string;
|
||||
}): string {
|
||||
const preamble =
|
||||
"<!-- The following section is auto-generated, do not edit. -->";
|
||||
const startMarker = `<!-- AUTOGEN:${section.toUpperCase()} START -->`;
|
||||
const endMarker = `<!-- AUTOGEN:${section.toUpperCase()} END -->`;
|
||||
const wrapped = `${startMarker}\n${preamble}\n${newContent}\n${endMarker}`;
|
||||
|
||||
if (!(readme.includes(startMarker) && readme.includes(endMarker))) {
|
||||
throw new Error("Markers not found in README.md");
|
||||
}
|
||||
|
||||
const pre = readme.split(startMarker)[0];
|
||||
const end = readme.split(endMarker)[1];
|
||||
return pre + wrapped + end;
|
||||
}
|
||||
Reference in new issue
Block a user