Skip to content

Commit 16e0c64

Browse files
committed
docs: add toc, logo
1 parent 337a95c commit 16e0c64

File tree

7 files changed

+73
-2
lines changed

7 files changed

+73
-2
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.png filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ coverage.txt
88
coverage.html
99
coverage.xml
1010
dist
11+
12+
third_party

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,10 @@ repos:
4040
args: [run, fmt]
4141
language: system
4242
pass_filenames: false
43+
- id: autotoc
44+
name: generate toc
45+
entry: mise
46+
args: [run, autotoc]
47+
language: system
48+
files: ^README\.md$
49+
pass_filenames: false

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,42 @@
1-
# Teastraw
1+
<img src="./assets/teastraw.png" width="90" style="margin-right:10px" align=left alt="teastraw logo">
2+
<H1>Teastraw</H1><br>
3+
4+
5+
![License](https://img.shields.io/github/license/fiffeek/teastraw.svg?style=flat)
6+
![Code Size](https://img.shields.io/github/languages/code-size/fiffeek/teastraw.svg?style=flat)
7+
![Go Version](https://img.shields.io/github/go-mod/go-version/fiffeek/teastraw?style=flat)
8+
![Go Report Card](https://goreportcard.com/badge/github.com/fiffeek/teastraw)
9+
![Build](https://img.shields.io/github/actions/workflow/status/fiffeek/teastraw/test.yaml?branch=main&style=flat)
10+
211

312
A Go package for end-to-end testing of Terminal User Interface (TUI) applications.
413

14+
## Table of Contents
15+
16+
<!--ts-->
17+
* [Teastraw](#teastraw)
18+
* [Table of Contents](#table-of-contents)
19+
* [Overview](#overview)
20+
* [Installation](#installation)
21+
* [Quick Start](#quick-start)
22+
* [Key Features](#key-features)
23+
* [Screen Validation](#screen-validation)
24+
* [Waiting for Conditions](#waiting-for-conditions)
25+
* [Input Simulation](#input-simulation)
26+
* [Graceful Shutdown](#graceful-shutdown)
27+
* [Configuration Options](#configuration-options)
28+
* [Terminal Size](#terminal-size)
29+
* [Exit Sequences](#exit-sequences)
30+
* [Testing Patterns](#testing-patterns)
31+
* [Golden File Testing](#golden-file-testing)
32+
* [Time-based Testing](#time-based-testing)
33+
* [Examples](#examples)
34+
* [Comparison to Teatest](#comparison-to-teatest)
35+
* [Contributing](#contributing)
36+
* [License](#license)
37+
* [Credits](#credits)
38+
<!--te-->
39+
540
## Overview
641

742
`Teastraw` provides a test runner that can interact with TUI applications by:
@@ -171,8 +206,8 @@ runner, err := exp.NewTestRunner(
171206
exp.WithCommand(cmd),
172207
)
173208

174-
[A few common ones](https://github.com/fiffeek/teastraw/blob/main/pkg/exp/const.go#L3) are passed by default, you can also refer to them in your code.
175209
```
210+
[A few common ones](https://github.com/fiffeek/teastraw/blob/main/pkg/exp/const.go#L3) are passed by default, you can also refer to them in your code.
176211

177212
## Testing Patterns
178213

assets/teastraw.png

Lines changed: 3 additions & 0 deletions
Loading

mise.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ description = "Install golang dependencies"
3838
run = "go mod download all"
3939
sources = ["go.mod", "go.sum"]
4040

41+
[tasks."install:autotoc"]
42+
description = "Install auto toc script"
43+
run = [
44+
"mkdir -p ./third_party",
45+
"wget -q https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc",
46+
"chmod 755 gh-md-toc",
47+
"mv gh-md-toc ./third_party/",
48+
"./third_party/gh-md-toc --help >/dev/null 2>&1",
49+
]
50+
51+
[tasks."autotoc"]
52+
description = "Generate TOC for README.md"
53+
run = ["./scripts/autotoc"]
54+
sources = ["README.md"]
55+
4156
[tasks."install"]
4257
depends = ["install:*"]
4358
run = ["python -m pre_commit install --install-hooks"]

scripts/autotoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
6+
README="README.md"
7+
8+
"${SCRIPT_DIR}/../third_party/gh-md-toc" --no-backup --hide-footer "$README"

0 commit comments

Comments
 (0)