Skip to content

Commit 2986ef2

Browse files
authored
Update README formatting
1 parent 5145bbc commit 2986ef2

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

README.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,26 @@ Dev UI is a small framework who's only responsibility is to print pretty to the
77
- [Documentation of the Rubygems version](http://www.rubydoc.info/gems/dev-ui/)
88
- [Rubygems](https://rubygems.org/gems/dev-ui)
99

10+
## Installation
11+
12+
```bash
13+
gem install dev-ui
14+
```
15+
16+
or add the following to your Gemfile:
17+
18+
```ruby
19+
gem 'dev-ui'
20+
```
21+
22+
In your code, simply add a `require 'dev/ui'`. Most options assume `Dev::UI::StdoutRouter.enable` has been called.
23+
1024
## Features
1125

1226
This may not be an exhaustive list. Please check our [documentation](http://www.rubydoc.info/github/Shopify/dev-ui/master/Dev/UI) for more information.
1327

28+
---
29+
1430
### Nested framing
1531
To handle content flow (see example below)
1632

@@ -24,6 +40,8 @@ end
2440

2541
![Nested Framing](https://user-images.githubusercontent.com/3074765/33799861-cb5dcb5c-dd01-11e7-977e-6fad38cee08c.png)
2642

43+
---
44+
2745
### Interactive Prompts
2846
Prompt user with options and ask them to choose. Can answer using arrow keys, numbers, or vim bindings (or y/n for yes/no questions)
2947

@@ -34,6 +52,8 @@ Dev::UI::InteractivePrompt.call(%w(rails go ruby python))
3452

3553
![Interactive Prompt](https://user-images.githubusercontent.com/3074765/33797984-0ebb5e64-dcdf-11e7-9e7e-7204f279cece.gif)
3654

55+
---
56+
3757
### Free form text prompts
3858

3959
```ruby
@@ -42,10 +62,11 @@ Dev::UI.ask('Is Dev UI Awesome?', default: 'It is great!')
4262

4363
![Free form text prompt](https://user-images.githubusercontent.com/3074765/33799822-47f23302-dd01-11e7-82f3-9072a5a5f611.png)
4464

65+
---
66+
4567
### Spinner groups
4668
Handle many multi-threaded processes while suppressing output unless there is an issue. Can update title to show state.
4769

48-
4970
```ruby
5071
spin_group = Dev::UI::SpinGroup.new
5172
spin_group.add('Title') { |spinner| sleep 3.0 }
@@ -55,14 +76,18 @@ spin_group.wait
5576

5677
![Spinner Group](https://user-images.githubusercontent.com/3074765/33798295-d94fd822-dce3-11e7-819b-43e5502d490e.gif)
5778

79+
---
80+
5881
### Text Color formatting
5982
e.g. `{{red:Red}} {{green:Green}}`
6083

6184
```ruby
6285
puts Dev::UI.fmt "{{red:Red}} {{green:Green}}"
6386
```
6487

65-
![Text Format](https://user-images.githubusercontent.com/3074765/33799827-6d0721a2-dd01-11e7-9ab5-c3d455264afe.png)
88+
![Text Format](https://user-images.githubusercontent.com/3074765/33799827-6d0721a2-dd01-11e7-9ab5-c3d455264afe.png)
89+
90+
---
6691

6792
### Symbol/Glyph Formatting
6893
e.g. `{{*}}` => a yellow ⭑
@@ -73,6 +98,8 @@ puts Dev::UI.fmt "{{*}} {{x}} {{?}} {{v}}"
7398

7499
![Symbol Formatting](https://user-images.githubusercontent.com/3074765/33799847-9ec03fd0-dd01-11e7-93f7-5f5cc540e61e.png)
75100

101+
---
102+
76103
### Progress Bar
77104

78105
Show progress of a process or operation.
@@ -87,19 +114,7 @@ end
87114

88115
![Progress Bar](https://user-images.githubusercontent.com/3074765/33799794-cc4c940e-dd00-11e7-9bdc-90f77ec9167c.gif)
89116

90-
## Installation
91-
92-
```bash
93-
gem install dev-ui
94-
```
95-
96-
or add the following to your Gemfile:
97-
98-
```ruby
99-
gem 'dev-ui'
100-
```
101-
102-
In your code, simply add a `require 'dev/ui'`. Most options assume `Dev::UI::StdoutRouter.enable` has been called.
117+
---
103118

104119
## Example Usage
105120

0 commit comments

Comments
 (0)