From 215911cc410ad0ec522b53294a19648e79217beb Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 1 Aug 2019 09:05:50 +0900 Subject: [PATCH] Added path generation example --- WORKSHOP.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/WORKSHOP.md b/WORKSHOP.md index 9f6b961..41ae39b 100644 --- a/WORKSHOP.md +++ b/WORKSHOP.md @@ -55,19 +55,23 @@ To export the resulting image, type the following text, drag an image file onto (export $path) ``` -For example, a version of that same code with file paths, might look something like the following, notice how the `(rect)` is omitted, if a `(rect)` is not present, the entire canvas size will be exported: +For example, a version of that same code with file paths, might look something like the following: ```lisp (import "~/Desktop/photo.jpg") (export "~/Desktop/export.png") ``` -If you are working on from a saved `.lisp` file, you can also export directly into the working directory with: +You could also **generate the export path from the import path**, like this: ```lisp -(export +(def import-path $path) +(def export-path (concat - (dirpath) "/" "hello.jpg")) + (dirpath import-path) "/" + (filename import-path) "-export.jpg")) +(import import-path) ; "~/Desktop/photo.jpg" +(export export-path) ; "~/Desktop/photo-export.jpg" ``` ## Draw