diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-02-04 15:29:39 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-02-04 15:32:35 +0100 |
commit | 364fe4a03b97f04586194c49e15891ba9a639944 (patch) | |
tree | 267c7bf0680258c0d30de6d5a9dd0af409d0d74f /doc | |
parent | b79aba6ea1ecb6a1f619128638369ef47f64d26d (diff) | |
download | pandoc-364fe4a03b97f04586194c49e15891ba9a639944.tar.gz |
doc/lua-filters.md: fix, improve docs for `pandoc.mediabag.fetch`
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 |