{"id":16571695,"url":"https://github.com/hrbrmstr/phcssjars","last_synced_at":"2026-04-16T18:03:38.543Z","repository":{"id":141238659,"uuid":"202908393","full_name":"hrbrmstr/phcssjars","owner":"hrbrmstr","description":"R wrapper for the Java CSS 2 and CSS 3 parser and builder ph-css library","archived":false,"fork":false,"pushed_at":"2019-08-17T16:58:31.000Z","size":1639,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T02:52:31.763Z","etag":null,"topics":["css-parser","css2","css3","r","rjava","rstats"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","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-17T16:53:36.000Z","updated_at":"2019-08-17T16:59:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"c592e5dc-efb0-4f29-9bcd-339105f09eb7","html_url":"https://github.com/hrbrmstr/phcssjars","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%2Fphcssjars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fphcssjars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fphcssjars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fphcssjars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrbrmstr","download_url":"https://codeload.github.com/hrbrmstr/phcssjars/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242039717,"owners_count":20061928,"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","css2","css3","r","rjava","rstats"],"created_at":"2024-10-11T21:24:50.723Z","updated_at":"2025-10-12T03:12:43.561Z","avatar_url":"https://github.com/hrbrmstr.png","language":"R","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()\n```\n\n```{r description, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::yank_title_and_description()\n```\n\n## Installation\n\n```{r install-ex, results='asis', echo=FALSE, cache=FALSE}\nhrbrpkghelpr::install_block()\n```\n\n## Usage\n\n```{r}\nlibrary(rJava)\nlibrary(phcssjars)\n\npackageVersion(\"phcssjars\")\n```\n\nTurn a CSS file into a data frame (some bits TBD):\n\n```{r ex1}\nlibrary(tidyverse)\n\nECSSVersion \u003c- J(\"com.helger.css.ECSSVersion\")\nCSSReader \u003c- J(\"com.helger.css.reader.CSSReader\")\n\ncss_fil \u003c- paste0(readLines(\"https://www.r-project.org/css/R.css\"), collapse=\"\\n\")\n\ncss \u003c- CSSReader$readFromString(css_fil, ECSSVersion$CSS30)\n\nlapply(css$getAllRules(), function(.x) {\n  \n  if (.jinherits(.x, \"com.helger.css.decl.CSSStyleRule\")) {\n  \n    tibble(\n      selectors = sapply(.x$getAllSelectors(), function(.y) .y$getAsCSSString()),\n      declarations = list(lapply(.x$getAllDeclarations(), function(.y) {\n        property \u003c- .y$getProperty()\n        try(\n          sapply(.y$getExpression()$getAllSimpleMembers(), function(.z) .z$getOptimizedValue()), \n          silent = TRUE\n        ) -\u003e expressions\n        if (inherits(expressions, \"try-error\")) expressions \u003c- NA_character_\n        tibble(\n          property = property,\n          value = expressions\n        )\n      }))\n    )\n    \n  } else if (.jinherits(.x, \"com.helger.css.decl.CSSFontFaceRule\")) {\n    message(\"Font Face Rules TBD\")\n  } else if (.jinherits(.x, \"com.helger.css.decl.CSSMediaRule\")) {\n    message(\"Media Rules TBD\")\n  } else if (.jinherits(.x, \"com.helger.css.decl.CSSKeyframesRule\")) {\n    message(\"Keyframes Rules TBD\")\n  } else if (.jinherits(.x, \"com.helger.css.decl.CSSViewportRule\")) {\n    message(\"Viewport Rules TBD\")\n  }  \n  \n}) %\u003e% \n  bind_rows() %\u003e% \n  unnest() %\u003e% \n  unnest() -\u003e res\n\nres\n```\n\n## `phcssjars` Metrics\n\n```{r cloc, echo=FALSE}\ncloc::cloc_pkg_md()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fphcssjars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrbrmstr%2Fphcssjars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fphcssjars/lists"}