From 5dd66d3e68c3f207edfca6844620c40f112d5f3d Mon Sep 17 00:00:00 2001 From: peterbakker Date: Thu, 6 May 2021 10:52:08 +0200 Subject: [PATCH] updated README.md --- README.md | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b399d70..95b9904 100644 --- a/README.md +++ b/README.md @@ -21,36 +21,56 @@ To upgrade: brew upgrade afosto-cli ``` -## Usage +## Features + +The current list for features for this CLI tool is as follows: + +- upload a local directory to your account +- download a remote directory (from your account) to your machine +- develop HTML templates To start local development of templates, run: +## Upload files + +In order to upload a directory and all it's contents from your machine to your account use the following command: ```bash -afosto render -p 8888 -f afosto.config.yml +afosto upload -s /Users/peter/images -d /images ``` +`-s` (source) points to the path on your computer that you want to recursively upload. `-d` (destination) points to the directory in your account. -Where `-p` is the port number for the local webserver and `-f` points to the afosto.config.yml file in the root of the template repository. - +## Download files +When you want to download files from your account to your computer you run: +```bash +afosto download -s invoices -d /Users/peter/backups/invoices +``` +`-s` (source) points to the directory in your account. `-d` (destination) points to the path on your computer that you want to store the files. -## Filters -Sort +## Develop templates -sort takes in a slice or a map and sort this based on a key. +To start working on templates in your account you need to start the local development server while pointing to your configuration file. -to determine if it will be asc or desc, first parameter can be a `-` which controls the order of the sorting -after that it takes in a dotted path. which represents the nesting it should check +```bash +afosto render -p 8888 -f afosto.config.yml ``` -{{slice|sort}} +Where `-p` is the port number for the local webserver and `-f` points to the afosto.config.yml file in the root of the template repository. + +### Templating language + +Within the templates that are rendered there a some (hidden) powerful features / filters that might be of use. + +#### Sort +Sort takes in a slice or a map and sort this based on a key. Start with `-` in order to sort in ascending order. +``` +{{slice|sort}} {{slice|sort:"filters.key"}} - {{slice|sort:"-filters.key"}} - ```