{"id":19078360,"url":"https://github.com/kickstarter/kumquat","last_synced_at":"2025-04-30T04:48:54.082Z","repository":{"id":29662375,"uuid":"33204447","full_name":"kickstarter/kumquat","owner":"kickstarter","description":"Kumquat is a Rails Engine for rendering RMarkdown files.","archived":false,"fork":false,"pushed_at":"2018-05-23T15:13:34.000Z","size":55,"stargazers_count":43,"open_issues_count":3,"forks_count":9,"subscribers_count":127,"default_branch":"master","last_synced_at":"2025-04-30T04:48:48.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/kickstarter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-31T19:11:01.000Z","updated_at":"2021-11-03T12:55:18.000Z","dependencies_parsed_at":"2022-08-17T19:55:18.001Z","dependency_job_id":null,"html_url":"https://github.com/kickstarter/kumquat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fkumquat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fkumquat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fkumquat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kickstarter%2Fkumquat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kickstarter","download_url":"https://codeload.github.com/kickstarter/kumquat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644827,"owners_count":21620630,"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":[],"created_at":"2024-11-09T02:08:41.582Z","updated_at":"2025-04-30T04:48:54.039Z","avatar_url":"https://github.com/kickstarter.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kumquat\n\nKumquat is a reporting tool for rendering [RMarkdown](http://kbroman.org/knitr_knutshell/pages/Rmarkdown.html) files inside Rails.\n\nRMarkdown, or `.Rmd` files are Markdown files with code chunks of [R](http://r-project.org/) in them.\n\nYou can use Kumquat to integerate R output into Rails, which is useful for using libaries like `ggplot2` in email reporting tools.\n\n# Example\n\nFor example, consider a typical `render` call to a partial:\n\n`render '_a_knitr_report'`\n\nThis partial is `_a_knitr_report.Rmd`, a regular RMarkdown file stored in your app:\n\n```md\nA Test Report for Kumquat\n========================================================\n\nThis is some code for Knitr, including [a link](https://www.kickstarter.com).\n\nA list:\n\n* One\n* Another thing\n* Last thing!\n\n### More stuff.\n\nLorem Ipsum.\n\n    ```{r, fig.width=10, fig.height=8, echo=FALSE, message=FALSE}\n    library(ggplot2)\n    qplot(data = data.frame( x = runif(100), y = runif(100) ), x = x, y = y)\n    ```\n```\n\nWhich yields the following output:\n\n![Kumquat Screenshot](https://ksr-ugc.imgix.net/assets/003/462/965/08a6aecce8d70673600920f20b80260e_original.png?v=1426711514\u0026w=700\u0026fit=max\u0026auto=format\u0026lossless=true\u0026s=a5d29734ce223f8797f896614e46398e \"Kumquat in Action\")\n\nKumquat can be integrated anywhere inside Rails views where partials are called.\n\n# How it Works\n\nKumquat requires R to be installed on the machines running your application. The main action is then in `Knit2HTML` which shells out to `Rscript` and runs the necessary `knitr` package methods to compile HTML.\n\nWhen you install Kumquat a template handler is registered to handle Rmd files.\n\n# Also, Email\n\nA mail interceptor, `KumquatReportInterceptor` is also registered to attach images inline to Rmd reports marked with an `X-KUMQUAT` signature which you can add to a mail object accordingly:\n\n```ruby\n    mail :to =\u003e @admin.email,\n      :reply_to =\u003e \"dev@kickstarter.com\",\n      :subject =\u003e \"Test Kumquat Report\",\n      'X-KUMQUAT' =\u003e true do |format|\n        format.text { render layout: nil }\n        format.html { render layout: nil }\n    end\n```\n\n# Setup \u0026 Development\n\nKumquat requires R to be installed, and the knitr packages to render RMarkdown files. The rest of the R dependencies are up to you, but need to be specified in the `KNITR_LIBRARIES` constant in the `Knit2HTML` class.\n\n## Chef Recipe\nIf you're curious about installing R using Chef, check out [a suggested recipe on the wiki](https://github.com/kickstarter/kumquat/wiki/Suggested-Chef-Recipe)\n\n## Database Support\nIf you need to connect R to a database and provide credentials from your application, you can do so in an application initializer like so:\n\n```ruby\nKumquat.database_config(Configs[:redshift].merge({ database_connector: \"RPostgres::Postgres()\" }))\n```\n\nWe are using Hadley Wickham's [RPostgres library](https://github.com/rstats-db/RPostgres) which can be installed in R accordingly:\n\n```R\ninstall.packages(\"devtools\")\ndevtools::install_github(\"RcppCore/Rcpp\")\ndevtools::install_github(\"rstats-db/DBI\")\ndevtools::install_github(\"rstats-db/RPostgres\")\n\nlibrary(DBI)\n```\n\n## Sending emails from a local development environment\n\nIf you'd like to deliver emails in your local environment, make sure your `config.action_mailer.delivery_method` is configured properly, and you have a way to send email locally (on OS X, run the command `sudo postfix start`).\n\n## Logging\nYou can view kumquat and email logs for debugging `tail -f log/kumquat.log`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkickstarter%2Fkumquat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkickstarter%2Fkumquat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkickstarter%2Fkumquat/lists"}