*doc-width* (keyword)
*doc-width* is bound to the keyword :doc-width—it can be used in place of
:doc-width in a call to dyn, setdyn, or with-dyns and is preferable
to using the keyword directly. When set to a number, it indicates the maximum
width (in columns) of a row of text returned by doc-format.
repl> (root-env '*doc-width*)
@{:doc "Width in columns to print documentation printed with `doc-format`."
:dyn true
:source-map ("boot.janet" 3236 1)
:value :doc-width}
Things I Learned
- Like
*doc-color*,*doc-width*is used to adjust the output ofdoc-format. - When the
:doc-widthdynamic binding is not set, the default width is 80. - By default,
doc-formatadds 4 space indentation and subtracts 8 from the value of:doc-widthto calculate a max width.