| // Copyright 2024 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Show shows the result of running crawldocs.Split on a single input file. |
| // go run show.go file.html |
| // It prints lines that can be pasted into the test table in ../split_test.go. |
| "golang.org/x/oscar/internal/crawldocs" |
| data, err := os.ReadFile(os.Args[1]) |
| for s := range crawldocs.Split(data) { |
| fmt.Printf("{%q, %q, %q},\n", s.Title, s.ID, s.Text[:min(len(s.Text), 40)]) |