Skip to content

Commit 2c4ef4b

Browse files
author
stlc-bot
committed
feat(parse): support WARC archives in parsing and scraping (#2761)
Stainless-Generated-From: cbff604d9a9dd49f3b0ee9d1f64da1867400fc56
1 parent e018eca commit 2c4ef4b

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/charmbracelet/bubbletea v1.3.6
88
github.com/charmbracelet/lipgloss v1.1.0
99
github.com/charmbracelet/x/term v0.2.1
10-
github.com/context-dot-dev/context-go-sdk/v2 v2.45.0
10+
github.com/context-dot-dev/context-go-sdk/v2 v2.46.0
1111
github.com/goccy/go-yaml v1.18.0
1212
github.com/itchyny/json2yaml v0.1.4
1313
github.com/muesli/reflow v0.3.0

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payR
1818
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
1919
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
2020
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
21-
github.com/context-dot-dev/context-go-sdk/v2 v2.45.0 h1:qB8a9EhMOwzeRqwhJIfe4L924vtmMN7QF9/ajA3zexk=
22-
github.com/context-dot-dev/context-go-sdk/v2 v2.45.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8=
21+
github.com/context-dot-dev/context-go-sdk/v2 v2.46.0 h1:eoNQ/cNKkDtUut9xvRbAWfFZCzLlrgbdwJlBQ+ca0N4=
22+
github.com/context-dot-dev/context-go-sdk/v2 v2.46.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8=
2323
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
2424
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
2525
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=

‎pkg/cmd/parse.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
var parseHandle = requestflag.WithInnerFlags(cli.Command{
2020
Name: "handle",
21-
Usage: "Convert uploaded file bytes into Markdown and optional HTML.",
21+
Usage: "Convert uploaded file bytes into Markdown and optional HTML. WARC and WARC.GZ\narchives combine HTTP response, resource, and conversion records in archive\norder. Revisit and segmented records are skipped. Decoded WARC content is\nlimited to 50 MiB.",
2222
Suggest: true,
2323
Flags: []cli.Flag{
2424
&requestflag.Flag[string]{
@@ -34,7 +34,7 @@ var parseHandle = requestflag.WithInnerFlags(cli.Command{
3434
},
3535
&requestflag.Flag[string]{
3636
Name: "extension",
37-
Usage: "Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt.",
37+
Usage: "Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, txt, warc, or warc.gz.",
3838
QueryPath: "extension",
3939
},
4040
&requestflag.Flag[bool]{

‎pkg/cmd/parse_test.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestParseHandle(t *testing.T) {
1818
"parse", "handle",
1919
"--body", mocktest.TestFile(t, "Example data"),
2020
"--client", "x",
21-
"--extension", "txt",
21+
"--extension", "warc",
2222
"--include-images=true",
2323
"--include-links=true",
2424
"--include-numbered-pages=true",
@@ -43,7 +43,7 @@ func TestParseHandle(t *testing.T) {
4343
"parse", "handle",
4444
"--body", mocktest.TestFile(t, "Example data"),
4545
"--client", "x",
46-
"--extension", "txt",
46+
"--extension", "warc",
4747
"--include-images=true",
4848
"--include-links=true",
4949
"--include-numbered-pages=true",
@@ -66,7 +66,7 @@ func TestParseHandle(t *testing.T) {
6666
"--api-key", "string",
6767
"parse", "handle",
6868
"--client", "x",
69-
"--extension", "txt",
69+
"--extension", "warc",
7070
"--include-images=true",
7171
"--include-links=true",
7272
"--include-numbered-pages=true",

0 commit comments

Comments
 (0)