diff --git a/.tools/readmes/README.md b/.tools/readmes/README.md index 198a07bef89..879577e5728 100644 --- a/.tools/readmes/README.md +++ b/.tools/readmes/README.md @@ -9,21 +9,17 @@ This is an internal tool intended for use only by the AWS code examples team. ## Prerequisites -You must have a recent version of Python installed to run this tool, -and a recent version of pip (Python's package manager) to install the -required packages. - -### Install packages - -We recommend a virtual environment. Create a virtual environment -and install packages by running the following commands in the -`.tools/readmes` folder: +We recommend a virtual environment to run this tool. ``` +cd .tools/readmes python -m venv .venv -.venv\Scripts\activate # Windows -source .venv/bin/activate # *nix -python -m pip install -r requirements.txt + +# Windows +.venv\Scripts\activate + +# Linux or MacOS +source .venv/bin/activate ``` Depending on how you have Python installed and on your operating system, @@ -32,12 +28,15 @@ the commands might vary slightly. For example, on Windows, use `py` in place of ## Generate a README +> These instructions assume you're running the commands from the `.tools/writeme` +> directory, using the venv installed there. + WRITEME creates content primarily from metadata you have already authored for the SOS project. After you have authored metadata and snippet tags for your examples, run the following command in the root folder of the repo: ``` -python .tools/readmes/writeme.py --languages : --services +python -m writeme --languages : --services ``` WRITEME reads metadata and config data and generates READMEs in the service @@ -46,7 +45,7 @@ folder for the specified languages, versions, and services. For example, to generate an S3 README for Python: ``` -python .tools/readmes/writeme.py --languages Python:3 --services s3 +python -m writeme --languages Python:3 --services s3 ``` This creates a README.md file in the `python/example_code/s3` folder. @@ -65,7 +64,7 @@ This creates a README.md file in the `python/example_code/s3` folder. You can get inline usage info by using the `-h` flag: ``` -python .tools/readmes/writeme.py -h +python -m writeme -h ``` ### Configuration @@ -129,7 +128,7 @@ This creates the README.md files in `python/example_code/s3` and other folders. To build all READMEs for Rust: ``` -$ python .tools/readmes/writeme.py --languages Rust:1 +$ python -m writeme --languages Rust:1 INFO:root:Dry run, no changes will be made. DEBUG:root:Rendering Rust:1:acm DEBUG:root:Rendering Rust:1:api-gateway @@ -146,5 +145,5 @@ and complete folder override as the value. See dotnetv3 for an example. And yes, building all readmes for all languages after changing metadata or templates is now as easy as ``` -python .tools/readmes/writeme.py +python -m writeme ```