doc/lua-filters.md: fix, improve docs for pandoc.mediabag.fetch
This commit is contained in:
parent
b79aba6ea1
commit
364fe4a03b
1 changed files with 12 additions and 2 deletions
|
@ -3176,12 +3176,22 @@ Usage:
|
|||
|
||||
### fetch {#pandoc.mediabag.fetch}
|
||||
|
||||
`fetch (source, base_url)`
|
||||
`fetch (source)`
|
||||
|
||||
Fetches the given source from a URL or local file. Returns two
|
||||
values: the contents of the file and the MIME type (or an empty
|
||||
string).
|
||||
|
||||
The function will first try to retrieve `source` from the
|
||||
mediabag; if that fails, it will try to download it or read it
|
||||
from the local file system while respecting pandoc's "resource
|
||||
path" setting.
|
||||
|
||||
Parameters:
|
||||
|
||||
`source`:
|
||||
: path to a resource; either a local file path or URI
|
||||
|
||||
Returns:
|
||||
|
||||
- the entries MIME type, or nil if the file was not found.
|
||||
|
@ -3190,7 +3200,7 @@ Returns:
|
|||
Usage:
|
||||
|
||||
local diagram_url = "https://pandoc.org/diagram.jpg"
|
||||
local mt, contents = pandoc.mediabag.fetch(diagram_url, ".")
|
||||
local mt, contents = pandoc.mediabag.fetch(diagram_url)
|
||||
|
||||
# Module pandoc.List
|
||||
|
||||
|
|
Loading…
Reference in a new issue