{"id":16521917,"url":"https://github.com/ajstarks/decksh","last_synced_at":"2025-06-14T00:04:41.460Z","repository":{"id":47789426,"uuid":"256552766","full_name":"ajstarks/decksh","owner":"ajstarks","description":"decksh implements a domain-specific scripting language for presentations, visualizations, and information displays","archived":false,"fork":false,"pushed_at":"2025-05-17T01:56:54.000Z","size":332649,"stargazers_count":74,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-17T02:44:19.165Z","etag":null,"topics":["dsl","golang","presentation","scripting","vector-graphics","visualization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajstarks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-17T16:19:45.000Z","updated_at":"2025-05-17T01:56:58.000Z","dependencies_parsed_at":"2025-05-08T20:09:29.276Z","dependency_job_id":null,"html_url":"https://github.com/ajstarks/decksh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ajstarks/decksh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajstarks%2Fdecksh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajstarks%2Fdecksh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajstarks%2Fdecksh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajstarks%2Fdecksh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajstarks","download_url":"https://codeload.github.com/ajstarks/decksh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajstarks%2Fdecksh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259737917,"owners_count":22903872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dsl","golang","presentation","scripting","vector-graphics","visualization"],"created_at":"2024-10-11T16:58:34.765Z","updated_at":"2025-06-14T00:04:41.433Z","avatar_url":"https://github.com/ajstarks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# decksh: a little language for presentations, visualizations, and information displays\n\n\n`decksh` is a domain-specific language (DSL) for generating [`deck`](https://github.com/ajstarks/deck) markup.\n\n![object reference](images/placemat.png)\n\n`decksh` elements\n\n\n## Install\n\n```\ngo get github.com/ajstarks/decksh                        # install the package\ngo install github.com/ajstarks/decksh/cmd/decksh@latest  # install the decksh command\n```\n\n## References and Examples\n\n- [`decksh` overview](https://speakerdeck.com/ajstarks/decksh-a-little-language-for-decks)\n- [`decksh` object reference](https://speakerdeck.com/ajstarks/decksh-object-reference)\n- [Installing and Running decksh/pdfdeck](https://speakerdeck.com/ajstarks/pdfdeck)\n- [Repository of decksh projects and visualizations](https://github.com/ajstarks/deckviz \"Repository of decksh projects and visualizations\")\n\n## Package use\n\nThe `Process` function reads decksh commands from an `io.Reader` and writes deck markup to an `io.Writer`, returning an error.\n\nFor example:\n```\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n    \"strings\"\n\n    \"github.com/ajstarks/decksh\"\n)\n\nfunc main() {\n    input := `\n    deck\n        slide\n            ctext \"hello, world\" 50 50 10\n        eslide\n    edeck\n    `\n    err := decksh.Process(os.Stdout, strings.NewReader(input))\n    if err != nil {\n        fmt.Fprintf(os.Stderr, \"%v\\n\", err)\n    }\n}\n```\n\nProduces:\n\n```\n\u003cdeck\u003e\n\u003cslide\u003e\n\u003ctext align=\"c\" xp=\"50\" yp=\"50\" sp=\"10\" \u003ehello, world\u003c/text\u003e\n\u003c/slide\u003e\n\u003c/deck\u003e\n````\n\n## Running the command line client\n\nThis repository also contains `cmd/decksh`, a client decksh command:\n\n`decksh` reads from the specified input, and writes deck markup to the specified output destination:\n\n```\n$ decksh                   # input from stdin, output to stdout\n$ decksh -o foo.xml        # input from stdin, output to foo.xml\n$ decksh foo.sh            # input from foo.sh output to stdout\n$ decksh -o foo.xml foo.sh # input from foo.sh output to foo.xml\n$ decksh -version          # show decksh version\n$ decksh -dump ...         # show decksh variables\n```\n\nTypically, `decksh` acts as the head of a rendering pipeline, where another `deck` client renders the markup. This example uses `pdfdeck`\n\n```\n$ decksh text.dsh | pdfdeck -stdout -pagesize 1200,900 - \u003e text.pdf \n```\n\n## Example input\n\ndecksh hello, world:\n\n```\n// hello world\ndeck\n    slide \"black\" \"white\"\n        ctext \"hello world\" 50 25 15\n        circle 0 0 120 \"blue\"\n    eslide\nedeck\n```\n\nproduces:\n\n![hello-world](images/hw-00004.png)\n\nThis deck script:\n\n```\n// Example deck\nmidx=50\nmidy=50\niw=640\nih=480\n\nimfile=\"follow.jpg\"\nimlink=\"https://budnitzbicycles.com\"\nimscale=58\ndtop=87\n\nopts=\"-fulldeck=f -textsize 1  -xlabel=2  -barwidth 1.5\"\ndeck\n    slide \"white\" \"black\"\n        ctext \"Deck elements\" midx dtop 5\n        cimage \"follow.jpg\" \"Dreams\" 72 midy iw ih imscale imlink\n        textblock \"Budnitz #1, Plainfield, NJ, May 10, 2015\" 55 35 10 1 \"serif\" \"white\"\n\n        // List\n        blist 10 75 3\n            li \"text, image, list\"\n            li \"rect, ellipse, polygon\"\n            li \"line, arc, curve\"\n        elist\n\n        // Graphics\n        gy=10\n        c1=\"red\"\n        c2=\"blue\"\n        c3=\"green\"\n        rect    15 gy 8 6              c1\n        ellipse 27.5 gy 8 6            c2\n        polygon \"37 37 45\" \"7 13 10\"   c3\n        line    50 gy 60 gy 0.25       c1\n        arc     70 gy 10 8 0 180 0.25  c2\n        curve   80 gy 95 25 90 gy 0.25 c3\n\n\n        // Chart\n        chleft=10\n        chright=45\n        chtop=42\n        chtbottom=28\n        dchart -left chleft -right chright -top chtop -bottom chbottom opts AAPL.d \n    eslide\nedeck\n```\n\nProduces:\n\n![exampledeck](images/exampledeck.png)\n\nText, font, color, caption and link arguments follow Go conventions (surrounded by double quotes).\n\n## Coordinate System\n\n`decksh` (like the deck markup it produces) uses a traditional Cartesian\ncoordinate system:  The origin (0,0) is at the lower left, x increases to the\nright, and y increases upwards. The coordinate system is  expliticly based on\nthe percentages, with x and y ranging from 0-100. For example (50, 50) is the\nmiddle of the canvas, (100,100) is the upper right, (100,0) is the lower\nright, and (0,100) is the upper left.\n\n![percent-canvas](images/pct-canvas.png)\n\n## Colors\n\nColors formats are:\n\n- [RGB](https://en.wikipedia.org/wiki/RGB_color_model \"RGB\"): \"rgb(n,n,n)\", where n ranges from 0-255, for example \"`\"rgb(128,0,128)\"` .\n- hex: \"#rrggbb\", for example `\"#aa00aa\"`,\n- [HSV](https://en.wikipedia.org/wiki/HSL_and_HSV \"HSV\"): hsv(hue,saturation,value), hue ranges from 0-360, saturation and value range from 0-100, for example `\"hsv(360,30,30)\"` (pdfdeck and pngdeck support this syntax)\n- [SVG color names](https://www.w3.org/TR/SVG11/types.html#ColorKeywords \"SVG color names\").\n\nColor gradients (used for slide backgrounds and rectangle and square fills) are specified as color1/color2/percent, for example, `\"blue/white/90\"`\n\n## Coordinates, dimensions, scales, opacity and fonts\n\nCoordinates, dimensions, scales and opacities are floating point numbers\nranging from from 0-100 (representing percentages of the canvas width and\npercent opacity). Some arguments are optional, and if omitted defaults are\napplied (black for text, gray for graphics, 100% opacity).\n\nCanvas size and image dimensions are in pixels.\n\nFonts may be:\n\n- \"sans\"\n- \"serif\"\n- \"mono\"\n- symbol\"\n\n![cfo](images/cfo-table.png)\n\n## Begin or end a deck.\n\n```\ndeck\nedeck\n```\n\n## Begin, end a slide with optional background and text colors.\n\n```\nslide [bgcolor] [fgcolor]\neslide\n```\n\nNote that doc/edoc and page/epage are may also be used as synomyms for deck/edeck and slide/eslide.\n\n## Specify the size of the canvas.\n\n```\ncanvas w h\n```\n\n## Simple assignments\n\n`id=\u003cnumber\u003e` defines a constant, which may be then subtitited. For example:\n\n```\nx=10\ny=20\ntext \"hello, world\" x y 5\n```\n\nThe special identifier, `deckshVersion` contains the string denoting the version of decksh.\n\n## Assignment operations\n\n`id+=\u003cnumber\u003e` increment the value of `id` by `\u003cnumber\u003e`\n\n```\nx+=5\n```\n\n`id-=\u003cnumber\u003e` decrement the value of `id` by `\u003cnumber\u003e`\n\n```\nx-=10\n```\n\n`id*=\u003cnumber\u003e` multiply the value of `id` by `\u003cnumber\u003e`\n\n```\nx*=50\n```\n\n`id*=\u003cnumber\u003e` divide the value of `id` by `\u003cnumber\u003e`\n\n```\nx/=100\n```\n\n## Binary operations\n\nAddition `id=\u003cid\u003e + number or \u003cid\u003e`\n\n```\ntx=10\nspacing=1.2\n\nsx=tx-10\nvx=tx+spacing\n```\n\nSubtraction `id=\u003cid\u003e - number or \u003cid\u003e`\n\n```\na=x-10\n```\n\nMuliplication `id=\u003cid\u003e * number or \u003cid\u003e`\n\n```\na=x*10\n```\n\nDivision `id=\u003cid\u003e / number or \u003cid\u003e`\n\n```\na=x/10\n```\n\nModulo `id=\u003cid\u003e % number or \u003cid\u003e`\n\na=x%10\n\n## Coordinate assignments\n\nAssign (x,y) coordinates to the specified identifier.  The x coordinate is\n`id_x` and the y coordinate is `id_y`.  The expression with the parentheses\nmay be a constant, variable or binary expression.\n\nThis code:\n\n```\n    a=40\n    b=40\n    c=20\n\n    p0=(50,50)\n    p1=(a,b)\n    p2=(a+c,b)\n    p3=(a+c,b+c)\n    p4=(a,b+c)\n\n    circle p0_x p0_x 3\n    line p1_x p1_y p2_x p2_y 0.2 \"blue\"\n    line p2_x p2_y p3_x p3_y 0.2 \"red\"\n    line p3_x p3_y p4_x p4_y 0.2 \"green\"\n    line p4_x p4_y p1_x p1_y 0.2 \"orange\"\n```\n\nmakes this:\n\n![coordinates](images/pcoords.png)\n\n## Polar Coordinates\n\n```\nx=polarx cx cy r theta\ny=polary cx cy r theta\n```\n\nReturn the polar coordinate given the center at `(cx, cy)`, radius `r`, and angle `theta` (in degrees)\n\n![polar](images/polar.png)\n\n## Polar Coordinates (composite)\n\n```\np=polar cx cy r theta\n```\n\nReturn the polar coordinates `(p_x)` and `(p_y)` given the center at `(cx, cy)`, radius `r`, and angle `theta` (in degrees)\n\n## Dump\n\nThe keyword `dump` causes a sorted list of variables and their values to \nbe printed on standard error.\n\nFor example, given:\n\n```\ndeck\n    slide\n        x=50\n        y=50\n        s=5\n        message=\"Hello, decksh\"\n        ctext message  x y s\n    eslide\n    dump\nedeck\n```\nProduces:\n```\ndeckshVersion   = \"2024-12-15-1.0.0\"\nmessage         = \"Hello, decksh\"\ns               = 5\nx               = 50\ny               = 50\n```\n\nYou can also specify that specific variables are shown, `dump x y` shows:\n\n```\nx               = 50\ny               = 50\n```\n\n\n## Area\n\n```\na=area d\nc=area a+b\n```\n\nreturn the circular area, `a` for the diameter `d`.\n\n## Formatted Text\n\nAssign a string variable with formatted text (using package fmt floating point format strings). Up to five variables may be used.\n\n```\nw1=10\nw2=20+100\n\ns0=format \"Widget 1: %.2f\" w1\ns1=format \"Widget 2: %.3f\" w2\nst=format \"Total Widgets: %v\" s1+w2\n```\n\nLarge numbers may also be formatted with commas using the `%,` format string. For example:\n\n```\ns=format \"%,\" 123456789  // s contains 123,456,789\n```\n\n## Random Number\n\n```\nx=random min max\n```\n\n![random](images/random.png)\n\nassign a random number in the specified range\n\n## Math Functions\n\ndecksh supports these math functions:\n\n- cosine\n- sine\n- square root\n- tangent\n\n### Cosine\n\nreturn the coine of the number of expression (`id` or binary operation)\n\n```\na=4\nb=10\nx=cosine 4\nx=cosine a+b\nx=cosine b\n```\n\n### Sine\n\nreturn the sine of the number of expression (`id` or binary operation)\n\n```\na=4\nb=10\nx=sine 4\nx=sine a+b\nx=sine b\n```\n\n### Square Root\n\nreturn the square root of the number of expression (`id` or binary operation)\n\n```\na=4\nb=10\nx=sqrt 4\nx=sqrt a+b\nx=sqrt b\n```\n\n### Tangent\n\nreturn the square root of the number of expression (`id` or binary operation)\n\n```\na=4\nb=10\nx=tangent 4\nx=tangent a+b\nx=tangent b\n```\n\n## Range Value Mapping\n\n```\nx=vmap v vmin vmax min max\n```\n\n![vmap](images/vmap.png)\n\nFor value `v`, map the range `vmin-vmax` to `min-max`.\n\n## Substring\n\n```\nx=substr string begin end\n```\n\nassigns a substring given beginning and ending indicies.  \n`-` may be used as a shorthand for the beginning and end.\n\n```\ns=\"hello, world\"\na=substr s - -                  // a=\"hello, world\"\nb=substr s - 4                  // b=\"hello\"\nc=substr s 7 -                  // c=\"world\"\nd=substr s 3 8                  // d=\"lo, wo\"\ne=substr \"This is a test\"  5 8  // e=\"is a\"\n```\n\n## Loops\n\nLoop over `statements`, with `x` starting at `begin`, ending at `end` with an\noptional `increment` (if omitted the increment is 1). Substitution of `x`\nwill occur in statements.\n\n```\nfor x=begin end [increment]\n    statements\nefor\n```\n\nLoop over `statements`, with `x` ranging over the contents of items within `\n[]`.  Substitution of `x` will occur in statements.\n\n```\nfor x=[\"abc\" \"def\" \"ghi\"]\n    statements\nefor\n```\n\nLoop over `statements`, with `x` ranging over the contents `\"file\"`.\nSubstitution of `x` will occur in statements.\n\n```\nfor x=\"file\"\n    statements\nefor\n```\n\n## Conditionals\n\nSpecify the conditional execution of decksh statements with `if condition`,\n`else` and `eif`. The else block is optional. The values for ```v1``` and\n```v2``` may be either numbers of strings. (For strings only ```==``` and\n```!=``` apply). The conditions are:\n\n```\nif v1 condition v2\n\nwhere condition is:\n== or eq   equals                 if x == y\n!= or ne   not equals             if x != y\n\u003c  or lt   less than              if x \u003e y\n\u003e  or gt   greater than           if x \u003c y\n\u003e= or ge   greater than or equal  if x \u003e= y\n\u003c= or ge   less than or equal     if x \u003c= y\n\u003e\u003c or bt   between                if x \u003e\u003c y z\n```\n\nFor example:\n\n```\nx=10\ny=20\nif x \u003e y\n    text \"x is greater than y\" x y 5\nelse\n    text \"x is not greater than y\" x y 5\neif \n```\n\nThe else block may be omitted:\n\n```\nif x \u003c 10\n    text \"x is less than 10\" x y 5\neif \n```\n\nFor strings:\n\n```\nc1=\"red\"\nc2=\"blue\"\nif c1 != c2\n    text \"red is not blue\" 50 50 2\neif\n```\n\n\n\n## Include decksh markup from a file\n\n```\ninclude \"file\"\n```\n\nplaces the contents of `\"file\"` inline.\n\n## Functions\n\nFunctions have a defined `name` and arguments, and are specifed with\nstatements between the `def` and `edef` keywords\n\n```\ndef name arg1 arg2 ... argn\n    statements\nedef\n```\n\n## Importing function defintions\n\nFunctions may be imported once, and then called by name.\n\nFor example, given a file `redcircle.dsh`:\n\n```\ndef redcircle X Y\n    circle X Y 10 \"red\"\nedef\n```\n\nwhich is referenced:\n\n```\nimport \"redcircle.dsh\" \nx=50\ny=50\nx2=x-20\ny2=y+20\nredcircle x y\nredcircle x2 y2\n```\n\nmakes:\n\n![import](images/import.png)\n\nFunctions may also be called with the `func` keyword:\n\n```\nfunc \"file\" arg1 ... argn\n```\n\nFor example, given a file \"ftest.dsh\"\n\n```\ndef ftest funx funy funs funt\n    funs*=2\n    ctext funt funx funy funs\nedef\n```\n\ncalling the function:\n\n```\nfunc \"ftest.dsh\" 50 30 2.5 \"hello\"\n```\n\nproduces:\n\n```\nfunx=50\nfuny=30\nfuns=5.0\nfunt=\"hello\"\nctext \"hello\" 50 30 5.0\n```\n\n## Data: Make a file\n\n```\ndata \"foo.d\"\nuno    100\ndos    200\ntres   300\nedata\n```\n\nmakes a file named `foo.d` with the lines between `data` and `edata`.\n\n## Grid: Place objects on a grid\n\n```\ngrid \"file.dsh\" x y xskip yskip limit\n```\n\n![grid](images/grid.png)\n\nThe first file argument (`\"file.dsh\"` above) specifies a file with decksh\ncommands; each item in the file must include the arguments \"x\" and \"y\".\nNormal variable substitution occurs for other arguments. For example if the\ncontents of `file.dsh` has six items:\n\n```\ncircle x y 5\ncircle x y 10\ncircle x y 15\nsquare x y 5\nsquare x y 10\nsquare x y 15\n```\n\nThe line:\n\n```\ngrid \"file.dsh\" 10 80 20 30 50\n```\n\ncreates two rows: three circles and then three squares\n\n`x, y` specify the beginning location of the items, `xskip` is the horizontal\nspacing between items.  `yinternal` is the vertical spacing between items and\n`limit` the the horizontal limit. When the `limit` is reached,  a new row is\ncreated.\n\n\n## Text\n\nLeft, centered, end, or block-aligned text or file contents (`x` and `y` are the text's reference point), with optional font (\"sans\", \"serif\", \"mono\", or \"symbol\"), color and opacity.\n\n### left-aligned text\n\n```\ntext       \"text\"     x y size       [font] [color] [opacity] [link]\nbtext      \"text\"     x y size       [font] [color] [opacity] [link]\n```\n\n![text](images/text.png)\n\n### centered text\n\n```\nctext      \"text\"     x y size       [font] [color] [opacity] [link]\n```\n\n![ctext](images/ctext.png)\n\n### right-aligned text\n\n```\netext      \"text\"     x y size       [font] [color] [opacity] [link]\n```\n\n![etext](images/etext.png)\n\n### a text block (from either a string or the contents of a file)\n\n```\ntextblock     \"text\"     x y width size [font] [color] [opacity] [link]\ntextblockfile \"filename\" x y width size [font] [color] [opacity] [link]\n```\n\n![textblock](images/textblock.png)\n\nText rotated along the specified angle (in degrees)\n\n```\nrtext      \"text\"     x y angle size [font] [color] [opacity] [link]\n```\n\n### rotated text\n\n![rtext](images/rtext.png)\n\n### text on an arc\n\nText on an arc centered at `(x,y)`, with specified radius, between begin and\nending angles (in degrees).  if the beginning angle is less than the ending\nangle the text is rendered counter-clockwise.  if the beginning angle is\ngreater than the ending angle, the text is rendered clockwise.\n\n```\narctext    \"text\"     x y radius begin-angle end-angle size [font] [color] [opacity] [link]\n```\n\n![arctext](images/arctext.png)\n\n### text from file contents (plain and code formatted)\n\nPlace the contents of \"filename\" at (x,y). Place the contents of \"filename\" in\ngray box, using a monospaced font.\n\n```\ntextfile   \"filename\" x y       size [font] [color] [opacity] [linespacing]\n```\n\n![textfile](images/textfile.png)\n\n```\ntextcode   \"filename\" x y width size [color]\n```\n\n![textcocde](images/textcode.png)\n\n## Images\n\nPlain and captioned, with optional scales, links and caption size. `(x, y)` is\nthe center of the image,  and `width` and `height` are the image dimensions\nin pixels.\n\n```\nimage  \"file\"           x y width height [scale] [link]\ncimage \"file\" \"caption\" x y width height [scale] [link] [size]\n```\n\n![image](images/image.png)\n\n## Lists\n\n(plain, bulleted, numbered, centered). Optional arguments specify the color,\nopacity, line spacing, link and rotation (degrees)\n\n```\nlist   x y size [font] [color] [opacity] [linespacing] [link] [rotation]\n```\n\n![list](images/list.png)\n\n```\nblist  x y size [font] [color] [opacity] [linespacing] [link] [rotation]\n```\n\n![blist](images/blist.png)\n\n```\nnlist  x y size [font] [color] [opacity] [linespacing] [link] [rotation]\n```\n\n![nlist](images/nlist.png)\n\n```\nclist  x y size [font] [color] [opacity] [linespacing] [link] [rotation]\n```\n\n![clist](images/clist.png)\n\n### list items, and ending the list\n\n```\nli \"text\"\nelist\n```\n\n## Graphics\n\nRectangles, ellipses, squares, circles: specify the center location `(x, y)`\nand  dimensions `(w,h)` with optional color and opacity.  The default color\nand opacity is gray, 100%. In the case of the `acircle` keyword, the `a`\nargument  is the area, not the diameter.\n\n```\nrect    x y w h [color] [opacity]\nellipse x y w h [color] [opacity]\n```\n\n![rect](images/rect.png)\n\n  \n\n![ellipse](images/ellipse.png)\n\n```\nsquare  x y w   [color] [opacity]\ncircle  x y w   [color] [opacity]\n```\n\n![square](images/square.png)\n\n  \n\n![circle](images/circle.png)\n\n```\nacircle x y a   [color] [opacity]\n```\n\n![acircle](images/area.png)\n\nRounded rectangles are similar, with the added radius for the corners:\n(solid colors only)\n\n```\nrrect   x y w h r [color]\n```\n\n![rrect](images/rrect.png)\n\nFor polygons, specify the x and y coordinates as a series of numbers, with\noptional color and opacity.\n\n```\npolygon \"xcoords\" \"ycoords\" [color] [opacity]\n```\n\n![polygon](images/polygon.png)\n\nNote that the coordinates may be either discrete:\n\n```\npolygon \"10 20 30\" \"50 60 50\"\n```\n\nor use substitution:\n\n```\nx1=10\nx2=20\nx3=30\ny1=50\ny2=y1+10\ny3=y1\npolygon \"x1 x2 x3\" \"y1 y2 y3\"\n```\n\nA combination of constants and substitution is also allowed.\n\n```\npolygon \"20 x2 30\" \"50 y2 50\"\n```\n\nPolyline is similar to polygon, except line segments are used instead of a filled polygon, and you may specify a line width.\n\n```\npolyline \"xcoords\" \"ycoords\" [lw] [color] [opacity]\n```\n\n![polyline](images/polyline.png)\n\nFor lines, specify the coordinates for the beginning `(x1,y1)` and end points\n`(x2, y2)`.  For horizontal and vertical lines specify the initial point and\nthe length.  Line thickness, color and opacity are optional, with defaults\n(0.2, gray, 100%).\n\nA \"pill\" shape has is a horizontal line with rounded ends.\n\n```\nline    x1 y1 x2 y2 [size] [color] [opacity]\n```\n\n![line](images/line.png)\n\n```\nhline   x y length  [size] [color] [opacity]\n```\n\n![hline](images/hline.png)\n\n```\nvline   x y length  [size] [color] [opacity]\n```\n\n![vline](images/vline.png)\n\n```\npill    x w length  size   [color]\n```\n\n![pill](images/pill.png)\n\nCurve is a quadratic Bezier curve: specify the beginning location `(bx, by)`,\nthe control point `(cx, cy)`, and ending location `(ex, ey)`.\n\nFor arcs, specify the location of the center point `(x,y)`, the width and\nheight, and the beginning and ending angles (in degrees). Line thickness,\ncolor and opacity are optional, with defaults (0.2, gray, 100%).\n\n```\ncurve   bx by cx cy ex ey [size] [color] [opacity]\n```\n\n![curve](images/curve.png)\n\n```\narc     x y w h a1 a2     [size] [color] [opacity]\n```\n\n![arc](images/arc.png)\n\nTo make n-sided stars, use the \"star\" keyword: `(x,y)` is the center of the\nstar,  `np` is the number of points, and `inner` and `outer` are the sizes of\nthe inner and outer points, respectively.\n\n```\nstar    x y np inner outer [color] [opacity]\n```\n\n![star](images/star.png)\n\n## Arrows\n\nArrows with optional linewidth, width, height, color, and opacity.  Default\nlinewidth is 0.2, default arrow width and height is 3, default color and\nopacity is gray, 100%.  The curve variants use the same syntax for specifying\ncurves.\n\n```\narrow   x1 y1 x2 y2       [linewidth] [arrowidth] [arrowheight] [color] [opacity]\n```\n\n![arrow](images/arrow.png)\n\n```\nlcarrow bx by cx cy ex ey [linewidth] [arrowidth] [arrowheight] [color] [opacity]\n```\n\n![lcarrow](images/lcarrow.png)\n\n```\nrcarrow bx by cx cy ex ey [linewidth] [arrowidth] [arrowheight] [color] [opacity]\n```\n\n![rcarrow](images/rcarrow.png)\n\n```\nucarrow bx by cx cy ex ey [linewidth] [arrowidth] [arrowheight] [color] [opacity]\n```\n\n![ucarrow](images/ucarrow.png)\n\n```\ndcarrow bx by cx cy ex ey [linewidth] [arrowidth] [arrowheight] [color] [opacity]\n```\n\n![dcarrow](images/dcarrow.png)\n\n## Braces\n\nLeft, right, up and down-facing braces. (x, y) is the location of the point of\nthe brace, (aw, ah) are width and height of the braces's  end curves;\n`linewidth`, `color` and `opacity` are optional (defaults are 0.2, gray,\n100%)\n\n```\nlbrace x y height aw ah [linewidth] [color] [opacity]\n```\n\n![rbrace](images/rbrace.png)\n\n```\nrbrace x y height aw ah [linewidth] [color] [opacity]\n```\n\n![lbrace](images/rbrace.png)\n\n```\nubrace x y width  aw ah [linewidth] [color] [opacity]\n```\n\n![ubrace](images/ubrace.png)\n\n```\ndbrace x y width  aw ah [linewidth] [color] [opacity]\n```\n\n![dbrace](images/dbrace.png)\n\n## Brackets\n\nLeft, right, up and down-facing brackets. \n\n(x, y) is the location of the center of the bracket.  For left and\nright-facing brackets, `width` is the size of the top and bottom portions,\nand `height` is the span of the bracket.  For upward and downward-facing\nbrackets, `width` is the span of of bracket, and `height` is the size of the\nleft and right portions. `linewidth`, `color` and `opacity` are optional\n(defaults are 0.2, gray, 100%)\n\n```\nlbracket x y width height [linewidth] [color] [opacity]\n```\n\n![lbracket](images/lbracket.png)\n\n```\nrbracket x y width height [linewidth] [color] [opacity]\n```\n\n![rbracket](images/rbracket.png)\n\n```\nubracket x y width height [linewidth] [color] [opacity]\n```\n\n![dbracket](images/dbracket.png)\n\n```\ndbracket x y width height [linewidth] [color] [opacity]\n```\n\n![ubracket](images/ubracket.png)\n\n## Charts\n\nRun the [dchart](https://github.com/ajstarks/dchart/blob/master/README.md \"dchart\") command with the specified arguments.\n\n```\ndchart [args]\n```\n\n![dchart](images/dchart.png)\n\n## Legend\n\nShow a colored legend\n\n```\nlegend \"text\" x y size [font] [color]\n```\n\n![legend](images/legend.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajstarks%2Fdecksh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajstarks%2Fdecksh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajstarks%2Fdecksh/lists"}