{"id":13508003,"url":"https://github.com/elixirdrops/kerosene","last_synced_at":"2026-02-21T15:04:45.532Z","repository":{"id":5611873,"uuid":"53425613","full_name":"elixirdrops/kerosene","owner":"elixirdrops","description":"Pagination for Ecto and Pheonix.","archived":false,"fork":false,"pushed_at":"2024-04-19T20:39:12.000Z","size":80,"stargazers_count":230,"open_issues_count":20,"forks_count":39,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-31T22:15:53.977Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/elixirdrops/kerosene","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixirdrops.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-08T16:03:26.000Z","updated_at":"2025-10-12T16:52:05.000Z","dependencies_parsed_at":"2024-01-05T21:55:30.205Z","dependency_job_id":"b663648e-1ad2-44f7-ad3e-6efc8a6588df","html_url":"https://github.com/elixirdrops/kerosene","commit_stats":{"total_commits":58,"total_committers":18,"mean_commits":"3.2222222222222223","dds":0.603448275862069,"last_synced_commit":"ca90a54f1f9dd6193a26fd4c2128b4141f66bac8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elixirdrops/kerosene","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixirdrops%2Fkerosene","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixirdrops%2Fkerosene/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixirdrops%2Fkerosene/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixirdrops%2Fkerosene/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixirdrops","download_url":"https://codeload.github.com/elixirdrops/kerosene/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixirdrops%2Fkerosene/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29684076,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T14:31:22.911Z","status":"ssl_error","status_checked_at":"2026-02-21T14:31:22.570Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:00:45.285Z","updated_at":"2026-02-21T15:04:45.514Z","avatar_url":"https://github.com/elixirdrops.png","language":"Elixir","readme":"# Kerosene\n\nPagination for Ecto and Phoenix.\n\n\n## Installation\n\nThe package is [available in Hex](https://hex.pm/packages/kerosene), the package can be installed as:\n\nAdd kerosene to your list of dependencies in `mix.exs`:\n```elixir\ndef deps do\n  [{:kerosene, \"~\u003e 0.9.0\"}]\nend\n```\n\nAdd Kerosene to your `repo.ex`:\n```elixir\ndefmodule MyApp.Repo do\n  use Ecto.Repo, \n    otp_app: :testapp,\n    adapter: Ecto.Adapters.Postgres\n  use Kerosene, per_page: 2\nend\n```\n\n## Usage\nStart paginating your queries \n```elixir\ndef index(conn, params) do\n  {products, kerosene} = \n  Product\n  |\u003e Product.with_lowest_price\n  |\u003e Repo.paginate(params)\n\n  render(conn, \"index.html\", products: products, kerosene: kerosene)\nend\n```\n\nAdd view helpers to your view \n```elixir\ndefmodule MyApp.ProductView do\n  use MyApp.Web, :view\n  import Kerosene.HTML\nend\n```\n\nGenerate the links using the view helpers\n```elixir\n\u003c%= paginate @conn, @kerosene %\u003e\n```\n\nKerosene provides a [list ](https://hexdocs.pm/kerosene/Kerosene.HTML.html#__using__/1) of themes for pagination. By default it uses bootstrap. To use some other, add to config/config.exs:\n```elixir\nconfig :kerosene,\n\ttheme: :foundation\n```\n\nIf you need reduced number of links in pagination, you can use `simple mode` option, to display only Prev/Next links:\n```elixir\nconfig :kerosene,\n\tmode:  :simple\n```\n\nBuilding apis or SPA's, no problem Kerosene has support for Json.\n\n```elixir\ndefmodule MyApp.ProductView do\n  use MyApp.Web, :view\n  import Kerosene.JSON\n\n  def render(\"index.json\", %{products: products, kerosene: kerosene, conn: conn}) do\n    %{data: render_many(products, MyApp.ProductView, \"product.json\"),\n      pagination: paginate(conn, kerosene)}\n  end\n\n  def render(\"product.json\", %{product: product}) do\n    %{id: product.id,\n      name: product.name,\n      description: product.description,\n      price: product.price}\n  end\nend\n```\n\n\nYou can also send in options to paginate helper look at the docs for more details.\n\n## Contributing\n\t\nPlease do send pull requests and bug reports, positive feedback is always welcome.\n\n\n## Acknowledgement\n\nI would like to Thank\n\n* Matt (@mgwidmann)\n* Drew Olson (@drewolson)\n* Akira Matsuda (@amatsuda)\n\n## License\n\nPlease take a look at LICENSE.md\n","funding_links":[],"categories":["Framework Components"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixirdrops%2Fkerosene","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixirdrops%2Fkerosene","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixirdrops%2Fkerosene/lists"}