-
Notifications
You must be signed in to change notification settings - Fork 31
Browse documents
David-Apps edited this page Jul 14, 2024
·
13 revisions
Using these simple plugins and some third-party conversion tools, you can browse documents in various formats.
The plugins are very similar. Each plugin specifies a content type (content
) and a file extension (suffix
) so that Edbrowse can tell when to use the plugin. These plugins include down_url
to tell Edbrowse to create a local copy of a remote file before converting it. Each plugin specifies the command to use to convert the file (program
). The command can use %i
for the input file name and %o
for the output file name. When the command does not use %o
, Edbrowse reads the output of the command. The plugins use outtype
to specify whether the output of the command is text (T
) or HTML code (H
).
plugin {
type = pdf
desc = pdf file
suffix = pdf
content = application/pdf
down_url
program = pdftohtml -i -q -noframes %i %o
outtype = H
}
plugin {
type = Word doc
desc = Microsoft Word document, not docx
suffix = doc
content = application/msword
down_url
program = catdoc %i
outtype = T
}
plugin {
type = Rich Text Format
desc = Rich Text Format
suffix = rtf
content = application/rtf,text/rtf
down_url
program = catdoc %i
outtype = T
}
plugin {
type = markdown
desc = Markdown file
suffix = md
content = text/markdown
# Downloading the file is optional.
down_url
program = pandoc -f markdown -t html %i
outtype = H
}
plugin {
type = Microsoft Word document
desc = Microsoft Word Open XML document
suffix = docx
content = application/vnd.openxmlformats-officedocument.wordprocessingml.document
down_url
program = pandoc -f docx -t html %i
outtype = H
}
plugin {
type = Open Document Format
desc = Open Document Format (text)
suffix = odt
content = application/vnd.oasis.opendocument.text
down_url
program = pandoc -f odt -t html %i
outtype = H
}
plugin {
type = EPUB
desc = EPUB
suffix = epub
content = application/epub+zip
down_url
program = pandoc -f epub -t html %i
outtype = H
}
plugin {
type = Microsoft Excel 97 to 2003 workbook
desc = Microsoft Excel 97 to 2003 workbook
suffix = xls
content = application/vnd.ms-excel
down_url
program = xls2csv -f %F -q 1 -x %i
outtype = T
}
plugin {
type = Microsoft Excel workbook
desc = Microsoft Excel Open XML workbook
suffix = xlsx,xlsm
content = application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
down_url
# For comma-separated values, remove "-d tab".
program = xlsx2csv -d tab -f %F -s 0 %i
outtype = T
}