logo

auto_linker

AutoLinker-shim, based on https://git.pleroma.social/pleroma/auto_linker git clone https://anongit.hacktivis.me/git/auto_linker.git/

README.md (1474B)


  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.3"}]
  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. iex> Linkify.link("Hello @niceguy17@pleroma.com", mention: true, mention_prefix: "/users/")
  23. "Hello <a href=\"/users/niceguy17@pleroma.com\">@niceguy17@pleroma.com</a>"
  24. ```
  25. See the [Docs](https://hexdocs.pm/linkify/) for more examples
  26. ## Acknowledgments
  27. This is a fork of [auto_linker](https://github.com/smpallen99/auto_linker) by [Steve Pallen](https://github.com/smpallen99).
  28. ## License
  29. Copyright © 2017 E-MetroTel
  30. Copyright © 2019-2020 Pleroma Authors
  31. The source is released under the MIT License.
  32. Check [LICENSE](LICENSE) for more information.