diff --git a/cli/assets/templates/readme-template.md b/cli/assets/templates/readme-template.md index fd4fa548..ca51a261 100644 --- a/cli/assets/templates/readme-template.md +++ b/cli/assets/templates/readme-template.md @@ -1,18 +1,34 @@ -# wasm4 {{lang.name}} template +# {{name}} -This is a [wasm4](https://wasm4.org/) project bootstrapped with [`wasm4 cli`](https://www.npmjs.com/package/wasm4). +A game written in {{lang.name}} for the [WASM-4](https://wasm4.org) fantasy console. +## Building -## Getting Started +{{#lang.setup}} +First setup the project by running: -- [Quick start guide](https://wasm4.org/docs/getting-started/setup?code-lang={{code-lang}}#quickstart) +```shell +{{{lang.setup}}} +``` +{{/lang.setup}} +Build the cart by running: -## Learn More +```shell +{{{lang.build}}} +``` -- [Documentation](https://wasm4.org/docs) - learn more about [wasm4](https://wasm4.org/) features and API. -- [Snake Tutorial](https://wasm4.org/docs/tutorials/snake/goal) - an interactive tutorial. +Then run it with: -## Contributing +```shell +w4 run {{{lang.cart}}} +``` -You can check out [wasm4 GitHub repository](https://github.com/aduros/wasm4) - your feedback and contributions are welcome! +For more info about setting up WASM-4, see the [quickstart guide](https://wasm4.org/docs/getting-started/setup?code-lang={{code-lang}}#quickstart). + +## Links + +- [Documentation](https://wasm4.org/docs): Learn more about WASM-4. +- [Snake Tutorial](https://wasm4.org/docs/tutorials/snake/goal): Learn how to build a complete game + with a step-by-step tutorial. +- [GitHub](https://github.com/aduros/wasm4): Submit an issue or PR. Contributions are welcome! diff --git a/cli/lib/new.js b/cli/lib/new.js index ee7d76e9..fe1dd620 100644 --- a/cli/lib/new.js +++ b/cli/lib/new.js @@ -86,6 +86,7 @@ const ALIASES = { ); const readmeRender = Mustache.render(readmeTemplate, { + name: path.basename(path.resolve(destDir)), lang: HELP[lang], 'code-lang': lang, }); @@ -93,8 +94,6 @@ const ALIASES = { return fs.writeFile(path.join(destDir, 'README.md'), readmeRender, { encoding: 'utf-8', flag: 'w+' }) } - - async function run (destDir, opts) { let lang = opts.lang; if (ALIASES[lang]) { @@ -143,7 +142,7 @@ async function run (destDir, opts) { console.log(` ${help.setup}`); console.log(); } - console.log("Build it by running:"); + console.log("Build the cart by running:"); console.log(); console.log(` ${help.build}`); console.log();