Skip to content

Commit 344c46f

Browse files
committed
docs: Update README and examples/README to latest API and English
- Simplified the main README examples section ("See the examples directory for more") - Updated examples/README.md to English, reflecting all current examples and new features (VerticalBarStyle, AutoAlign(false), etc.) - Improved documentation consistency and maintainability
1 parent 49c2975 commit 344c46f

File tree

2 files changed

+35
-89
lines changed

2 files changed

+35
-89
lines changed

README.md

Lines changed: 4 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
## Features
1111

1212
- **Two rendering modes**: Flexible display with BufferedMode and StreamingMode
13-
- **Multiple border styles**: Choose from Box Drawing, ASCII, Rounded, Double, and Minimal
13+
- **Multiple border styles**: Choose from Box Drawing, ASCII, Rounded, Double, Minimal, and VerticalBar (only vertical | separators)
1414
- **Automatic width calculation**: Automatic column width adjustment and alignment
1515
- **Unicode support**: Proper handling of multibyte characters, combining characters, emojis, and East Asian text
1616
- **Interface design**: Extensible renderer architecture
@@ -27,37 +27,6 @@ go get github.com/noborus/termhyo
2727

2828
- Go 1.23 or later
2929

30-
## File Structure
31-
32-
```tree
33-
termhyo/
34-
├── termhyo.go # Package documentation and main entry point
35-
├── table.go # Table struct and main logic
36-
├── column.go # Column, Cell, Row definitions
37-
├── borders.go # Border style definitions
38-
├── renderer.go # Renderer interface and implementation
39-
├── markdown.go # Markdown table renderer
40-
├── header_styles.go # Header styling with ANSI escape sequences
41-
├── width.go # String width calculation utilities
42-
└── examples/ # Runnable example programs
43-
├── basic/ # Basic table example
44-
│ └── main.go
45-
├── header_styles/ # Header styling demonstration
46-
│ └── main.go
47-
├── streaming/ # Streaming mode example
48-
│ └── main.go
49-
├── japanese/ # Japanese text example
50-
│ └── main.go
51-
├── unicode/ # Unicode and emoji example
52-
│ └── main.go
53-
├── combining/ # Combining characters example
54-
│ └── main.go
55-
├── markdown/ # Markdown table format example
56-
│ └── main.go
57-
└── custom_borders/ # Custom border configuration example
58-
└── main.go
59-
```
60-
6130
## Basic Usage
6231

