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.

53 lines
1.4 KiB

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