diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua-filters.md | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 0c86d6109..3b3c03727 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -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 |