SVG v1.1.2 SVG View Source

Main application module.

Link to this section Summary

Functions

Produces a name for given path to svg, by removing the root path from it (second arg), and stripping away leading / and extension

Reads a file, then base64-encodes contents, prepending “data:image…” markup

Reads a file, then URI-encodes contents, prepending “data:image…” markup

Link to this section Functions

Link to this function name_from_path(path, root) View Source
name_from_path(String.t, String.t) :: String.t

Produces a name for given path to svg, by removing the root path from it (second arg), and stripping away leading / and extension.

Example:

iex> name_from_path("/some/path/images/logo.svg", "/some/path/images")
"logo"

iex> name_from_path("/some/path/images/logo.svg", "/some/path")
"images/logo"
Link to this function read_and_encode64!(path) View Source
read_and_encode64!(String.t) :: String.t

Reads a file, then base64-encodes contents, prepending “data:image…” markup.

Link to this function read_and_uri_encode!(path) View Source
read_and_uri_encode!(String.t) :: String.t

Reads a file, then URI-encodes contents, prepending “data:image…” markup.