Skip to content

Commit

Permalink
Tweak project template readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
aduros committed Jan 16, 2022
1 parent eef59d9 commit 3883d6b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
34 changes: 25 additions & 9 deletions cli/assets/templates/readme-template.md
Original file line number Diff line number Diff line change
@@ -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!
5 changes: 2 additions & 3 deletions cli/lib/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,14 @@ const ALIASES = {
);

const readmeRender = Mustache.render(readmeTemplate, {
name: path.basename(path.resolve(destDir)),
lang: HELP[lang],
'code-lang': lang,
});

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]) {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3883d6b

Please sign in to comment.