{"id":19385476,"url":"https://github.com/ricn/rapport","last_synced_at":"2025-04-23T22:32:00.733Z","repository":{"id":25690872,"uuid":"104521882","full_name":"ricn/rapport","owner":"ricn","description":"Rapport aims to provide a robust set of modules to generate HTML reports that both looks good in the browser and when being printed.","archived":false,"fork":false,"pushed_at":"2024-04-25T20:11:40.000Z","size":5338,"stargazers_count":57,"open_issues_count":3,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-25T20:55:41.651Z","etag":null,"topics":["elixir"],"latest_commit_sha":null,"homepage":"","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/ricn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-09-22T21:53:40.000Z","updated_at":"2024-04-25T20:11:43.000Z","dependencies_parsed_at":"2024-11-10T09:36:31.788Z","dependency_job_id":"48507f78-c91b-44ce-8d4a-a7c342cb1413","html_url":"https://github.com/ricn/rapport","commit_stats":{"total_commits":167,"total_committers":3,"mean_commits":"55.666666666666664","dds":"0.26347305389221554","last_synced_commit":"5fe206119f7618c67bae216464d8c79ea19a1f0f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricn%2Frapport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricn%2Frapport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricn%2Frapport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricn%2Frapport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricn","download_url":"https://codeload.github.com/ricn/rapport/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250527089,"owners_count":21445300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["elixir"],"created_at":"2024-11-10T09:36:20.936Z","updated_at":"2025-04-23T22:32:00.005Z","avatar_url":"https://github.com/ricn.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"test/images/logo/horizontal.png\" alt=\"rapport\" height=\"110px\"\u003e\u003c/p\u003e\n\nRapport aims to provide a robust set of modules to generate HTML reports that both looks good in the browser and when being printed.\n\n[![Elixir CI](https://github.com/ricn/rapport/actions/workflows/elixir.yml/badge.svg)](https://github.com/ricn/rapport/actions/workflows/elixir.yml)\n[![Hex.pm](https://img.shields.io/hexpm/v/rapport.svg)](https://hex.pm/packages/rapport)\n[![Coverage Status](https://coveralls.io/repos/github/ricn/rapport/badge.svg?branch=master)](https://coveralls.io/github/ricn/rapport?branch=master)\n\n## Installation\n\nThe package can be installed\nby adding `rapport` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:rapport, \"~\u003e 0.7\"}\n  ]\nend\n```\n\n## Notable features\n  * Specify paper size for the report\n  * Specify rotation for the report\n  * Image helpers\n  * Font helpers\n  * Page numbering\n  * Add custom styling \u0026 even Javascript\n  * Barcodes\n\n## Hello world\n\n```elixir\npage_template = \"\u003ch1\u003e\u003c%= @hello %\u003e\u003c/h1\u003e\"\nhtml_report =\n  Rapport.new\n  |\u003e Rapport.add_page(page_template, %{hello: \"Hello world!\"})\n  |\u003e Rapport.save_to_file(\"/home/users/ricn/hello.html\")\n```\n\nThe snippet above generates a report containing only one page with a heading that says \"Hello world!\".\n\n[See example here](https://rawgit.com/ricn/rapport/master/examples/hello.html)\n\n## More examples\n  * [Custom fonts and styling](https://rawgit.com/ricn/rapport/master/examples/custom_fonts_and_styles.html)\n  * [Invoice](https://rawgit.com/ricn/rapport/master/examples/invoice.html)\n  * [Page numbering](https://rawgit.com/ricn/rapport/master/examples/page_numbering.html)\n  * [List of people with cover page](https://rawgit.com/ricn/rapport/master/examples/list_of_people.html)\n  * [Barcodes](https://rawgit.com/ricn/rapport/master/examples/barcodes.html)\n  * More examples are coming...\n\nIf you want to see how the examples has been created, you can look at the `example_test.exs` file in the test folder.\n\n## Phoenix integration\n\nIt's easy to Integrate Rapport with Phoenix. Just load the template as a module attribute, create the HTML for the report\nand send a response with the generated HTML:\n\n```elixir\ndefmodule ReportsWeb.ReportController do\n  use ReportsWeb, :controller\n\n  @page_template File.read!(Path.join(__DIR__, \"../templates/report/hello.html.eex\"))\n\n  def hello(conn, _params) do\n    html_report =\n       Rapport.new\n       |\u003e Rapport.add_page(@page_template, %{hello: \"Hello World!\"})\n       |\u003e Rapport.generate_html\n\n       conn\n       |\u003e put_resp_content_type(\"text/html\")\n       |\u003e send_resp(200, html_report)\n  end\nend\n```\n\n## Upcoming features\n  * Charts\n  * PDF conversion\n\n## Credits\n\nThe following people have contributed ideas, documentation, or code to Rapport:\n\n* Richard Nyström\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricn%2Frapport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricn%2Frapport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricn%2Frapport/lists"}