Skip to content

Commit f82fbdc

Browse files
author
Thomaz Leite
committed
Add default color options for ANSIDocs
1 parent c6817c8 commit f82fbdc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/iex/lib/iex/ansi_docs.ex

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@ defmodule IEx.ANSIDocs do
33

44
@bullets [?*, ?-, ?+]
55

6+
@default_colors [ enabled: true,
7+
doc_code: "cyan,bright",
8+
doc_inline_code: "cyan",
9+
doc_headings: "yellow,bright",
10+
doc_title: "reverse,yellow,bright",
11+
doc_bold: "bright",
12+
doc_underline: "underline" ]
13+
614
@doc """
715
Prints the head of the documentation (i.e. the function signature)
816
"""
9-
def print_heading(string, use_ansi // IO.ANSI.terminal?, colors // []) do
17+
def print_heading(string, use_ansi // IO.ANSI.terminal?, colors // @default_colors) do
1018
if use_ansi do
1119
write_doc_heading(string, colors)
1220
else
@@ -26,7 +34,7 @@ defmodule IEx.ANSIDocs do
2634
@doc """
2735
Prints the documentation body.
2836
"""
29-
def print(doc, use_ansi // IO.ANSI.terminal?, colors // []) do
37+
def print(doc, use_ansi // IO.ANSI.terminal?, colors // @default_colors) do
3038
if use_ansi do
3139
doc
3240
|> String.split(["\r\n","\n"], trim: false)

0 commit comments

Comments
 (0)