{"id":18733555,"url":"https://github.com/insightsengineering/pattern-strip","last_synced_at":"2026-05-02T03:08:36.643Z","repository":{"id":224569477,"uuid":"763580237","full_name":"insightsengineering/pattern-strip","owner":"insightsengineering","description":"Pattern Strip Extension For Quarto","archived":false,"fork":false,"pushed_at":"2024-03-15T16:05:19.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-19T23:43:52.664Z","etag":null,"topics":["r"],"latest_commit_sha":null,"homepage":"https://insightsengineering.github.io/pattern-strip/","language":"Lua","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/insightsengineering.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,"zenodo":null},"funding":{"custom":["https://pharmaverse.org"]}},"created_at":"2024-02-26T15:02:57.000Z","updated_at":"2024-05-23T12:15:27.000Z","dependencies_parsed_at":"2025-05-19T23:48:22.088Z","dependency_job_id":null,"html_url":"https://github.com/insightsengineering/pattern-strip","commit_stats":null,"previous_names":["insightsengineering/pattern-strip"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/insightsengineering/pattern-strip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpattern-strip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpattern-strip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpattern-strip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpattern-strip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insightsengineering","download_url":"https://codeload.github.com/insightsengineering/pattern-strip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Fpattern-strip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32521132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["r"],"created_at":"2024-11-07T15:10:22.373Z","updated_at":"2026-05-02T03:08:36.627Z","avatar_url":"https://github.com/insightsengineering.png","language":"Lua","funding_links":["https://pharmaverse.org"],"categories":[],"sub_categories":[],"readme":"# Pattern Strip Extension For Quarto\n\nThis is a Quarto extension that provides a filter to remove text from a string using a [Lua's patterns](https://www.lua.org/manual/5.4/manual.html#6.4.1) (similar to regular expressions but not exactly the same). This is applied on the `CodeBlock` only.\n\nThe main goal of this extension is to remove certain comments from the code blocks. For example, comments that are used for linters (`# nolint`) or styler (`# styler: off`).\nThis extension is not limited to R code blocks only, it can be used for any code block.\n\nFor R, similar functionality can be achieved using `tidy` chunk option (source). This however, is applicable for single article / code chunk only and it is not possible to specify globally in the `_quarto.yml` file. This extension aims to address these limitations and provide more general solution applicable for not only R code blocks.\n\nRelated discussions:\n\n* \u003chttps://github.com/quarto-dev/quarto-cli/discussions/8760\u003e\n* \u003chttps://github.com/quarto-dev/quarto-cli/discussions/7521\u003e\n\n## Installing\n\n```bash\nquarto install extension insightsengineering/pattern-strip\n```\n\nThis will install the extension under the `_extensions` subdirectory.\nIf you're using version control, you will want to check in this directory.\n\n## Using\n\nIn your `_quarto.yml` file, please (i) add the extension and (ii) specify the patterns to remove. For example:\n\n```yaml\nfilters:\n  - pattern-strip\npattern-strip-patterns:\n  - \"#%s?nolint.*\"\n  - \"#%s?styler:.*\"\n  - ...\n```\n\nLua patterns does not support alteration operator therefore patterns needs to be specified in a list [(source)](https://stackoverflow.com/questions/10438358/what-is-the-alternation-operator-in-lua-patterns).\n\n## Example\n\nHere is the source code for a minimal example: [example.qmd](example.qmd).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Fpattern-strip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsightsengineering%2Fpattern-strip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Fpattern-strip/lists"}