{:group-id "org.clj-commons", :artifact-id "pretty", :version "2.6.0", :analysis {"clj" ({:name clj-commons.ansi, :publics ({:name *color-enabled*, :file "clj_commons/ansi.clj", :line 17, :dynamic true, :doc "Determines if ANSI colors are enabled; color is a deliberate misnomer, as we lump\nother font characteristics (bold, underline, italic, etc.) along with colors.\n\nThis will be false if the environment variable NO_COLOR is non-blank.\n\nOtherwise, the JVM system property `clj-commons.ansi.enabled` (if present) determines\nthe value; \"true\" enables colors, any other value disables colors.\n\nIf the property is null, then the default is a best guess based on the environment:\nif either the `nrepl.core` namespace is present, or the JVM has a console (via `(System/console)`),\nthen color will be enabled.\n\nThe nrepl.core check has been verified to work with Cursive, with `lein repl`, and with `clojure` (or `clj`).", :type :var} {:name compose, :file "clj_commons/ansi.clj", :line 281, :arglists ([& inputs]), :added "1.4.0", :doc "Given a Hiccup-inspired data structure, composes and returns a string that includes ANSI formatting codes\nfor font color and other characteristics.\n\nThe data structure may consist of literal values (strings, numbers, etc.) that are formatted\nwith `str` and concatenated.\n\nNested sequences are composed recursively; this (for example) allows the output from\n`map` or `for` to be mixed into the composed string seamlessly.\n\nNested vectors represent _spans_, a sequence of values with a specific visual representation.\nThe first element in a span vector declares the visual properties of the span: the color (including\nother characteristics such as bold or underline), and the width and padding (described later).\nSpans may be nested.\n\nThe declaration is usually a keyword, to define just the font.\nThe font def contains one or more terms, separated by periods.\n\nThe terms:\n\nCharacteristic | Values\n--- |---\nforeground color | `red` or `bright-red` (for each color)\nbackground color | same as foreground color, with a `-bg` suffix (e.g., `red-bg`)\nboldness | `bold`, `faint`, or `plain`\nitalics | `italic` or `roman`\ninverse | `inverse` or `normal`\nunderline | `underlined` or `not-underlined`\n\ne.g.\n\n```\n(compose [:yellow \"Warning: the \" [:bold.bright-white.bright-red-bg \"reactor\"]\n \" is about to \"\n [:italic.bold.red \"meltdown!\"]])\n=> ...\n```\n\nThe order of the terms does not matter. Behavior for conflicting terms (e.g., `:blue.green.black`)\nis not defined.\n\nFont defs apply on top of the font def of the enclosing span, and the outer span's font def\nis restored at the end of the inner span, e.g. `[:red \" RED \" [:bold \"RED/BOLD\"] \" RED \"]`.\n\nAlternately, a font def may be a vector of individual keyword, e.g., `[[:bold :red] ...]` rather than\n`[:bold.red ...]`. This works better when the exact font characteristics are determined\ndynamically.\n\nA font def may also be nil, to indicate no change in font.\n\n`compose` presumes that on entry the current font is plain (default foreground and background, not bold,\nor inverse, or italic, or underlined) and appends a reset sequence to the end of the returned string to\nensure that later output is also plain.\n\nThe core colors are `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, and `white`.\n\nWhen [[*color-enabled*]] is false, then any font defs are validated, but otherwise ignored (no ANSI codes\nwill be included in the composed string).\n\nThe span's font declaration may also be a map with the following keys:\n\nKey | Type | Description\n--- |--- |---\n:font | keyword or vector of keywords | The font declaration\n:width | number | The desired width of the span\n:pad | :left, :right, :both | Where to pad the span if :width specified, default is :left\n\nThe map form of the font declaration is typically only used when a span width is specified.\nThe span will be padded with spaces to ensure that it is the specified width. `compose` tracks the number\nof characters inside the span, excluding any ANSI code sequences injected by `compose`.\n\nPadding adds spaces; thus aligning the text on the left means padding on the right, and vice-versa.\n\nSetting the padding to :both will add spaces to both the left and the right; the content will be centered.\nIf the necessary amount of padding is odd, the extra space will appear on the left.\n\n`compose` doesn't consider the characters when calculating widths;\nif the strings contain tabs, newlines, or ANSI code sequences not generated by `compose`,\nthe calculation of the span width will be incorrect.\n\nExample:\n\n [{:font :red\n :width 20} message]\n\nThis will output the value of `message` in red text, padded with spaces on the left to be 20 characters.\n\n`compose` does not truncate a span to a width, it only pads if the span in too short.", :type :var} {:name pcompose, :file "clj_commons/ansi.clj", :line 373, :arglists ([& inputs]), :added "2.2", :doc "Composes its inputs as with [[compose]] and then prints the results, with a newline.\n", :type :var} {:name perr, :file "clj_commons/ansi.clj", :line 379, :arglists ([& inputs]), :added "2.3.0", :doc "Composes its inputs as with [[compose]] and then prints the result with a newline to `*err*`.\n", :type :var} {:name when-color-enabled, :file "clj_commons/ansi.clj", :line 43, :arglists ([& body]), :doc "Evaluates its body only when [[*color-enabled*]] is true.\n", :type :macro}), :doc "Help with generating textual output that includes ANSI escape codes for formatting.\nThe [[compose]] function is the best starting point.\n\nReference: [ANSI Escape Codes @ Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR)."} {:name clj-commons.format.binary, :publics ({:name *fonts*, :file "clj_commons/format/binary.clj", :line 7, :dynamic true, :doc "Mapping from byte category to a font (color).\n", :type :var} {:name BinaryData, :file "clj_commons/format/binary.clj", :line 22, :doc "Allows various data sources to be treated as a byte-array data type that\nsupports a length and random access to individual bytes.\n\nBinaryData is extended onto byte arrays, java.nio.ByteBuffer, java.lang.String, java.lang.StringBuilder, and onto nil.", :type :protocol, :members ({:name byte-at, :arglists ([this index]), :doc "The byte value at a specific offset.\n", :type :var} {:name data-length, :arglists ([this]), :doc "The total number of bytes available.\n", :type :var})} {:name format-binary, :file "clj_commons/format/binary.clj", :line 171, :arglists ([data] [data options]), :doc "Formats the data using [[write-binary]] and returns the result as a string.\n", :type :var} {:name format-binary-delta, :file "clj_commons/format/binary.clj", :line 235, :arglists ([expected actual]), :doc "Formats the delta using [[print-binary-delta]] and returns the result as a string.\n", :type :var} {:name print-binary, :file "clj_commons/format/binary.clj", :line 131, :arglists ([data] [data options]), :doc "Formats a BinaryData into a hex-dump string, consisting of multiple lines; each line formatted as:\n\n 0000: 43 68 6F 6F 73 65 20 69 6D 6D 75 74 61 62 69 6C 69 74 79 2C 20 61 6E 64 20 73 65 65 20 77 68 65\n 0020: 72 65 20 74 68 61 74 20 74 61 6B 65 73 20 79 6F 75 2E\n\nThe full version specifies the [[BinaryData]] to write, and options:\n\n\nKey | Type | Description\n--- |--- |---\n:ascii | boolean | If true, enable ASCII mode\n:line-bytes | number | Bytes printed per line\n\n:line-bytes defaults to 16 for ASCII, and 32 otherwise.\n\nIn ASCII mode, the output is 16 bytes per line, but each line includes the ASCII printable characters:\n\n 0000: 43 68 6F 6F 73 65 20 69 6D 6D 75 74 61 62 69 6C |Choose immutabil|\n 0010: 69 74 79 2C 20 61 6E 64 20 73 65 65 20 77 68 65 |ity, and see whe|\n 0020: 72 65 20 74 68 61 74 20 74 61 6B 65 73 20 79 6F |re that takes yo|\n 0030: 75 2E |u. |\n\nWhen ANSI is enabled, the individual bytes and characters are color-coded as per the [[*fonts*]].", :type :var} {:name print-binary-delta, :file "clj_commons/format/binary.clj", :line 216, :arglists ([expected actual]), :doc "Formats a hex dump of the expected data (on the left) and actual data (on the right). Bytes\nthat do not match are highlighted in green on the expected side, and red on the actual side.\nWhen one side is shorter than the other, it is padded with `--` placeholders to make this\nmore clearly visible.\n\nexpected and actual are [[BinaryData]].\n\nDisplay 16 bytes (from each data set) per line.", :type :var}), :doc "Utilities for formatting binary data (byte arrays) or binary deltas.\n"} {:name clj-commons.format.exceptions, :publics ({:name *app-frame-names*, :file "clj_commons/format/exceptions.clj", :line 25, :dynamic true, :doc "Set of strings or regular expressions defining the application's namespaces, which allows\nsuch namespaces to be highlighted in exception output.", :type :var} {:name *default-frame-filter*, :file "clj_commons/format/exceptions.clj", :line 147, :arglists ([frame]), :dynamic true, :added "0.1.16", :doc "Default stack frame filter used when printing REPL exceptions, driven by [[*default-frame-rules*]].\n", :type :var} {:name *default-frame-rules*, :file "clj_commons/format/exceptions.clj", :line 106, :dynamic true, :added "0.1.18", :doc "The set of rules that forms the basis for [[*default-frame-filter*]], as a vector of vectors.\n\nEach rule is a vector of three values:\n\n* A function that extracts the value from the stack frame map (typically, this is a keyword such\nas :package or :name). The value is converted to a string.\n* A string or regexp used for matching. Strings must match exactly.\n* A resulting frame visibility (:hide, :omit, :terminate, or :show).\n\nThe default rules:\n\n* omit everything in `clojure.lang`, `java.lang.reflect`, and the function `clojure.core/apply`\n* hide everything in `sun.reflect`\n* terminate at `speclj.*`, `clojure.main/main*`, `clojure.main/repl/read-eval-print`, or `nrepl.middleware.interruptible-eval`\n", :type :var} {:name *fonts*, :file "clj_commons/format/exceptions.clj", :line 30, :dynamic true, :doc "Current set of fonts used in exception formatting. This can be overridden to change colors, or bound to nil\nto disable fonts. Defaults are defined by [[default-fonts]].", :type :var} {:name *print-length*, :file "clj_commons/format/exceptions.clj", :line 519, :dynamic true, :added "2.5.0", :doc "The number of elements of collections to pretty-print; defaults to 10.\n", :type :var} {:name *print-level*, :file "clj_commons/format/exceptions.clj", :line 525, :dynamic true, :added "2.5.0", :doc "The depth to which to pretty-printed nested collections; defaults to 5.\n", :type :var} {:name *traditional*, :file "clj_commons/format/exceptions.clj", :line 35, :dynamic true, :added "0.1.15", :doc "If bound to true, then exceptions will be formatted the traditional way - the same as Java exceptions\nwith the deepest stack frame first. By default, the stack trace is inverted, so that the deepest\nstack frames come last, mimicking chronological order.", :type :var} {:name analyze-exception, :file "clj_commons/format/exceptions.clj", :line 422, :arglists ([e options]), :doc "Converts an exception into a seq of maps representing nested exceptions.\nThe order reflects exception nesting; first exception is the most recently\nthrown, last is the deepest, or root, exception ... the initial exception\nthrown in a chain of nested exceptions.\n\nThe options map is as defined by [[format-exception]].\n\nEach exception map contains:\n\nKey | Type | Description\n--- |--- |---\n:class-name | String | Name of Java class for the exception\n:message | String | Value of the exception's message property (possibly nil)\n:properties | String | Map of properties to (optionally) present in the exception report\n:stack-trace | Vector | Stack trace element maps (as per [[expand-stack-trace]]), or nil; only present in the root exception\n\nThe :properties map does not include any properties that are assignable to type Throwable.\n\nThe first property that is assignable to type Throwable (not necessarily the rootCause property)\nwill be used as the nested exception (for the next map in the sequence).", :type :var} {:name default-fonts, :file "clj_commons/format/exceptions.clj", :line 13, :doc "A default map of [[compose]] font defs for different elements in the formatted exception report.\n", :type :var} {:name demangle, :file "clj_commons/format/exceptions.clj", :line 83, :arglists ([s]), :doc "De-mangle a Java name back to a Clojure name by converting mangled sequences, such as \"_QMARK_\"\nback into simple characters.", :type :var} {:name exception-dispatch, :file "clj_commons/format/exceptions.clj", :line 487, :doc "The pretty print dispatch function used when formatting exception output (specifically, when\nprinting the properties of an exception). Normally, this is the same as the simple-dispatch\n(in clojure.pprint) but can be extended for specific cases:\n\n (import com.stuartsierra.component.SystemMap)\n\n (defmethod exception-dispatch SystemMap [system-map] (print \"#\"))\n\nThis ensures that the SystemMap record, wherever it appears in the exception output,\nis represented as the string `#`; normally it would print as a deeply nested\ntree of maps.\n\nThis same approach can be adapted to any class or type whose structure is problematic\nfor presenting in the exception output, whether for size and complexity reasons, or due to\nsecurity concerns.", :type :multimethod} {:name expand-stack-trace, :file "clj_commons/format/exceptions.clj", :line 309, :arglists ([exception]), :doc "Extracts the stack trace for an exception and returns a seq of expanded stack frame maps:\n\nKey | Type | Description\n--- |--- |---\n:file | String | Source file name\n:line | Integer | Line number as integer, or nil\n:class | String | Fully qualified Java class name\n:package | String | Java package name, or nil for root package\n:simple-class | String | Simple name of Java class, without the package prefix\n:method | String | Java method name\n:is-clojure? | Boolean | If true, this represents a Clojure function call, rather than a Java method invocation\n:id | String | An id that can be used to identify repeating stack frames; consists of the fully qualified method name (for Java frames) or fully qualified Clojure name (for Clojure frames) appended with the line number.\n:name | String | Fully qualified Clojure name (demangled from the Java class name), or the empty string for non-Clojure stack frames\n:names | seq of String | Clojure name split at slashes (empty for non-Clojure stack frames)", :type :var} {:name format-exception, :file "clj_commons/format/exceptions.clj", :line 613, :arglists ([exception] [exception options]), :doc "Formats an exception, returning a single large string.\n\nBy default, includes the stack trace, with no frame limit.\n\nThe options map may have the following keys:\n\nKey | Description\n--- |---\n:filter | The stack frame filter, which defaults to [[*default-stack-frame-filter*]]\n:properties | If true (the default) then properties of exceptions will be output\n:frame-limit | If non-nil, the number of stack frames to keep when outputting the stack trace of the deepest exception\n\nOutput may be traditional or modern, as controlled by [[*traditional*]].\nTraditional is the typical output order for Java: the stack of exceptions comes first (outermost to\ninnermost) followed by the stack trace of the innermost exception, with the frames\nin order from deepest to most shallow.\n\nModern output is more readable; the stack trace comes first and is reversed: shallowest frame to most deep.\nThen the exception stack is output, from the root exception to the outermost exception.\nThe modern output order is more readable, as it puts the most useful information together at the bottom, so that\nit is not necessary to scroll back to see, for example, where the exception occurred.\n\nThe default is modern.\n\nThe stack frame filter is passed the map detailing each stack frame\nin the stack trace, and must return one of the following values:\n\nValue | Description\n--- |---\n:show | The normal state; display the stack frame\n:hide | Prevents the frame from being displayed, as if it never existed\n:omit | Replaces the frame with a \"...\" placeholder\n:terminate | Hides the frame AND all later frames\n\nMultiple consecutive :omits will be collapsed to a single line; use :omit for \"uninteresting\" stack frames.\n\nThe default filter is [[*default-frame-filter*]]. An explicit filter of nil will display all stack frames.\n\nRepeating lines are collapsed to a single line, with a repeat count. Typically, this is the result of\nan endless loop that terminates with a StackOverflowException.\n\nWhen set, the frame limit is the number of stack frames to display; if non-nil, then some outermost\nstack frames may be omitted. It may be set to 0 to omit the stack trace entirely (but still display\nthe exception stack). The frame limit is applied after the frame filter (which may hide or omit frames) and\nafter repeating stack frames have been identified and coalesced ... :frame-limit is really the number\nof _output_ lines to present.\n\nProperties of exceptions will be output using Clojure's pretty-printer, but using\nthis namespace's versions of [[*print-length*]] and [[*print-level*]], which default to\n10 and 2, respectively.\n\nThe `*fonts*` var contains a map from output element names (as :exception or :clojure-frame) to\na font def used with [[compose]]; this allows easy customization of the output.", :type :var} {:name format-exception*, :file "clj_commons/format/exceptions.clj", :line 605, :arglists ([exception-stack options]), :added "0.1.21", :doc "Contains the main logic for [[format-exception]], which simply expands\nthe exception (via [[analyze-exception]]) before invoking this function.", :type :var} {:name parse-exception, :file "clj_commons/format/exceptions.clj", :line 729, :arglists ([exception-text options]), :added "0.1.21", :doc "Given a chunk of text from an exception report (as with `.printStackTrace`), attempts to\npiece together the same information provided by [[analyze-exception]]. The result\nis ready to pass to [[write-exception*]].\n\nThis code does not attempt to recreate properties associated with the exceptions; in most\nexception's cases, this is not necessarily written to the output. For clojure.lang.ExceptionInfo,\nit is hard to distinguish the message text from the printed exception map.\n\nThe options are used when processing the stack trace and may include the :filter and :frame-limit keys.\n\nReturns a sequence of exception maps; the final map will include the :stack-trace key (a vector\nof stack trace element maps). The exception maps are ordered outermost to innermost (that final map\nis the root exception).\n\nThis should be considered experimental code; there are many cases where it may not work properly.\n\nIt will work quite poorly with exceptions whose message incorporates a nested exception's\n.printStackTrace output. This happens too often with JDBC exceptions, for example.", :type :var} {:name print-exception, :file "clj_commons/format/exceptions.clj", :line 672, :arglists ([exception] [exception options]), :doc "Formats an exception via [[format-exception]], then prints it to `*out*`. Accepts the same options as `format-exception`.\n", :type :var}), :doc "Format and output exceptions in a pretty (structured, formatted) way.\n"} {:added "2.3", :name clj-commons.format.table, :publics ({:name default-style, :file "clj_commons/format/table.clj", :line 62, :doc "Default style, with thick borders (using character graphics) and a header and footer.\n", :type :var} {:name print-table, :file "clj_commons/format/table.clj", :line 92, :arglists ([opts rows]), :doc "Similar to clojure.pprint/print-table, but with fancier graphics and more control\nover column titles.\n\nThe rows are a seq of associative values, usually maps.\n\nIn simple mode, each column is just a keyword; the column title is derived\nfrom the keyword, and the column's width is set to the maximum\nof the title width and the width of the longest value in the rows.\n\nAlternately, a column can be a map:\n\nKey | Type | Description\n--- |--- |---\n:key | keyword/function | Passed the row data and returns the value for the column (required)\n:title | String | The title for the column\n:title-pad | :left, :right, :both | How to pad the title column; default is :both to center the title\n:width | number | Width of the column\n:decorator | function | May return a font keyword for the cell\n:pad | :left, :right, :both | Defaults to :left except for last column\n\n:key is typically a keyword but can be an arbitrary function\n(in which case, you must also provide :title). The return\nvalue is a composed string (passed to [[compose]]); if returning a composed string,\nyou must also provide an explicit :width.\n\nThe default for :title is deduced from :key; when omitted and :key is a keyword;\nthe keyword is converted to a string, capitalized, and embedded dashes\nconverted to spaces.\n\n:width will be determined as the maximum width of the title or of any\nvalue in the data.\n\nThe decorator is a function; it will be\npassed the row index and the value for the column,\nand returns a font keyword (or nil).\n\nopts can be a seq of columns, or it can be a map of options:\n\nKey | Type | Description\n--- |--- |---\n:columns | seq of columns | Describes the columns to print\n:style | map | Overrides the default styling of the table\n:default-decorator | function | Used when a column doesn't define it own decorator\n:row-annotator | function | Can add text immediately after the end of the row\n\n:default-decorator is only used for columns that do not define their own\ndecorator. This can be used, for example, to alternate the background color\nof cells.\n\nThe :row-annotator is passed the row index and the row data,\nand returns a composed string that is appended immediately after\nthe end of the row (but outside any border), which can be used to\nadd a note to the right of a row.", :type :var} {:name skinny-style, :file "clj_commons/format/table.clj", :line 80, :doc "Removes most of the borders and uses simple characters for column separators.\n", :type :var}), :doc "Formatted tabular output, similar to (but much prettier and more flexible than)\n clojure.pprint/print-table.\n\nSpecs are in [[clj-commons.format.table.specs]]."} {:name clj-commons.format.table.specs, :publics ()} {:name clj-commons.pretty.repl, :publics ({:name -main, :file "clj_commons/pretty/repl.clj", :line 82, :arglists ([& args]), :added "1.3.0", :doc "Installs pretty exceptions, then delegates to clojure.main/main.\n", :type :var} {:name install-pretty-exceptions, :file "clj_commons/pretty/repl.clj", :line 52, :arglists ([]), :doc "Installs an override that outputs pretty exceptions when caught by the main REPL loop. Also, overrides\n`clojure.repl/pst`, `clojure.stacktrace/print-stack-trace`, `clojure.stacktrace/print-cause-trace`.\n\nExtends `clojure.core/print-method` for type Throwable to print a blank line followed by the\nformatted exception. This allows an expression that evaluates to an exception to be printed prettily,\nbut more importantly, ensures that in `clojure.test/is` a failed `thrown-with-msg?` assertion\nprints a formatted exception.\n\nFinally, installs an [[uncaught-exception-handler]] so that uncaught exceptions in non-REPL threads\nwill be printed reasonably.\n\nCaught exceptions do not print the stack trace; the pretty replacement for `pst` does.", :type :var} {:name pretty-print-stack-trace, :file "clj_commons/pretty/repl.clj", :line 45, :arglists ([tr] [tr n]), :doc "Replacement for `clojure.stacktrace/print-stack-trace` and `print-cause-trace`. These functions are used by `clojure.test`.\n", :type :var} {:name pretty-pst, :file "clj_commons/pretty/repl.clj", :line 33, :arglists ([] [e-or-depth] [e depth]), :doc "Used as an override of `clojure.repl/pst` but uses pretty formatting. Output is written to `*err*`.\n", :type :var} {:name pretty-repl-caught, :file "clj_commons/pretty/repl.clj", :line 14, :arglists ([e]), :doc "A replacement for `clojure.main/repl-caught` that prints the exception to `*err*`, without a stack trace or properties.\n", :type :var} {:name uncaught-exception-handler, :file "clj_commons/pretty/repl.clj", :line 20, :arglists ([]), :added "0.1.18", :doc "Returns a reified UncaughtExceptionHandler that prints the formatted exception to `*err*`.\n", :type :var}), :doc "Utilities to assist with REPL-oriented development.\n"} {:deprecated "2.5.0", :added "2.5.0", :name io.aviso.exception, :publics ({:name *default-frame-rules*, :file "io/aviso/exception.clj", :line 25, :dynamic true, :doc "This is provided only to prevent source compilation failures; changing this value does not affect\nhow the clj-commons.format.exceptions namespace operates.", :type :var} {:name *fonts*, :file "io/aviso/exception.clj", :line 30, :dynamic true, :doc "This is provided only to prevent source compilation failures; changing this value does not affect\nhow the clj-commons.format.exceptions namespace operates.", :type :var} {:name demangle, :file "io/aviso/exception.clj", :line 9, :arglists ([s]), :type :var} {:name format-exception, :file "io/aviso/exception.clj", :line 13, :arglists ([exception] [exception options]), :type :var} {:name write-exception, :file "io/aviso/exception.clj", :line 19, :arglists ([exception] [exception options]), :type :var}), :doc "A shim in org.clj-commons/pretty to emulate a few key functions from io.aviso/pretty.\n\nThis namespace may be deleted in a future release."} {:deprecated "2.5.0", :added "2.5.0", :name io.aviso.repl, :publics ({:name install-pretty-exceptions, :file "io/aviso/repl.clj", :line 9, :arglists ([]), :type :var} {:name uncaught-exception-handler, :file "io/aviso/repl.clj", :line 13, :arglists ([]), :type :var}), :doc "A shim in org.clj-commons/pretty to emulate a few key functions from io.aviso/pretty.\n\nThis namespace may be deleted in a future release."})}, :pom-str "\n\n 4.0.0\n jar\n org.clj-commons\n pretty\n 2.6.0\n pretty\n \n \n org.clojure\n clojure\n 1.11.2\n \n \n \n src\n \n \n resources\n \n \n \n \n \n clojars\n https://repo.clojars.org/\n \n \n \n 2.6.0\n https://github.com/clj-commons/pretty\n \n \n \n Apache License, Version 2.0\n https://www.apache.org/licenses/LICENSE-2.0.html\n \n \n\n"}