6332
### Simple Table
@@ -141,34 +110,8 @@ table := termhyo.NewTable(os.Stdout, columns, termhyo.BorderConfig(customConfig)
141110

142111
## Running Examples
143112

144-
You can run the example programs to see termhyo in action:
145-
146-
```bash
147-
# Basic table example
148-
cd examples
149-
go run basic.go
150-
151-
# Different border styles
152-
go run styles.go
153-
154-
# Streaming mode demonstration
155-
go run streaming.go
156-
157-
# Japanese text handling
158-
go run japanese.go
159-
160-
# Unicode and emoji support
161-
go run unicode.go
162-
163-
# Combining characters and complex Unicode
164-
go run combining.go
165-
166-
# Markdown table format
167-
go run markdown.go
168-
169-
# Custom border configurations
170-
go run custom_borders.go
171-
```
113+
You can run various example programs to see termhyo in action.
114+
See the [examples](./examples) directory for more.
172115

173116
## Rendering Modes
174117

@@ -191,6 +134,7 @@ go run custom_borders.go
191134
- `RoundedStyle`: Rounded corner style
192135
- `DoubleStyle`: Double line style
193136
- `MinimalStyle`: Minimal border
137+
- `VerticalBarStyle`: Only vertical bar separators (|), no outer borders
194138
- `MarkdownStyle`: Markdown table format
195139
- `TSVStyle`: Tab-separated values format
196140

examples/README.md

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,91 @@
11
# termhyo Examples
22

3-
This directory contains various examples demonstrating the features of termhyo.
3+
This directory contains various examples demonstrating the features and flexibility of termhyo.
44

55
## Running Examples
66

7-
Each example is in its own directory with a `main.go` file. You can run them in two ways:
7+
Each example is in its own directory with a `main.go` file. You can run them as follows:
88

99
### Method 1: Direct execution
10+
1011
```bash
1112
cd basic
1213
go run main.go
1314
```
1415

1516
### Method 2: Build then run
17+
1618
```bash
1719
cd basic
1820
go build -o basic .
1921
./basic
2022
```
2123

2224
### Method 3: Using Makefile (from project root)
25+
2326
```bash
2427
make examples # Build all examples
2528
```
2629

27-
## Available Examples
30+
## Example List
2831

2932
### [basic/](basic/)
30-
Basic table creation and rendering. Good starting point.
3133

32-
**Features:** Column definition, data addition, basic rendering
34+
Basic table creation and rendering. The best starting point for learning termhyo.
35+
36+
### [autoalign_false/](autoalign_false/)
37+
38+
Demonstrates `AutoAlign(false)` and `VerticalBarStyle`. Disables global auto-alignment and uses only vertical separators for a minimal look.
3339

3440
### [header_styles/](header_styles/)
35-
Advanced header styling with ANSI escape sequences.
3641

37-
**Features:** Colors, text formatting, border control, convenience methods
42+
Advanced header styling with ANSI colors, text decorations, border control, and convenience methods.
3843

3944
### [header_full_line/](header_full_line/)
40-
Full-line header styling examples.
4145

42-
**Features:** Complete line styling, background colors, visual distinction
46+
Applies color and decoration to the entire header line.
4347

4448
### [streaming/](streaming/)
45-
Streaming mode for large datasets with fixed-width columns.
4649

47-
**Features:** Memory-efficient rendering, fixed-width columns
50+
Streaming rendering for large datasets with fixed-width columns. Memory efficient output.
4851

4952
### [japanese/](japanese/)
50-
Japanese text handling and proper width calculation.
5153

52-
**Features:** Multi-byte characters, proper alignment, Unicode support
54+
Proper width calculation and alignment for Japanese (multibyte) text.
5355

5456
### [unicode/](unicode/)
55-
Unicode character support including emojis and special characters.
5657

57-
**Features:** Emoji, combining characters, various Unicode blocks
58+
Display of various Unicode characters, including emoji and special symbols.
5859

5960
### [combining/](combining/)
60-
Combining character handling and width calculation.
6161

62-
**Features:** Diacritics, combining marks, proper display width
62+
Handling and width calculation for combining characters (diacritics, etc).
6363

6464
### [markdown/](markdown/)
65-
Markdown table format output.
6665

67-
**Features:** Markdown syntax, alignment indicators, header styling
66+
Table output in Markdown format.
6867

6968
### [custom_borders/](custom_borders/)
70-
Custom border configuration and styling.
7169

72-
**Features:** Border customization, selective border removal
70+
Custom border configuration. Flexible control, such as only internal separators or no borders at all.
7371

7472
### [styles/](styles/)
75-
Different border styles demonstration.
7673

77-
**Features:** Box drawing, ASCII, rounded borders
74+
Comparison of border styles (BoxDrawing, ASCII, Rounded, Double, Minimal, VerticalBar, etc).
7875

7976
## Learning Path
8077

81-
1. **Start with [basic/](basic/)** - Learn fundamental concepts
82-
2. **Try [header_styles/](header_styles/)** - Understand styling options
83-
3. **Explore [unicode/](unicode/) and [japanese/](japanese/)** - Character handling
84-
4. **Check [streaming/](streaming/)** - Performance considerations
85-
5. **Review [markdown/](markdown/)** - Alternative output formats
86-
6. **Experiment with [custom_borders/](custom_borders/)** - Advanced customization
78+
1. **Start with [basic/](basic/)** - Learn the fundamentals
79+
1. **Try [styles/](styles/) and [custom_borders/](custom_borders/)** - Explore border styles and customization
80+
1. **Explore [header_styles/](header_styles/) and [header_full_line/](header_full_line/)** - Learn about header decoration and coloring
81+
1. **Check [autoalign_false/](autoalign_false/)** - See minimal tables and alignment control
82+
1. **Review [japanese/](japanese/), [unicode/](unicode/), and [combining/](combining/)** - Understand multilingual and Unicode support
83+
1. **Experiment with [markdown/](markdown/) and [streaming/](streaming/)** - Use Markdown output and streaming rendering
84+
1. **Try [header_styles/](header_styles/)** - Understand styling options
85+
1. **Explore [unicode/](unicode/) and [japanese/](japanese/)** - Character handling
86+
1. **Check [streaming/](streaming/)** - Performance considerations
87+
1. **Review [markdown/](markdown/)** - Alternative output formats
88+
1. **Experiment with [custom_borders/](custom_borders/)** - Advanced customization
8789

8890
## Building All Examples
8991

0 commit comments

Comments
 (0)