From 40f2c6be4ad2d12afcd7972d6d67347a5269ffe3 Mon Sep 17 00:00:00 2001 From: Fynn Becker Date: Sun, 2 Dec 2018 09:28:56 +0100 Subject: [PATCH] docs: Improve clarity of command documentation Thanks to @colinsmith for bringing this up in #1. --- README.md | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3148bc0..7e0d44b 100644 --- a/README.md +++ b/README.md @@ -20,14 +20,20 @@ yarn global add @mvsde/mailbox ## New Project ```bash +mailbox create + +# Optional sub-folder mailbox create [folder] +cd folder # Optional name -mailbox create [folder] --name +mailbox create --name ``` The folder defaults to the current directory (`.`) and the name to `mailbox-project`. +If you created your project with the optional `folder` argument, don't forget to change to the new folder with `cd folder` before you continue. + ## Configuration @@ -84,10 +90,13 @@ The attachment is available as `{{ attachments.name }}` within the email templat You can start a development server with auto-reload using the following command: ```bash +mailbox dev + +# Optional alternative layout mailbox dev [layout] # Optional test data -mailbox dev [layout] --test +mailbox dev --test ``` The layout defaults to `default` (the `src/layouts/default.mjml` file). The Nunjucks context isn't populated with test data by default. You can specifiy test data with `--test default`. @@ -98,13 +107,16 @@ The layout defaults to `default` (the `src/layouts/default.mjml` file). The Nunj To send a test email use the following command: ```bash +mailbox test --to + +# Optional alternative layout mailbox test [layout] --to # Optional sender address -mailbox test [layout] --to --from +mailbox test --to --from -# Optional different test data -mailbox test [layout] --to --test +# Optional alternative test data +mailbox test --to --test ``` Both layout and test default to `default` (the `src/layouts/default.mjml` and `test/default.json` files). A recipient email address has to be specified with `--to info@example.com`, the sender email is optional and defaults to `test@example.com`. Test data other than default can be specified with `--test another-test`. @@ -117,10 +129,13 @@ Note: For now, `sendmail` is required for the tests to work. In the future the N To generate production ready files use this command: ```bash +mailbox build + +# Optional alternative layout mailbox build [layout] -# Optional different output location -mailbox build [layout] --output +# Optional alternative output location +mailbox build --output ``` The layout defaults to `default` (the `src/layouts/default.mjml` file). The output path can be changed with `--output path/to/output.html`. The full filepath has to be specified.