Skip to content

Commit 9a3809a

Browse files
authored
readme: clean up and add ToC
1 parent 1197227 commit 9a3809a

File tree

1 file changed

+42
-18
lines changed

1 file changed

+42
-18
lines changed

README.md

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ You can use gitter to ask questions and discuss ideas about this project.
1515

1616
[![Gitter chat](https://badges.gitter.im/csgodemos/demoinfo-lib.png)](https://gitter.im/csgodemos/demoinfo-lib)
1717

18-
## Requirements
19-
20-
This library should be used with `go 1.11` or higher as it is built using Go modules.
21-
22-
It's recommended to use modules for consumers as well if possible.
23-
If you are unfamiliar with Go modules there's a [list of recommended resources](https://github.com/markus-wa/demoinfocs-golang/wiki/Go-Modules#recommended-links--articles) in the wiki.
24-
2518
## Go Get
2619

2720
go get -u github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs
@@ -32,7 +25,34 @@ If you are currently using version 1.x of this library, check out [this wiki pag
3225

3326
The old code is also still available in the [`v1` branch](https://github.com/markus-wa/demoinfocs-golang/tree/v1) if you need it.
3427

35-
## Getting started
28+
## Table of Contents
29+
30+
- [Requirements](https://github.com/markus-wa/demoinfocs-golang#requirements)
31+
- [Getting Started](https://github.com/markus-wa/demoinfocs-golang#getting-started)
32+
- [Example](https://github.com/markus-wa/demoinfocs-golang#example)
33+
- [More Examples](https://github.com/markus-wa/demoinfocs-golang#more-examples)
34+
- [Documentation](https://github.com/markus-wa/demoinfocs-golang#documentation)
35+
- [Features](https://github.com/markus-wa/demoinfocs-golang#features)
36+
- [Performance / Benchmarks](https://github.com/markus-wa/demoinfocs-golang#performance--benchmarks)
37+
- [Versioning](https://github.com/markus-wa/demoinfocs-golang#versioning)
38+
- [Projects Using demoinfocs-golang](https://github.com/markus-wa/demoinfocs-golang#projects-using-demoinfocs-golang)
39+
- [Development](https://github.com/markus-wa/demoinfocs-golang#development)
40+
- [Debugging](https://github.com/markus-wa/demoinfocs-golang#debugging)
41+
- [Testing](https://github.com/markus-wa/demoinfocs-golang#testing)
42+
- [Generating Interfaces](https://github.com/markus-wa/demoinfocs-golang#generating-interfaces)
43+
- [Generating Protobuf Code](https://github.com/markus-wa/demoinfocs-golang#generating-protobuf-code)
44+
- [Git Hooks](https://github.com/markus-wa/demoinfocs-golang#git-hooks)
45+
- [Acknowledgements](https://github.com/markus-wa/demoinfocs-golang#acknowledgements)
46+
- [License](https://github.com/markus-wa/demoinfocs-golang#license) (MIT)
47+
48+
## Requirements
49+
50+
This library should be used with `go 1.11` or higher as it is built using Go modules.
51+
52+
It's recommended to use modules for consumers as well if possible.
53+
If you are unfamiliar with Go modules there's a [list of recommended resources](https://github.com/markus-wa/demoinfocs-golang/wiki/Go-Modules#recommended-links--articles) in the wiki.
54+
55+
## Getting Started
3656

3757
1. Download and install Go 1.11 or newer [from golang.org](https://golang.org/dl/) or via your favourite package manager
3858

@@ -102,7 +122,7 @@ func main() {
102122
}
103123
```
104124

105-
### Sample output
125+
#### Sample Output
106126

107127
Running the code above will print something like this:
108128

@@ -117,12 +137,16 @@ keev <AWP (HS) (WB)> to1nou
117137
...
118138
```
119139

120-
### More examples
140+
### More Examples
121141

122142
Check out the [examples](examples) folder for more examples, like [how to generate heatmaps](examples/heatmap) like this one:
123143

124144
<img alt="sample heatmap" src="https://raw.githubusercontent.com/markus-wa/demoinfocs-golang/master/examples/heatmap/heatmap.jpg" width="50%">
125145

146+
### Documentation
147+
148+
The full API documentation is available here on [pkg.go.dev](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs).
149+
126150
## Features
127151

128152
* Game events (kills, shots, round starts/ends, footsteps etc.) - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events?tab=doc) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/print-events)
@@ -156,7 +180,7 @@ Here are some benchmark results from a system with an Intel i7 6700k CPU and a S
156180

157181
*That's almost 1.5 hours of gameplay per second when parsing in parallel (recorded at 64 ticks per second) - or 25 minues per second when only parsing a single demo at a time.*
158182

159-
### Raw output
183+
### Raw Output
160184

161185
```
162186
$ go test -run _NONE_ -bench . -benchtime 30s -benchmem -concurrentdemos 8
@@ -178,7 +202,7 @@ ok github.com/markus-wa/demoinfocs-golang 134.244s
178202
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/markus-wa/demoinfocs-golang/tags).
179203
There is one caveat however: Beta features - which are marked as such via comments and in release notes - may change in minor releases.
180204

181-
## Projects using demoinfocs-golang
205+
## Projects Using demoinfocs-golang
182206

183207
- [noesis.gg](https://www.noesis.gg/) - A suite of explorative tools to help you analyze and improve your CS:GO performance
184208
- [esportal.se](https://beta.esportal.se/) - An alternative Matchmaking service that aims to provide a friendly environment free from trolls and misbehaving individuals
@@ -195,7 +219,7 @@ If your project is using this library feel free to submit a PR or send a message
195219

196220
## Development
197221

198-
### Git hooks
222+
### Git Hooks
199223

200224
To install some (optional, but quite handy) `pre-commit` and `pre-push` hooks, you can run the following script.
201225

@@ -211,7 +235,7 @@ To install some (optional, but quite handy) `pre-commit` and `pre-push` hooks, y
211235

212236
### Testing
213237

214-
#### Unit tests
238+
#### Unit Tests
215239

216240
For any new features, [Test Driven Development](https://medium.com/@pierreprinetti/test-driven-development-in-go-baeab5adb468) should be practiced where possible.
217241
However, due to some design flaws in some parts of the code it's currently not always practical to do so.
@@ -222,7 +246,7 @@ Running unit tests:
222246
# or (identical)
223247
go test -short ./...
224248

225-
#### Regression tests
249+
#### Regression Tests
226250

227251
For the full regression suite you will need to download the test demo-set.
228252

@@ -234,7 +258,7 @@ Downloading demos + running regression tests:
234258

235259
scripts/regression-tests.sh
236260

237-
#### Updating the `default.golden` file
261+
#### Updating the `default.golden` File
238262

239263
The file [`test/default.golden`](https://github.com/markus-wa/demoinfocs-golang/blob/master/test/default.golden) file contains a serialized output of all expected game events in `test/cs-demos/default.dem`.
240264

@@ -254,15 +278,15 @@ To change the default debugging behavior, Go's `ldflags` parameter can be used.
254278

255279
Check out `debug_on.go` for any other settings that can be changed.
256280

257-
### Generating interfaces
281+
### Generating Interfaces
258282

259283
We generate interfaces such as `GameState` from structs to make it easier to keep docs in synch over structs and interfaces.
260284
For this we use [@vburenin](https://github.com/vburenin)'s [`ifacemaker`](https://github.com/vburenin/ifacemaker) tool.
261285

262286
You can download the latest version [here](https://github.com/vburenin/ifacemaker/releases).
263287
After adding it to your `PATH` you can use `scripts/generate-interfaces.sh` to update interfaces.
264288

265-
### Generating protobuf code
289+
### Generating Protobuf Code
266290

267291
Should you need to re-generate the protobuf generated code in the `msg` package, you will need the following tools:
268292

0 commit comments

Comments
 (0)