-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathillustration.rb
59 lines (49 loc) · 1.6 KB
/
illustration.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# frozen_string_literal: true
require_relative '../lib/natty-ui'
ui.space
ui.table(type: :undecorated) do |table|
table.add(
'Styles',
"Support of all ANSI styles like #{
%w[
bold
italic
underline
invert
strike
faint
double_underline
curly_underline
dotted_underline
dashed_underline
blink
].map { "[#{_1}]#{_1.tr('_', ' ')}[/]" }.join(', ')
}, and even rarely supported like [fraktur]fraktur[/fraktur]."
)
table.add('Colors', <<~TEXT)
✓ [green]3/4-bit color[/] ✓ [ff7f50]Truecolor (16.7 million)
✓ [1b]8-bit color[/] ✓ [bright_yellow]Dumb terminals
✓ [bright_blue]NO_COLOR convention
TEXT
table.add(
'Markup',
'[0c]You can style your text using a [i]BBCode[/i]-like syntax.'
)
table.add('Layout', <<~TEXT)
🎩 heading elements 📏 horizontal rulers
📝 messages [yellow]🄵[/] framed blocks
[blue]┼┼[/] tables
TEXT
table.add('Tools', <<~TEXT)
✅ tasks [bold green]…[/] progress bars
[bold bright_white]>[bright_red]_[/] user input 🔦 text animation
TEXT
table.add("Asian\nlanguage\nsupport", <<~TEXT)
[0a]🇨🇳 该库支持中文,日文和韩文文本!
[0a]🇯🇵 ライブラリは中国語、日本語、韓国語のテキストをサポートしています
[0a]🇰🇷 이 라이브러리는 중국어, 일본어 및 한국어 텍스트를 지원합니다
TEXT
table.align_column(0, :center)
table.style_column(0, :red)
end
ui.space