You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3 KiB

4 years ago
  1. # Linkify
  2. Linkify is a basic package for turning website names into links.
  3. Use this package in your web view to convert web references into click-able links.
  4. ## Installation
  5. The package can be installed by adding `linkify` to your list of dependencies in `mix.exs`:
  6. ```elixir
  7. def deps do
  8. [{:linkify, "~> 0.1"}]
  9. end
  10. ```
  11. ## Usage
  12. The following examples illustrate some examples on how to use the auto linker.
  13. ```elixir
  14. iex> Linkify.link("google.com")
  15. "<a href=\"http://google.com\">google.com</a>"
  16. iex> Linkify.link("google.com", class: "linkified")
  17. "<a href=\"http://google.com\" class=\"linkified\">google.com</a>"
  18. iex> Linkify.link("google.com", new_window: true)
  19. "<a href=\"http://google.com\" target=\"_blank\">google.com</a>"
  20. iex> Linkify.link("google.com", new_window: true, rel: "noopener noreferrer")
  21. "<a href=\"http://google.com\" target=\"_blank\" rel=\"noopener noreferrer\">google.com</a>"
  22. ```
  23. See the [Docs](https://hexdocs.pm/linkify/) for more examples
  24. ## Acknowledgements
  25. This is a fork of [auto_linker](https://github.com/smpallen99/auto_linker) by [Steve Pallen](https://github.com/smpallen99).
  26. ## License
  27. Copyright © 2017 E-MetroTel
  28. Copyright © 2019 Pleroma Authors
  29. The source is released under the MIT License.
  30. Check [LICENSE](LICENSE) for more information.