Improve lang readmes, add readme to file gen

This commit is contained in:
Nilay Majorwar
2022-01-31 16:38:44 +05:30
parent ee64b73d28
commit e0a5f431d8
6 changed files with 56 additions and 27 deletions

View File

@ -39,7 +39,7 @@ const copyFile = (src, dest) => {
};
{
// Copy language provider template files
// Copy language provider template files (except the README)
["index.ts", "common.ts", "runtime.ts", "engine.ts", "renderer.tsx"].forEach(
(filename) => {
const srcPath = path.resolve(__dirname, `new-lang-template/${filename}`);
@ -49,6 +49,15 @@ const copyFile = (src, dest) => {
);
}
{
// Copy the language provider README file
const src = path.resolve(__dirname, "./new-lang-template/README.md");
const dest = path.resolve(dir, "README.md");
const contents = fs.readFileSync(src).toString();
const finalContents = contents.replace("$LANG_NAME", langName);
fs.writeFileSync(dest, finalContents);
}
{
// Generate Next.js page
const src = path.resolve(__dirname, "./new-lang-template/ide-page.tsx");

View File

@ -0,0 +1,5 @@
# $LANG_NAME
## References
## Implementation details