The polyx
tool is the same as poly
with one extra trick: it can output images for some commands.
Caution
|
The features and interface of this tool are subject to change. A future release may expose its functionality in some different way. |
Unlike poly
, we have no AOT-compiled polyx
jar for you to download.
If you want to use polyx
, add it as an alias to your ./deps.edn
file:
:polyx {:main-opts ["-m" "polylith.clj.core.poly-cli.core"]
:extra-deps {polyfy/polylith
{:git/url "https://github.com/polyfy/polylith"
:sha "9e79264981b0c5be6e6cb70c93a540a82c489510" ;; (1)
:deps/root "projects/polyx"}}}}}
-
Choose the revision via a Git SHA
For the sha
of the latest stable release, navigate to https://github.com/polyfy/polylith/releases/latest (versions will differ from images below, but the page layout should be the same):
For the latest SNAPSHOT
release, navigate to https://github.com/polyfy/polylith:
-
click on commits (as above)
-
and copy the full sha (as above)
Start a shell from the example
workspace root dir:
clojure -M:polyx
The polyx
tool can create output images for info, deps, libs, and overview commands.
Let’s create an output image from info
:
example$ info out:info.png
If you need a transparent background, which can be useful if you are going to use the image graphically, e.g. on a website or to print a T-shirt, you can pass in :transparent
:
example$ deps out:deps.png :transparent
Set the color mode to light
if you want a white background:
example$ info color-mode:light out:info.png
Most people typically create .png
images, but you can choose any image format Clojure2d supports.
If you choose any other filename extension, e.g., .txt
, polyx
will output text:
example$ poly info out:info.txt
The output contains ANSI escape codes to colorize the text.
If you cat info.txt
you’ll see colorful output:
ANSI escape codes are not appropriate for some usages.
Specify color-mode:none
for plaintext output:
example$ info out:info.txt color-mode:none
stable since: c91fdad
projects: 2 interfaces: 1
bases: 1 components: 1
project alias status dev
----------------------------- ---
command-line * cl --- ---
development * dev s-- s--
interface brick cl dev
----------------- --- ---
user user * stx st-
- cli * stx st-
The polyx
tool includes an overview command:
example$ overview out:overview.png :no-changes
Generates:
For some real world examples of overview images see Example Systems and Production Systems.