anydoc-ruby 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/sig/anydoc.rbs ADDED
@@ -0,0 +1,163 @@
1
+ # Type signatures for anydoc-ruby.
2
+
3
+ module Anydoc
4
+ VERSION: String
5
+
6
+ # Every format anydoc reads, named after the extension that identifies it.
7
+ FORMATS: Array[Symbol]
8
+
9
+ type format = Symbol | String
10
+ type path = String | ::Pathname | _ToPath
11
+
12
+ def self.to_markdown: (path path) -> String
13
+ def self.to_markdown_bytes: (String data, ?format: format?) -> String
14
+ def self.to_document: (String data, ?format: format?) -> Document
15
+ def self.format_from_bytes: (String data) -> Symbol?
16
+ def self.format_from_extension: (String | Symbol extension) -> Symbol?
17
+ def self.format_from_path: (path path) -> Symbol?
18
+
19
+ # Argument coercion and file reading happen in Ruby; these are the raw
20
+ # entry points the extension defines.
21
+ #
22
+ # @api private
23
+ module Native
24
+ def self.to_markdown_bytes: (String data, Symbol? format) -> String
25
+ def self.to_document: (String data, Symbol? format) -> Document
26
+ def self.format_from_bytes: (String data) -> Symbol?
27
+ def self.format_from_extension: (String extension) -> Symbol?
28
+ end
29
+
30
+ class Error < StandardError
31
+ end
32
+
33
+ class ConvertError < Error
34
+ end
35
+
36
+ class UnsupportedError < ConvertError
37
+ end
38
+
39
+ class MalformedError < ConvertError
40
+ attr_reader part: String?
41
+ end
42
+
43
+ class EncryptedError < ConvertError
44
+ end
45
+
46
+ class ResourceLimitError < ConvertError
47
+ attr_reader limit: Symbol
48
+ end
49
+
50
+ class MissingPartError < ConvertError
51
+ attr_reader part: String
52
+ end
53
+
54
+ class Document < ::Data
55
+ attr_reader blocks: Array[Block]
56
+ attr_reader notes: Array[Note]
57
+ attr_reader assets: Array[Asset]
58
+
59
+ def self.new: (Array[Block] blocks, Array[Note] notes, Array[Asset] assets) -> Document
60
+ | (blocks: Array[Block], notes: Array[Note], assets: Array[Asset]) -> Document
61
+ end
62
+
63
+ class Block < ::Data
64
+ # :heading | :paragraph | :list | :table | :block_quote | :code_block | :rule
65
+ attr_reader kind: Symbol
66
+ attr_reader level: Integer?
67
+ attr_reader anchor: String?
68
+ attr_reader content: Array[Inline]?
69
+ attr_reader list: List?
70
+ attr_reader table: Table?
71
+ attr_reader blocks: Array[Block]?
72
+ attr_reader lang: String?
73
+ attr_reader text: String?
74
+ end
75
+
76
+ class Inline < ::Data
77
+ # :text | :link | :image | :anchor | :note_ref | :line_break
78
+ attr_reader kind: Symbol
79
+ attr_reader text: String?
80
+ attr_reader style: Style?
81
+ attr_reader content: Array[Inline]?
82
+ attr_reader target: LinkTarget?
83
+ attr_reader alt: String?
84
+ attr_reader source: ImageSource?
85
+ attr_reader anchor: String?
86
+ attr_reader note_id: String?
87
+ end
88
+
89
+ class Style < ::Data
90
+ attr_reader bold: bool
91
+ attr_reader italic: bool
92
+ attr_reader strike: bool
93
+ attr_reader code: bool
94
+
95
+ def self.new: (bool bold, bool italic, bool strike, bool code) -> Style
96
+ | (bold: bool, italic: bool, strike: bool, code: bool) -> Style
97
+
98
+ def plain?: () -> bool
99
+ end
100
+
101
+ class LinkTarget < ::Data
102
+ # :external | :relative | :anchor
103
+ attr_reader kind: Symbol
104
+ attr_reader value: String
105
+ end
106
+
107
+ class ImageSource < ::Data
108
+ # :external | :asset | :unavailable
109
+ attr_reader kind: Symbol
110
+ attr_reader url: String?
111
+ attr_reader asset_id: Integer?
112
+ end
113
+
114
+ class List < ::Data
115
+ # :bullet | :decimal | :lower_alpha | :upper_alpha | :lower_roman | :upper_roman
116
+ attr_reader marker: Symbol
117
+ attr_reader start: Integer
118
+ attr_reader items: Array[ListItem]
119
+
120
+ def ordered?: () -> bool
121
+ end
122
+
123
+ class ListItem < ::Data
124
+ attr_reader blocks: Array[Block]
125
+ attr_reader checked: bool?
126
+ attr_reader marker_label: String?
127
+ end
128
+
129
+ class Table < ::Data
130
+ attr_reader grid: Array[Array[CellSlot]]
131
+ attr_reader header_rows: Integer
132
+ # :data | :layout
133
+ attr_reader kind: Symbol
134
+ end
135
+
136
+ class CellSlot < ::Data
137
+ # :origin | :covered
138
+ attr_reader kind: Symbol
139
+ attr_reader cell: Cell?
140
+ attr_reader origin_row: Integer?
141
+ attr_reader origin_col: Integer?
142
+ end
143
+
144
+ class Cell < ::Data
145
+ attr_reader blocks: Array[Block]
146
+ attr_reader col_span: Integer
147
+ attr_reader row_span: Integer
148
+ end
149
+
150
+ class Note < ::Data
151
+ attr_reader id: String
152
+ # :footnote | :endnote
153
+ attr_reader kind: Symbol
154
+ attr_reader blocks: Array[Block]
155
+ end
156
+
157
+ class Asset < ::Data
158
+ attr_reader id: Integer
159
+ attr_reader media_type: String
160
+ attr_reader origin_part: String
161
+ attr_reader data: String
162
+ end
163
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: anydoc-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.7
5
+ platform: ruby
6
+ authors:
7
+ - Jan Sterba
8
+ - Firecrawl
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 1980-01-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rb_sys
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.111
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.111
27
+ description: Ruby bindings for the anydoc Rust crate. Converts Word, PowerPoint, Excel,
28
+ OpenDocument, RTF, EPUB, CSV, and PDF documents into clean GitHub-Flavored Markdown,
29
+ with one consistent output no matter which format goes in.
30
+ email:
31
+ - info@jansterba.com
32
+ executables: []
33
+ extensions:
34
+ - ext/anydoc/extconf.rb
35
+ extra_rdoc_files: []
36
+ files:
37
+ - Cargo.toml
38
+ - LICENSE
39
+ - README.md
40
+ - ext/anydoc/Cargo.toml
41
+ - ext/anydoc/extconf.rb
42
+ - ext/anydoc/src/document.rs
43
+ - ext/anydoc/src/lib.rs
44
+ - ext/anydoc/src/nogvl.rs
45
+ - lib/anydoc.rb
46
+ - lib/anydoc/document.rb
47
+ - lib/anydoc/errors.rb
48
+ - lib/anydoc/version.rb
49
+ - sig/anydoc.rbs
50
+ homepage: https://github.com/honzasterba/anydoc#readme
51
+ licenses:
52
+ - MIT
53
+ metadata:
54
+ homepage_uri: https://github.com/honzasterba/anydoc#readme
55
+ source_code_uri: https://github.com/honzasterba/anydoc/tree/main/ruby
56
+ bug_tracker_uri: https://github.com/honzasterba/anydoc/issues
57
+ changelog_uri: https://github.com/honzasterba/anydoc/releases
58
+ documentation_uri: https://github.com/honzasterba/anydoc/blob/main/ruby/README.md
59
+ rubygems_mfa_required: 'true'
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 3.2.0
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubygems_version: 4.0.17
75
+ specification_version: 4
76
+ summary: Convert documents (doc, docx, odt, rtf, epub, pdf, presentations, spreadsheets,
77
+ csv) to GitHub-Flavored Markdown
78
+ test_files: []