Module: Anydoc
- Defined in:
- lib/anydoc.rb,
lib/anydoc.rb,
lib/anydoc/version.rb
Defined Under Namespace
Classes: Asset, Block, Cell, CellSlot, ConvertError, Document, Error, ImageSource, Inline, LinkTarget, List, ListItem, Note, Style, Table
Constant Summary
collapse
- FORMATS =
%i[doc docx odt pdf ppt pptx rtf epub xlsx ods odp csv].freeze
- VERSION =
"0.1.3"
Class Method Summary
collapse
Class Method Details
32
33
34
|
# File 'lib/anydoc.rb', line 32
def format_from_bytes(data)
_format_from_bytes(data)&.to_sym
end
|
36
37
38
|
# File 'lib/anydoc.rb', line 36
def format_from_extension(extension)
_format_from_extension(extension)&.to_sym
end
|
40
41
42
|
# File 'lib/anydoc.rb', line 40
def format_from_path(path)
_format_from_path(File.path(path))&.to_sym
end
|
.to_document(data, format = nil) ⇒ Object
52
53
54
|
# File 'lib/anydoc.rb', line 52
def to_document(data, format = nil)
_to_document(data, format&.to_s)
end
|
.to_markdown(path) ⇒ Object
44
45
46
|
# File 'lib/anydoc.rb', line 44
def to_markdown(path)
_to_markdown(File.path(path))
end
|
.to_markdown_bytes(data, format = nil) ⇒ Object
48
49
50
|
# File 'lib/anydoc.rb', line 48
def to_markdown_bytes(data, format = nil)
_to_markdown_bytes(data, format&.to_s)
end
|