https://github.com/san650/desktop_url_file
Elixir library for generating desktop url files that points to websites. These files are supported by Windows and OSX operating systems.
https://github.com/san650/desktop_url_file
desktop elixir links
Last synced: 3 months ago
JSON representation
Elixir library for generating desktop url files that points to websites. These files are supported by Windows and OSX operating systems.
- Host: GitHub
- URL: https://github.com/san650/desktop_url_file
- Owner: san650
- License: other
- Created: 2018-07-25T00:23:55.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-25T00:30:59.000Z (almost 8 years ago)
- Last Synced: 2025-03-01T20:11:12.816Z (over 1 year ago)
- Topics: desktop, elixir, links
- Language: Elixir
- Homepage:
- Size: 3.91 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DesktopUrlFile
Elixir library for generating desktop url files that points to websites. These files are supported by Windows and OSX operating systems.
## Synopsis
```elixir
DesktopUrlFile.make("https://github.com/san650/desktop_url_file#readme")
{:ok,
"""
[InternetShortcut]
URL=https://github.com/desktop_url_file#readme
"""
}
```
## Integrating with Plug
```elixir
def create(conn, _params) do
conn
|> send_desktop_url_file("documentation.pdf.url", "https://example.com/documentation.pdf")
end
def send_desktop_url_file(conn, file_name, url) do
conn
|> put_resp_content_type(DesktopUrlFile.mime)
|> put_resp_header("Content-Disposition", "attachment; filename=#{file_name}")
|> send_resp(200, DesktopUrlFile.make(url))
end
```
## Installation
Add `desktop_url_file` to your `mix.exs` deps:
```elixir
def deps do
[{:desktop_url_file, "~> 0.1.0"}]
end
```
## License
desktop_url_file is licensed under the MIT license.
See [LICENSE](./LICENSE) for the full license text.