{"id":26531997,"url":"https://github.com/paintparty/fireworks","last_synced_at":"2025-04-06T17:11:52.760Z","repository":{"id":225291382,"uuid":"765571114","full_name":"paintparty/fireworks","owner":"paintparty","description":"Fireworks is a themeable tapping library for Clojure, ClojureScript, and Babashka.","archived":false,"fork":false,"pushed_at":"2025-03-13T15:45:24.000Z","size":17394,"stargazers_count":64,"open_issues_count":18,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T17:28:02.235Z","etag":null,"topics":["babashka","clojure","clojurescript","console","debugging","fireworks","lasertag","live-coding","pretty-printing","syntax-highlighting","tapping","terminal","tracing","typography"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/paintparty.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2024-03-01T07:24:06.000Z","updated_at":"2025-03-13T01:13:36.000Z","dependencies_parsed_at":"2025-03-13T02:33:55.189Z","dependency_job_id":null,"html_url":"https://github.com/paintparty/fireworks","commit_stats":null,"previous_names":["paintparty/fireworks"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paintparty%2Ffireworks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paintparty%2Ffireworks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paintparty%2Ffireworks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paintparty%2Ffireworks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paintparty","download_url":"https://codeload.github.com/paintparty/fireworks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247517913,"owners_count":20951719,"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":["babashka","clojure","clojurescript","console","debugging","fireworks","lasertag","live-coding","pretty-printing","syntax-highlighting","tapping","terminal","tracing","typography"],"created_at":"2025-03-21T18:36:31.220Z","updated_at":"2025-04-06T17:11:52.724Z","avatar_url":"https://github.com/paintparty.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\u003cimg src=\"./resources/color-printer-logo.png\" width=\"400\"\u003e\u003c/img\u003e\u003c/div\u003e \n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://clojars.org/io.github.paintparty/fireworks\"\u003e\n\u003cimg src=\"https://img.shields.io/clojars/v/io.github.paintparty/fireworks.svg?color=0969da\u0026style=flat\u0026cacheSeconds=3\" alt=\"Fireworks on Clojars\"\u003e\u003c/img\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n\n**[Features]**  \u0026nbsp;•\u0026nbsp; **[Setup]**  \u0026nbsp;•\u0026nbsp;  **[Usage]** \u0026nbsp;•\u0026nbsp; **[Modes]** \u0026nbsp;•\u0026nbsp;  **[Options]** \u0026nbsp;•\u0026nbsp; **[Theming]** \u0026nbsp;•\u0026nbsp; **[Interop]** \u0026nbsp;•\u0026nbsp;  **[Contributing]**\n\u003c/div\u003e\n\n[Features]: #features\n[Setup]: #setup\n[Usage]: #usage\n[Modes]: #tap-driven-development\n[Options]: #options\n[Theming]: #theming\n[Interop]: #printing-conventions\n[Contributing]: #contributing\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\u003csub\u003e\u003cb\u003eFireworks (Alabaster Dark) + Clojure + lein-test-refresh + integrated terminal\u003c/b\u003e\u003c/sub\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"830px\"\n       src=\"resources/tour/fw-tour-intro-dark.gif\"\n       alt=\"Fireworks light and dark themes animated slideshow\"\u003e\n  \u003c/img\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\u003csub\u003e\u003cb\u003eFireworks (Alabaster Light) + Clojure + lein-test-refresh + integrated terminal\u003c/b\u003e\u003c/sub\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"830px\"\n       src=\"resources/tour/fw-tour-intro-light.gif\"\n       alt=\"Fireworks light and dark themes animated slideshow\"\u003e\n  \u003c/img\u003e\n\u003c/p\u003e\n\u003c!-- \u003cp align=\"center\"\u003e\u003cimg width=\"830px\" src=\"resources/fireworks-samples-cropped-xl-2.gif\" alt=\"Fireworks light and dark themes animated slideshow\"\u003e\u003c/img\u003e\u003c/p\u003e --\u003e\n\u003c!-- \u003cp align=\"center\"\u003e\u003csub\u003e\u003cb\u003eLight and dark variants of \u003ci\u003e Alabaster, Neutral, Monokai, Solarized, Zenburn, and Degas.\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/p\u003e --\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Features\n\n- Prints values without altering the execution of your program.\n\n- Achieve thematic parity between editor, terminal emulator, and browser dev console.\n\n- Customizable via system-wide `.edn` config file.\n\n- Novel typographic approach for printing metadata inline, alongside values.\n\n- Truncation of collections and long values such as strings.\n\n- Left-justification of values in maps.\n\n\u003c!-- - Trace values in `let` bindings and threading macros such as `-\u003e`. --\u003e\n\u003c!-- - Trace values in threading macros such as `-\u003e`, `-\u003e\u003e`, `some-\u003e`, `some-\u003e\u003e`. --\u003e\n\n- Optional rainbow brackets, in high or low contrast.\n\n- Makes cljs color printing possible in all dark-mode-themed browser consoles. \n\n- Enhanced reflection for JS and Java values.\n\n- Say goodbye to mysterious things like `#[Object #[Object]]`\n\n- Find and highlight values in printed output.\n\n- Call site options let you easily try out different themes and formatting options.\n\n- Ships with several popular themes in light and dark variants.\n\n\u003cbr\u003e\n\n## Setup\n\nRequires Clojure `1.10.3` or higher\n\nIf using with Babashka, requires Babashka `v1.12.196`(coming soon) or higher\n\n\u003cbr\u003e\n\n### Step 1:\n\nAdd as a dependency to your project:\n\n\n```clojure\n[io.github.paintparty/fireworks \"0.10.4\"]\n```\n\n\u003cbr\u003e\n\n### Step 2:\n\nImport into your namespace:\n\n```clojure\n(ns myns.core\n  (:require\n    [fireworks.core :refer [? !? ?\u003e !?\u003e]]))\n```\n\n\u003cbr\u003e\n\n### Step 3:\n\nAdd a [system-wide config file](#system-wide-config) at `/Users/\u003cyour-home-folder\u003e/.fireworks/config.edn` (suggested path). You will need to substitute `\u003cyour-home-folder\u003e` in the example above with the name of your user folder on your computer. There are a [bunch of options](#all-the-options), but at minimum you'll probably want to specify a light or dark stock theme:\n\n```Clojure\n {:theme \"Alabaster Light\"\n  ;; :theme \"Alabaster Dark\"    \n  ;; :theme \"Neutral Light\"     \n  ;; :theme \"Neutral Dark\"      \n  ;; :theme \"Degas Light\"       \n  ;; :theme \"Degas Dark\"        \n  ;; :theme \"Zenburn Light\"     \n  ;; :theme \"Zenburn Dark\"      \n  ;; :theme \"Solarized Light\"   \n  ;; :theme \"Solarized Dark\"    \n  ;; :theme \"Monokai Light\"     \n  ;; :theme \"Monokai Dark\"\n  ;; :theme \"Universal Neutral\" ; works with both light and dark bg\n  \n  ;; set to true if your terminal doesn't support truecolor\n  ;; :legacy-terminal? false \n  }\n```\n\nMost terminal-emulators support truecolor (16m colors). If your terminal does not, then you definitely will want to set the `:legacy-terminal?` option to `true`. You can check support by pasting this into your terminal:\n\n```\necho -e \"\\033[1;38;2;255;0;0mRED\\033[0m \\033[1;38;2;0;255;0mGREEN\\033[0m \\033[1;38;2;0;0;255mBLUE\\033[0m \\033[1;38;2;255;255;0mYELLOW\\033[0m\"\n```\n\nIf the words in the resulting output are not colored red, green, blue, and yellow, then your terminal does not support truecolor.\n\n\u003cbr\u003e\n\n### Step 4:\n\nAdd a [system-wide environmental variable](#system-wide-config) in the right place (in your `.zshrc` or similar), to let Fireworks know where to find your config:\n\n```Clojure\nexport FIREWORKS_CONFIG=\"/Users/\u003cyour-home-folder\u003e/.fireworks/config.edn\"\n```\n\u003cbr\u003e\n\n### Step 5:\n\nAlign your terminal and/or browser dev console background color with the\nFireworks theme you are using. See\n[this section](#aligning-your-console-background-color-and-foreground-color) for\ndetails.\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Two libraries\n\nIn development, use the `io.github.paintparty/fireworks` library.\n\nFor production builds, use the [`io.github.paintparty/fireworks-stubs`](https://github.com/paintparty/fireworks-stubs) library. The API is identical to `fireworks` but the macros don't print anything - they just expand to the original form itself. This way, you don't have to worry about production code that contains tapping/debugging code that you forgot to remove.\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Usage\nThis section outlines the four public macros that fireworks offers:\u003cbr\u003e\n**`?`**, **`!?`**, **`?\u003e`**, and **`!?\u003e`**.\n\n\u003cbr\u003e\n\n**`fireworks.core/?`** is a macro that prints the form, namespace info, and resulting value. It returns the resulting value.\n\n```Clojure\n(def x {:a \"foo\" :xyz \"bar\"})\n\n(? x)\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/fireworks-core-par.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\nCalling **`fireworks.core/?`** with two arguments will print a label (instead of the form), the namespace info, and the result:\n\n```Clojure\n(? \"My label\" x)\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/fireworks-core-par-label.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\nThe first argument can also be a map, which supplies various [config options](#options):\n\n```Clojure\n(? {:label      \"My label\"\n    :theme      \"Monokai Light\"\n    :coll-limit 10}\n   x)\n```\n\n\n\u003cbr\u003e\n\nThe first argument can also be a specific flag, in the form of a keyword,\nwhich dictates a mode of functionality (See the table in the following section for more details):\n\n```Clojure\n(? :- x)\n```\n\n\u003cbr\u003e\n\nIf you want to use a specific mode and also supply a custom label and/or override config options, you can call  **`fireworks.core/?`** with 3 arguments:\n\n```Clojure\n;; Passing the `:log` flag as the first argument will print the value with js/console.log or pprint, instead of fireworks formatting.\n;; Prints with custom label of \"My label\", the file info, and returns the result.\n(? :log \"My label\" x)\n\n;; Passing the `:-` flag as the first argument will print only the value.\n;; Omits form (or custom label) and the file info.\n;; Options map override default config options.\n;; Returns the result\n(? :result {:coll-limit 10} x)\n\n```\n\n\u003cbr\u003e\n\n**`fireworks.core/!?`** is a no-op macro that just returns the value. It is intended for situations where you want to temporarily \"silence\" the printing, because you will likely turn it back on again in the near future.\n\n\u003cbr\u003e\n\n**`fireworks.core/?\u003e`** is a macro that sends the form to `clojure.core/tap\u003e`, and then returns the value.\n\n\u003cbr\u003e\n\n**`fireworks.core/?\u003e`** is a no-op that just returns the value. It is intended for situations where you already have a form wrapped with `?\u003e`, and you want to temporarily *not* send it to `clojure.core/tap\u003e`.\n\n\n\n\n\n\u003cbr\u003e\n\n### Tap-driven development\nFireworks prints values from your source without altering the execution of your program. By default, the printed output that Fireworks produces is typographically optimized for speed of comprehension. When printing data structures, the primary goal is to provide the user with a high-level snapshot of the shape and contents of the data. This is often sufficient to enable understanding at glance, and doesn't require the user to switch context and interact with a entirely separate UI that might involve clicking and scrolling around just to look at a single nested value.\n\nBecause Fireworks is designed to provide quick, rapid feedback to the terminal or browser dev console, it complements discovery-centric tools with a dedciated UI such as [FlowStorm](https://www.flow-storm.org/), [Reveal](https://vlaaad.github.io/reveal/), or [Portal](https://github.com/djblue/portal).\n\nThe `?` macro also provides a bevy of functionality that can be controlled an optional leading keyword flag and/or a map of options. For example, when it is necessary to view a data structure in its entirety, or without any truncation of values, you can pass specific options at the call site, or simply just include `:log` or `:pp` as the leading argument to **`fireworks.core/?`**.\n\nAll the available alternate printing modes for **`fireworks.core/?`** and their behaviors are outlined in the table below. These modes are activated by passing an optional leading keyword flag. Unless noted otherwise, **`fireworks.core/?`** will always return the value passed to it.\n\n\u003cbr\u003e\n\n| Mode        | Prints with       | Prints label? | Prints file info? | Returns |\n| :---        | :---              | :---          | :---              | :--     |\n|  none       | Fireworks         | ✓             | ✓                 | value   |\n| `:-`        | Fireworks         | ×             | ×                 | value   |\n| `:no-label` | Fireworks         | ×             | ✓                 | value   |\n| `:no-file`  | Fireworks         | ×             | ✓                 | value   |\n| `:log`      | `js/console.log`* | ✓             | ✓                 | value   |\n| `:log-`     | `js/console.log`* | ×             | ×                 | value   |\n| `:pp`       | `pp/pprint`       | ✓             | ✓                 | value   |\n| `:pp-`      | `pp/pprint`       | ×             | ×                 | value   |\n| `:data`     | N/A               | ×             | ×                 | map     |\n| `:comment`  | N/A               | ✓             | ✓                 | nil     |\n\n\n\u003c!--TODO put this back in once problems fixed\u003e\n\u003c!-- | `:trace`   | Fireworks         | ✓             | ✓                 | Traces `-\u003e`, `-\u003e\u003e` `some-\u003e`, `some-\u003e\u003e`.                                              | --\u003e\n\n\u003cspan\u003e*\u003c/span\u003e `:log` and `:log-` will dispatch to `pp/pprint` in a JVM context.\n\n\u003cbr\u003e\n\nSome annotated examples using modes outlined in the above table:\n\n```Clojure\n\n;; Prints just the result. Omits the label and file info.\n(? :- (+ 1 1))\n\n;; Prints the file info and the result. Omits the label.\n(? :no-label (+ 1 1))\n\n;; Prints the label, file info, and the result. Uses pprint instead of fireworks. \n(? :pp (+ 1 1))\n\n;; Prints a custom label, file info, and the result. Uses pprint instead of fireworks. \n(? :pp \"My label\" (+ 1 1))\n```\n\n\n\n\n### Getting the formatted string \u0026 other data\n\nIf you just want the formatted string, and/or other data that **`fireworks.core/?`** uses to construct the printed output, you can use the `:data` option.\n\nCalling `(? :data ...)` in a ClojureScript (browser) context also provides vectors of css styles. This corresponds to the arguments that `js/console.log` requires for syntax-colored formatting. In a terminal context, `p-data` returns the same map as below, but with sgr escape codes for syntax coloring (instead of the `%c` tags), and no vectors of css styles:\n\n```Clojure\n;; ClojureScript\n\n(? :data \"foo\")\n=\u003e\n{:quoted-form   \"foo\",\n :formatted     {:string     \"%c\\\"foo\\\"%c\",\n                 :css-styles [\"color:#448C27;line-height:1.45;\"\n                              \"color:#585858;line-height:1.45;\"]},\n :file          \"fireworks/core_test.cljc\",\n :end-column    46,\n :ns-str        \"fireworks.core-test\",\n :file-info-str \"fireworks.core-test:17:21\",\n :column        21,\n :line          17,\n :end-line      17,\n :formatted+    {:string     \"%cfireworks.core-test:17:21%c\\n%c\\\"foo\\\"%c %c=\u003e%c %c\\\"foo\\\"%c\",\n                 :css-styles [\"color:#8c8c8c;font-style:italic;line-height:1.45;\"\n                              \"color:#585858;line-height:1.45;\"\n                              \"color:#448C27;line-height:1.45;\"\n                              \"color:#585858;line-height:1.45;\"\n                              \"color:#28cc7d;line-height:1.45;\"\n                              \"color:#585858;line-height:1.45;\"\n                              \"color:#448C27;line-height:1.45;\"\n                              \"color:#585858;line-height:1.45;\"]}}\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n## Options\n\n\nFor cutting \u0026 pasting into your [system-wide config](#system-wide-config), or trying things out at the call site: \n\n```Clojure\n{:theme                         \"Alabaster Light\"\n :line-height                   1.45\n :print-level                   7\n :label-length-limit            25\n :non-coll-length-limit         33\n :non-coll-mapkey-length-limit  20\n :non-coll-result-length-limit  444\n :non-coll-depth-1-length-limit 59\n :single-line-coll-length-limit 15\n :coll-limit                    15\n :display-namespaces?           true\n :metadata-print-level          7\n :display-metadata?             true\n :metadata-position             :inline   ; :inline | :block\n :enable-rainbow-brackets?      true\n :bracket-contrast              :high     ; :high | :low\n :legacy-terminal?              false     \n :find                          nil\n :when                          nil}\n```\n\n\u003cbr\u003e\n\n### System-wide config\n\nFireworks is designed to pick up your preferred theming and formatting options from a system-wide `.edn` config file that lives in a globally accessible place outside of any projects. In order to make this work, you will need to set the environment variable `FIREWORKS_CONFIG` to the path of this file.\nThis `.edn` config file can live anywhere on your computer, but by convention should be `~/.fireworks/config.edn`. If you were to set the environment variable in your `.zshrc` (or similar), it would look like this:\n\n```\nexport FIREWORKS_CONFIG=\"/Users/\u003cyour-home-folder\u003e/.fireworks/config.edn\"\n```\n\nYou will need to substitute `\u003cyour-home-folder\u003e` in the example above with the name of your user folder on your computer. When you setup this environment variable for the first time, and you are already running a Clojure(Script) project that you aim to use Fireworks in, you will probably need restart a new session from a new terminal instance, so that your new `FIREWORKS_CONFIG` env var will be accessible in your dev environment.\n\nFor the actual `config.edn` file, you can use the above example map (at the beginning of this section) as a starting point. Prior to doing this you can experiment with the various configuration options ala-carte via passing a leading options map to `fireworks.core/?`:\n\n\u003cbr\u003e\n\n### All the options\nAll of the available config options and their default values:\n\n\u003cbr\u003e\n\n#### **`:theme`**\nDefaults to `\"Alabaster Light\"`\u003cbr\u003e\n\nSets the theme. This will override `:mood` setting.\nThis must be one of the following 3 types of values:\n\n- A theme name which corresponds to the theme name of an stock fireworks theme in `themes/`. Currently, these include the following:\u003cbr\u003e\u003cbr\u003e\n`\"Alabaster Light\"`\u003cbr\u003e\n`\"Alabaster Dark\"`\u003cbr\u003e\n`\"Neutral Light\"`\u003cbr\u003e\n`\"Neutral Dark\"`\u003cbr\u003e\n`\"Solarized Light\"`\u003cbr\u003e\n`\"Solarized Dark\"`\u003cbr\u003e\n`\"Degas Light\"`\u003cbr\u003e\n`\"Degas Dark\"`\u003cbr\u003e\n`\"Zenburn Light\"`\u003cbr\u003e\n`\"Zenburn Dark\"`\u003cbr\u003e\n`\"Monokai Light\"`\u003cbr\u003e\n`\"Monokai Dark\"`\u003cbr\u003e\n`\"Universal Default\"`\u003cbr\u003e\n\n- A path pointing to an `.edn` file on your computer, the contents of which constitute a valid fireworks theme.\u003cbr\u003eThe path must be absolute e.g. `\"/Users/\u003cyour-home-folder\u003e/.fireworks/my-theme.edn\"`\u003cbr\u003e\nThis will not work:\n`\"~/.fireworks/my-theme.edn\"`\n\u003cbr\u003eIf the map in this `.edn` file fails to satisfy the `fireworks.specs.theme/theme` spec it will issue a warning and fall back to the default light or dark theme (depending on the value of `:mood`). \n\n- A valid Fireworks theme, which is a map that satisfies the `fireworks.specs.theme/theme` spec. Typically, its structure will at minimum resemble the first example found in the [theming section ](#theming) of this document.\n\n\n\u003cbr\u003e\n\n\n#### **`:line-height`**\nDefaults to `1.45`\u003cbr\u003e\n\nSets the line-height. Only takes effect in browser consoles.\n\n\u003cbr\u003e\n\n#### **`:coll-limit`**\nDefaults to `15`\u003cbr\u003e\n\nSets the max length of collections.  Collections whose count are at least 2 greater than this number will be truncated. By default, Fireworks aggressively truncates collections to keep the display footprint of the printed output as short and narrow as possible.\n\n\u003cbr\u003e\n\n#### **`:label-length-limit`**\n\n Defaults to `25`\u003cbr\u003e\n\nSets the max length of the form-to-be-evaled labe, or the user label, if supplied.\n\n\u003cbr\u003e\n\n#### **`:print-level`**\n Defaults to `7`\u003cbr\u003e\n\nSets the max depth of printing for nested collections.\n\n\u003cbr\u003e\n\n#### **`:non-coll-length-limit`**\n Defaults to `33`\u003cbr\u003e\n\nSets the max length of things like strings, keywords, function names, etc., when they are nested more than one level deep inside a data structure. Values whose length exceeds this will be ellipsized.\n\n\n\u003cbr\u003e\n\n#### **`:non-coll-mapkey-length-limit`** \nDefaults to `20`\u003cbr\u003e\n\nSets the max length of things like strings, keywords, function names, etc., when they are used as keys in maps. Longer values will be ellipsized.\n\n\n\u003cbr\u003e\n\n#### **`:non-coll-result-length-limit`**\nDefaults to `444`\u003cbr\u003e\n\nSets the max length of a non-collection value such as a string, keyword, function name, etc. Only applies when the value itself is the result of the evaluation (not nested within a data structure).\n\n\n\u003cbr\u003e\n\n\n#### **`:non-coll-depth-1-length-limit`**\nDefaults to `69`\u003cbr\u003e\n\nSets the max length of a non-collection value such as a string, keyword, function name, etc. Only applies when the value is nested one level deep inside the result, which would be a non-associative collection such as a vector or seq.\n\n\n\u003cbr\u003e\n\n#### **`:enable-rainbow-brackets?`**\nDefaults to `true`\u003cbr\u003e\n\nWhether or not to use rainbow brackets. Rainbow brackets can be customized in your theme.\n\n\n\u003cbr\u003e\n\n#### **`:bracket-contrast`**\nDefaults to `\"high\"`\u003cbr\u003e\n\nSets the level of rainbow bracket intensity to `\"high\"` or `\"low\"`.  Default value can also be overridden by `:bracket-contrast` entry in a Fireworks theme map.\n\n\n\u003cbr\u003e\n\n#### **`:display-namespaces?`**\nDefaults to `true`\u003cbr\u003e\n\nWhether or not to print out fully qualified namespaces for functions and classes. Note that even if set to `true`, namespaces may get dropped if the count of fully qualified symbol exceeds the `:non-coll-length-limit` or the `:non-coll-mapkey-length-limit` (in the case of map keys).\n\n\u003cbr\u003e\n\n#### **`:legacy-terminal?`**\n\nDefaults to `false`\u003cbr\u003e\n\nIf set to `true`, Fireworks will convert the hex color values to sgr-rgb codes (x256) for terminal emulators that do not support 24-bit color. If you will be printing with Fireworks in a terminal, and your terminal emulator does not supports 24-bit color, it is highly recommended to set this to `true`. The majority of modern terminal emulators offer support for truecolor. You can test whether or not your terminal supports truecolor by pasting the following in your terminal:\n\n```\necho -e \"\\033[1;38;2;255;0;0mRED\\033[0m \\033[1;38;2;0;255;0mGREEN\\033[0m \\033[1;38;2;0;0;255mBLUE\\033[0m \\033[1;38;2;255;255;0mYELLOW\\033[0m\"\n```\n\nIf the words in the resulting output are not colored red, green, blue, and yellow, then your terminal does not support truecolor, and you will want to set this option to `true`.\n\n\u003cbr\u003e\n\n#### \u003c!--**`:enable-terminal-truecolor?`**--\u003e\n\u003c!--Defaults to `true`\u003cbr\u003e--\u003e\n\n\u003c!--If set to `false`, Fireworks will convert the hex color values to sgr-rgb codes (x256) for terminal emulators that do not support 24-bit color. If you will be printing with Fireworks in a terminal, and your terminal emulator does not support 24-bit color, it is highly recommended to set this to `false`.--\u003e\n\n\u003c!--\u003cbr\u003e--\u003e\n\n#### \u003c!--**`:enable-terminal-italics?`**--\u003e\n\u003c!--Defaults to `true`\u003cbr\u003e--\u003e\n\n\u003c!--If set to `false`, any theme tokens specified to be italicized will not be italicized. You probably don't want to change this option.--\u003e\n\n\n\u003c!--\u003cbr\u003e--\u003e\n\n#### \u003c!--**`:enable-terminal-font-weights?`**--\u003e\n\u003c!--Defaults to `true`\u003cbr\u003e--\u003e\n\n\u003c!--If set to `false`, any theme tokens specified to be bold will NOT be bold. You .--\u003e\n\n\u003c!--\u003cbr\u003e--\u003e\n\n#### **`:metadata-print-level`** \nDefaults to `6`\u003cbr\u003e\n\nSets the max depth of printing for metadata maps that contain nested collections.\n\n\u003cbr\u003e\n\n#### **`:display-metadata?`**\nDefaults to `true`\u003cbr\u003e\n\nPrint metadata values.\n\n\u003cbr\u003e\n\n#### **`:metadata-position`** \nDefaults to `\"inline\"`\u003cbr\u003e\n\nDetermines position of metadata relative to value that is carrying it. Options are `\"inline\"` (default), or `\"block\"`. \n\n\u003cbr\u003e\n\n#### **`:find`** \nDefaults to `nil`\u003cbr\u003e\n\nFind and highlight values in the printed output. See [Highlighting values](#highlighting-values) section.\n\n\u003cbr\u003e\n\n#### **`:when`** \n\nDefaults to `nil`\u003cbr\u003e\n\nIf supplied, this value should be a predicate. Will only print something if value passes predicate.\n\n\u003cbr\u003e\n\n#### **`:print-with`**\nDefaults to `nil`\u003cbr\u003e\n\nAlthough more of an edge-case, you can pass a `:print-with` option at the call site if you would like to print the value using a built-in clojure core printing function. The value must be one of `pr`, `pr-str`, `prn`, `prn-str`, `print`, or `println`. If you want to print with `pprint` or `js/console.log`, use `(? :pp ...)` or `(? :log ...)`.\n\n```Clojure\n(? {:label      \"My label\"\n    :print-with prn}\n   x)\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n\n### Helpful warnings for bad option values\n\nIf you happen to pass a bad value for an option, either at the call-site or in your global config, Fireworks will issue an actionable warning:\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/helpful-warnings.png\" width=\"634px\" /\u003e\u003c/p\u003e\n\n\n\n\n\n## Displaying metadata\nBy default, Fireworks offers a unique way of printing metadata inline, next to the values which carry them. The intent of this is to spatially and stylistically decouple the metadata from the value to which it is attached. In practice, I find this formatting much faster to comprehend as compared to conventional \"block\" positioning of the metadata (above the carrying value), especially when working with metadata-heavy code.\n\nFor data structures, the metadata map is displayed inline, immediately following the opening bracket. This means that any collection carrying metadata will always be display multi-line, with each value on its own line. Below is an example vector of three quoted symbols:\n\n\n```Clojure\n(? ^{:a \"a\"} ['foo 'bar 'baz]\n```\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/metadata-coll-inline.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\nHere is the same vector, with the second symbol in the vector carrying metadata:  \n\n```Clojure\n(? ^{:a \"a\"} ['foo (with-meta (symbol \"bar\") {:b \"b\"}) 'baz]\n```\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/metadata-coll-and-symbol-inline.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\nIf you would rather print metadata in the traditional \"block\" position, you can set the config value of `:metadata-positioning` to `:block`:\n\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/metadata-coll-and-symbol-block.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Highlighting values in printed output\n\nFireworks offers a `:find` option which takes a map containing a `:pred` entry. It will highlight any matches in the printed output. \n```Clojure\n(def x [1 33 99 777 -16]\n\n(? {:find {:pred #(= % 777)}} x)\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/highlight.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\n\nYou can also pass a custom highlighting style:\n\n```Clojure\n(? {:find {:pred #(= % 777)\n           :style {:background-color \"#a0f7fd\"}}}\n   [1 33 99 777 -16])\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/highlight-with-custom-style.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\n\nOr pass multiple preds, with different styles:\n```Clojure\n(? {:find [{:pred #(= % 777)}\n           {:pred #(= % -16)\n            :style {:background-color \"#a0f7fd\"}}]}\n   [1 33 99 777 -16])\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/highlight-with-multiple-custom-styles.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Theming\n\nFireworks includes a handful of popular themes:\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eAlabaster Light\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/light/Alabaster-Light.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eZenburn Light\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/light/Zenburn-Light.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eSolarized Light\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/light/Solarized-Light.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eMonokai Light\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/light/Monokai-Light.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eDegas Light\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/light/Degas-Light.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eNeutral Light\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/light/Neutral-Light.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eUniversal Neutral (used if no theme is specified)\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/light/Universal-Neutral-On-Light.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eAlabaster Dark\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/dark/Alabaster-Dark.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eZenburn Dark\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/dark/Zenburn-Dark.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eSolarized Dark\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/dark/Solarized-Dark.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eMonokai Dark\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/dark/Monokai-Dark.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eDegas Dark\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/dark/Degas-Dark.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eNeutral Dark\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/dark/Neutral-Dark.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eUniveral Neutral (used if no theme is specified)\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"resources/themes/dark/Universal-Neutral-On-Dark.png\" width=\"534px\"/\u003e\u003c/div\u003e\n\n\n\nMaking your own Fireworks theme to perfectly match your current editor theme is straightforward.\n\nIf you would like to make your own theme for use with Fireworks, check out `docs/example-theme.edn`. Notice how any of the keys in the `:classes` entry will act as a variable if the same keyword is used as a value in any of the other entries within the `:classes`, `:syntax`, or `:printer` maps.\n\nFor your own theme, you do not need to dictate every value that is present in the `:theme` map within the example (`docs/example-theme.edn`). For example, in the default `\"Alabaster Light\"`, you can see how just a small handful of the tokens are specified. Internally, this gets merged with the base light theme, which specifies how most of the other values inherit from the basic classes in `:classes`. \n```Clojure\n(def alabaster-light\n  {:name   \"Alabaster Light\"\n   :desc   \"Based on @tonsky's Alabaster theme.\"\n   :about  \"This is additional documentation. Should support markdown here.\"\n   :url    \"url goes here\"\n   :author \"Author Name\"\n   :langs  [\"Clojure\" \"ClojureScript\" \"Babashka\"]\n   :mood   :light\n   :tokens {:classes {:background    {:background-color \"#f7f7f7\"}\n                      :string        {:color \"#448C27\"}\n                      :constant      {:color \"#7A3E9D\"}\n                      :definition    {:color \"#4d6dba\"}\n                      :annotation    {:color      \"#8c8c8c\" \n                                      :font-style :italic}\n                      :metadata      {:color            \"#be55bb\"\n                                      :text-shadow      \"0 0 2px #ffffff\"\n                                      :background-color \"#fae8fd\"}\n                      :metadata2     {:color            \"#be55bb\"\n                                      :text-shadow      \"0 0 2px #ffffff\"\n                                      :background-color \"#e9e5ff\"}\n                      :label         {:color            \"#4d6dba\"\n                                      :background-color \"#edf2fc\"\n                                      :text-shadow      \"0 0 2px #ffffff\"\n                                      :font-style       :italic}\n                      :eval-label    {:color            \"#4d6dba\"\n                                      :background-color \"#edf2fc\"\n                                      :text-shadow      \"0 0 2px #ffffff\"\n                                      :font-style       :italic}}\n            :syntax  {:js-object-key {:color \"#888888\"}}\n            :printer {:file-info     {:color                \"#4d6dba\"\n                                      :font-style           :italic\n                                      :padding-inline-start :0ch}\n                      :eval-form     :eval-label\n                      :comment       {:color            \"#2e6666\"\n                                      :text-shadow      \"0 0 2px #ffffff\"\n                                      :background-color \"#e5f1fa\"\n                                      :outline          \"2px solid #e5f1fa\"\n                                      :font-style       :italic}\n                      :function-args {:color \"#999999\"}\n                      :atom-wrapper  :label}}})\n```\n\n\u003cbr\u003e\n\nThe simplest way to make a theme is to just start experimenting within any namespace in your project:\n\u003c!-- TODO FILL this out more --\u003e\n```Clojure\n(def my-theme\n {:name \"Foo Dark\" ;; Required. Name validated with: #\"^[A-Z][^\\t\\n\\r]+ (:?Dark|Light)$\"\n  :mood \"dark\"     ;; Required. \"light\" or \"dark\"\n  :theme {:classes {:string {:color \"#c7e62e\"}}\n          :syntax  {:js-object-key {:color \"#888888\"}}\n          :printer {:function-args {:color \"#bb8f44\"}}}})\n\n;; And then just try it out with some kind of sample value like this:\n(? {:theme my-theme}\n   {:string-sample   \"string\"\n    :number-sample   1234\n    :boolean-sample  true\n    :labmda-sample   #(inc %)\n    :fn-sample       juxt\n    :regex-sample    #\"^hi$\"\n    :symbol-sample   'mysym})\n```\n\nTweak the colors to your liking, save the theme as an `.edn` file somewhere on your computer, then set that path as the value of the `:theme` entry in your `.edn` config.\n\nFor a theme token's `:color` or `:background-color`, the value must be a string which is a valid css hex(a) color. This hex will be used for both browser dev consoles and terminal consoles. Your terminal must support 24bit (TrueColor) , and you must explicitly set `:enable-terminal-truecolor?` to `true` in order for the colors to render as expected. If you are using a terminal that does not support 24bit color, such as the Terminal app on macOS, and Fireworks config option `:enable-terminal-truecolor?` is set to `false` (which is default), the specified hex color will automatically get converted to its closest `x256` equivalent.\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Aligning your console background color and foreground color\nFireworks can only color the foreground and background of \"spans\" of text. If you want to perfectly match the themed experience of your source code editor, you will need to manually set the font-family and background color of your terminal emulator and/or browser dev console.\n\n\n\u003cbr\u003e\n\n### Setting the background color and font-family of your terminal emulator\nMost terminal emulators have preferences which allow you to change, among other things, the default font-family, background color, and foreground color. Below is a list of the **background colors** of all the stock Fireworks themes:\n\n```\n\"Alabaster Light\" #f7f7f7\n\"Alabaster Dark\"  #0e1415\n\"Neutral Light\"   #ffffff\n\"Neutral Dark\"    #000000\n\"Degas Light\"     #f5f9f9\n\"Degas Dark\"      #363f4e\n\"Zenburn Light\"   #f9f8f5\n\"Zenburn Dark\"    #3f3f3f\n\"Solarized Light\" #fdf6e3\n\"Solarized Dark\"  #002b36\n\"Monokai Light\"   #ffffff\n\"Monokai Dark\"    #2d2a2e\n```\n\nIf you are using a custom theme with Fireworks, you will probably want to use the background color for that custom theme.\n\n\u003cbr\u003e\n\n### Setting the foreground color of your terminal emulator\nFor theming parity between your editor and terminal emulator, this is probably not as important as setting the background color as described above. However, setting the foreground color will most likely improve your experience as it will ensure that the default foreground color of all other things printed (but not formatted with fireworks) to standard out will jive with the Fireworks theme you are using. Below is a list of the **foreground colors** of all the stock Fireworks themes:\n\n```\n\"Alabaster Light\" #585858\n\"Alabaster Dark\"  #989898\n\"Neutral Light\"   #585858\n\"Neutral Dark\"    #cecece\n\"Degas Light\"     #585858\n\"Degas Dark\"      #cecece\n\"Zenburn Light\"   #666666\n\"Zenburn Dark\"    #cecece\n\"Solarized Light\" #666666\n\"Solarized Dark\"  #999999\n\"Monokai Light\"   #585858\n\"Monokai Dark\"    #cecece\n```\n\n\u003cbr\u003e\n\n### Setting the background color and font in Chrome DevTools (ClojureScript) \nIf you are using Firefox, ignore this section and follow [the instructions in the following section](#setting-the-background-color-and-font-in-firefox-developer-tools).\n\nFirst, you will need to set the general appearance of your Chrome browser's DevTools UI to \"Light\" or \"Dark\", depending on whether you are using a light or dark Fireworks theme. This can be done by opening DevTools on any page, clicking the **Settings** gear icon button, and then **Preferences** \u003e **Appearance** \u003e **Theme**. Official instructions \u003ca href=\"https://developer.chrome.com/docs/devtools/settings\" target=\"_blank\"\u003ehere\u003c/a\u003e.\n\n\n\n\u003e [!WARNING]\n\u003e\n\u003e As of November 18, 2024, The DevTools Console Customizer described below has stopped working in Chrome, most likely [due to changes made in Chrome version 130](https://github.com/paintparty/devtools-console-customizer/issues/1). Hopefully this can be fixed soon.\n\n\n\nChrome does not offer direct options in the UI to set the exact background color or font-family of the console in dev tools. To make this simple, I created an extension called \u003ca href=\"https://chromewebstore.google.com/detail/kjkmaoifmppnclfacnmbimcckfgekmod\" target=\"_blank\"\u003eDevTools Console Customizer\u003c/a\u003e, available via \u003ca href=\"https://chromewebstore.google.com/detail/kjkmaoifmppnclfacnmbimcckfgekmod\" target=\"_blank\"\u003eThe Chrome Web Store\u003c/a\u003e. The project page is \u003ca href=\"https://github.com/paintparty/devtools-console-customizer\" target=\"_blank\"\u003ehere\u003c/a\u003e.\n\nAfter making a change with this extension, you will need to close and reopen DevTools. If you are switching from a light to dark theme or vice-versa, remember to also reset the general appearance of DevTools in **Settings** \u003e **Preferences** \u003e **Appearance** \u003e **Theme**, as described above.\n\n\n![](./resources/devtools-console-customizer-screen-recording.gif)\n\n\u003cbr\u003e\n\n### Setting the background color and font in Firefox Developer Tools (ClojureScript)\nIn Firefox, this can be done by opening Firefox Developer Tools on any page, just right-click and select **Inspect**. Then click on the *`•••`* button in the top right of this panel and select **Settings** to get to the Settings panel. You should see a **Themes** section which will let you select `Light` or `Dark`.\n\n\nYou can customize the font-family and background color of the dev console in **Firefox**, although this has to be done manually. Fireworks provides \u003ca href=\"\" target=\"_blank\"\u003ea starter **`userContent.css`** file\u003c/a\u003e to make this easy. You will need to place this file in the correct directory on your computer so that Firefox can read it when it launches. Follow the \u003ca href=\"https://www.userchrome.org/how-create-userchrome-css.html\" target=\"_blank\"\u003einstructions outlined here\u003c/a\u003e to locate this directory. Please note that file, which is necessary file for customizing the Developer Tools console in FireFox, is called `userContent.css`,  ***NOT*** `userChrome.css` (as mentioned in the linked tutorial).  You can put this in the proper directory as explained in the \u003ca href=\"https://www.userchrome.org/how-create-userchrome-css.html\" target=\"_blank\"\u003elinked tutorial\u003c/a\u003e and change it as needed to align with your chosen theme. Remember to quit and restart Firefox if you make any changes or updates to this `userContent.css` file.\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Printing conventions\n\nThe following sections are comparisons of various default printing conventions (`clojure.pprint/pprint`(or `js/console.log`) vs `fireworks.core/?`).\n\n\u003cbr\u003e\n\n#### Printing maps with data structures as keys\nWhen printing maps that contain keys which are data-structures, `clojure.pprint/pprint` sometimes prints these collections keys on their own line, sometimes not. The resulting printed map can be very difficult to comprehend at a glance: \n\n```Clojure\n;; Example map with data structures as keys\n\n{[\"abcdefghijklmnopqrstuvxyz\" \"ABCDEFGHIJKLMNOPQRSTUVXYZ\"]\n \"vector\",\n\n :b\n \"keyword\",\n\n {:a \"abcdefghijklmnopqrstuvxyz\", :b \"ABCDEFGHIJKLMNOPQRSTUVXYZ\"}\n \"map\", \n\n \"d\"\n \"string\"\n\n #{1 2 3}\n \"set\"}\n\n=\u003e\n\n;; clojure.pprint/pprint output of above map\n\n{[\"abcdefghijklmnopqrstuvxyz\" \"ABCDEFGHIJKLMNOPQRSTUVXYZ\"]\n \"vector\",\n :b \"keyword\",\n {:a \"abcdefghijklmnopqrstuvxyz\", :b \"ABCDEFGHIJKLMNOPQRSTUVXYZ\"}\n \"map\", \n \"d\" \"string\"\n #{1 2 3} \"set\"}\n```\n\u003cbr\u003e\n\nFireworks will always print these maps consistently - every key on its own line \u0026 empty line between all entries:\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/printing-maps-with-colls-as-keys.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\u003cbr\u003e\n\n#### Printing functions in ClojureScript\n\nA sample vector of 3 functions:\n```\n(ns sandbox.browser)\n\n(defn ab [x y] (+ x y))\n\n(defn abc \n  ([x y] (+ x y))\n  ([x y v] (+ x y v)))\n\n(defn my-function-with-a-really-long-name\n  [x y z]\n  (+ x y z))\n\n(def to-be-printed [ab abc my-function-with-a-really-long-name])\n```\n\n`clojure.pprint/pprint` will print the above `to-be-printed` vector of functions like this:\n```\n[#object[sandbox$browser$ab]\n #object[sandbox$browser$abc]\n #object[sandbox$browser$my_function_with_a_really_long_name]]\n```\n\n`js/console.log` will print something like this (differs by browser console):\n```\n\n[ƒ sandbox$browser$ab(x,y){\n  return (x + y);\n },\n ƒ sandbox$browser$abc(var_args){\n  var G__901213 = arguments.length;\n  switch (G__901213) {\n  case 2:\n  return sandbox.browser.abc.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));\n  break;\n  case…,\n ƒ sandbox$browser$my_function_with_a_really_long_name(x,y,z){\n  return (x + y + z);\n }\n```\n\n\u003cbr\u003e\nFireworks:\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/printing-functions-in-cljs.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\nBy default, Fireworks will print the function name with the fully-qualified namespace. This can be disabled by changing the config option `:display-namespaces?` to `false`.\n\nIf the fully-qualified name of the function + args vector exceeds the value of `:non-coll-length-limit`, the args will get ellipsized, the namespace will be dropped (if necessary), and the function name will be ellipsized (if necessary).\n\n\u003cbr\u003e\n\n#### Printing functions in Clojure\n\nFireworks prints functions in Clojure the same way as it does in ClojureScript, except that the named args of the function are not available to be printed in the args vector.\n\n\u003cbr\u003e\n\n#### Printing built-in JavaScript objects and functions (ClojureScript)\n\nExample vector of built-in JS Functions and Constructors:\n ```\n(def built-ins\n  [js/decodeURI\n   js/isFinite\n   js/EvalError\n   js/Date]\n ```\nOutput from `clojure.pprint/pprint`:\n```\n[#object[decodeURI]\n #object[isFinite]\n #object[EvalError]\n #object[Date]]\n```\n\nOutput from `js/console.log`:\n```\n[f decodeURI() {[native code]}\n f isFinite() {[native code]}\n f EvalError() {[native code]}\n f Date() {[native code]}]\n```\nOutput from Fireworks:\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/printing-built-in-functions-in-cljs.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\n\u003cbr\u003e\n\nJS built-in objects such as `js/Math` or `js/JSON` which cannot be called like functions or constructors are printed like this:\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"resources/features/printing-built-in-objects-in-cljs.png\" width=\"534px\" /\u003e\u003c/p\u003e\n\n\n\u003cbr\u003e\n\n## Performance\n\nMeaningless performance test: `fireworks.core/?` vs `clojure.pprint/pprint` in JVM Clojure, printing a map of a dozen entries of various data types (found at `fireworks.smoke-test/basic-samples`).\n\n```\nHardware:  Mac Mini\nProcessor: 3GHz 6-Core Intel\nMemory:    16GB 2667 MHz DDR4\n```\n\nThe test was run using the excellent \u003ca href=\"https://github.com/taoensso/tufte\" target=\"_blank\"\u003e**`taoensso.tufte`**\u003c/a\u003e library:\n\n```\npId         nCalls   Min   Max    Mean  MAD    Clock   Total\n\n:fireworks  1,000    4ms   19ms   5ms   ±10%   5.20s   46%\n:pprint     1,000    5ms   11ms   6ms   ±9%    6.12s   54%\n```\nEven with all the specific formatting and syntax colorization, the performance of printing the values (in this test) with Fireworks (in JVM Clojure) is on average 1.2x faster than `clojure.pprint/pprint`.\n\n\u003cbr\u003e\n\n## Status / Roadmap\nAlpha, subject to change. Currently, the enhanced interop reflection / print handling is focused more on the ClojureScript side. It would be nice to add more support for native Java types and data structures. Issues welcome, see [contributing](#contributing).\n\n\u003cbr\u003e\n\n## Contributing\nIssues for bugs, improvements, or features are very welcome. Please file an issue for discussion before starting or issuing a PR.\n\n\n\u003cbr\u003e\n\n## Alternatives / Prior Art\n\nDiscovery:\u003cbr\u003e\n[FlowStorm](https://www.flow-storm.org/), [Reveal](https://vlaaad.github.io/reveal/), [Portal](https://github.com/djblue/portal).\n\nSerialization:\u003cbr\u003e\n[pp](https://github.com/eerohele/pp), [fipp](https://github.com/brandonbloom/fipp), [zprint](https://github.com/kkinnear/zprint).\n\nDebugging, tracing, observability:\u003cbr\u003e\n[playback](https://github.com/gnl/playback),\n[debux](https://github.com/philoskim/debux),\n[hashp](https://github.com/weavejester/hashp),\n[telemere](https://github.com/taoensso/telemere),\n[ken](https://github.com/amperity/ken), \n[spyscope](https://github.com/dgrnbrg/spyscope),\n[omni-trace](https://github.com/cyrik/omni-trace),\n[postmortem](https://github.com/athos/postmortem),\n[sayid](https://github.com/clojure-emacs/sayid),\n[scope-capture](https://github.com/vvvvalvalval/scope-capture)\n\n\nPrinting and visualization:\u003cbr\u003e\n[puget](https://github.com/greglook/puget),\n[coll-pen](https://github.com/dscarpetti/coll-pen),\n[pp-grid](https://github.com/rorokimdim/pp-grid)\n\n\u003cbr\u003e\n\n## License\n\nCopyright © 2024-2025 Jeremiah Coyle\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaintparty%2Ffireworks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaintparty%2Ffireworks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaintparty%2Ffireworks/lists"}