{"id":16571603,"url":"https://github.com/hrbrmstr/tsuka","last_synced_at":"2025-10-31T07:31:30.315Z","repository":{"id":141238939,"uuid":"201538067","full_name":"hrbrmstr/tsuka","owner":"hrbrmstr","description":"📃CSS Parser for R [Concept]","archived":false,"fork":false,"pushed_at":"2019-08-10T10:36:46.000Z","size":37,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-25T04:24:39.603Z","etag":null,"topics":["css-parser","r","rstats"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrbrmstr.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","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":"2019-08-09T20:45:41.000Z","updated_at":"2019-08-15T06:36:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"56cd23cb-21e7-4cd0-9dd8-be1b8924ebd6","html_url":"https://github.com/hrbrmstr/tsuka","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/hrbrmstr%2Ftsuka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Ftsuka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Ftsuka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Ftsuka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrbrmstr","download_url":"https://codeload.github.com/hrbrmstr/tsuka/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239139715,"owners_count":19588246,"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":["css-parser","r","rstats"],"created_at":"2024-10-11T21:24:33.953Z","updated_at":"2025-10-31T07:31:25.054Z","avatar_url":"https://github.com/hrbrmstr.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: \n  rmarkdown::github_document:\n    df_print: kable\n---\n```{r pkg-knitr-opts, include=FALSE}\nhrbrpkghelpr::global_opts()\n```\n\n```{r badges, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::stinking_badges(repo_status = \"Concept\")\n```\n\n```{r description, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::yank_title_and_description()\n```\n\n## SOME IMPORTANT DETAILS\n\nThrew this together for [\\@clauswilke](https://github.com/clauswilke) \u0026 [{ggtext}](https://github.com/clauswilke/ggtext) based on [this Twitter convo](https://twitter.com/hrbrmstr/status/1159920814801731586). I am unlikely to work on this more w/o serious prodding. It only handles CSS style rules and need 7 other enums covered from [`katana`](https://github.com/hackers-painters/katana-parser/blob/master/src/katana.h#L38-L48), plus the core cpp code need to be refactored into functions. Claus is more than capable of riffing off of the `katana` source (and I'll gladly PR into that if needed), plus I've no desire to spend time building a massively general purpose R pacakge that has a chance of being steamrolled over by corporate-backed package development.\n\nYou need to install the [`katana`](https://github.com/hackers-painters/katana-parser) C99 parser as a system library that is reachable by the R source package compilation defaults. It looks to be pretty straightforward to embed the `katana` source into a C[++]-backed R package but that wasn't the point of this exercise.\n\nIn `src/` there are some header files copied from the `katana` src which enable use of the same utility functions they use.\n\n## What's Inside The Tin\n\nThe following functions are implemented:\n\n```{r ingredients, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::describe_ingredients()\n```\n\n## Installation\n\n```{r install-ex, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::install_block()\n```\n## Usage\n\n```{r lib-ex}\nlibrary(tsuka)\n\n# current version\npackageVersion(\"tsuka\")\n\n```\n\n```{r ex1}\n\"\n/* Applies to the entire body of the HTML document (except where overridden by more specific\nselectors). */\nbody {\n  margin: 25px;\n  background-color: rgb(240,240,240);\n  font-family: arial, sans-serif;\n  font-size: 14px;\n}\n\n/* Applies to all \u003ch1\u003e...\u003c/h1\u003e elements. */\nh1 {\n  font-size: 35px;\n  font-weight: normal;\n  margin-top: 5px;\n}\n\n/* Applies to all elements with \u003c... class='someclass'\u003e specified. */\n.someclass { color: red; }\n\n/* Applies to the element with \u003c... id='someid'\u003e specified. */\n#someid { color: green; }\n\" -\u003e css_ex\n\nparse_css_text(css_ex)\n```\n\n```{r ex2}\nparse_css_file(system.file(\"extdat/sample.css\", package = \"tsuka\"))\n```\n\n## tsuka Metrics\n\n```{r cloc, echo=FALSE}\ncloc::cloc_pkg_md()\n```\n\n## Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). \nBy participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Ftsuka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrbrmstr%2Ftsuka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Ftsuka/lists"}