{"id":21188425,"url":"https://github.com/drsensor/universal-formatter","last_synced_at":"2026-01-02T16:07:41.629Z","repository":{"id":71509205,"uuid":"214968700","full_name":"DrSensor/universal-formatter","owner":"DrSensor","description":"Code (or Text) formatter inspired from grammar in syntax highlighter","archived":false,"fork":false,"pushed_at":"2021-06-19T00:58:24.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T19:57:18.111Z","etag":null,"topics":["concept","formatter","grammar-rules","ideas"],"latest_commit_sha":null,"homepage":"","language":null,"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/DrSensor.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":"2019-10-14T06:49:56.000Z","updated_at":"2021-06-19T00:59:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb16ab23-fa64-4a5a-b3f1-3363afb48bc0","html_url":"https://github.com/DrSensor/universal-formatter","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/DrSensor%2Funiversal-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSensor%2Funiversal-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSensor%2Funiversal-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSensor%2Funiversal-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrSensor","download_url":"https://codeload.github.com/DrSensor/universal-formatter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243640964,"owners_count":20323756,"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":["concept","formatter","grammar-rules","ideas"],"created_at":"2024-11-20T18:44:47.298Z","updated_at":"2026-01-02T16:07:41.567Z","avatar_url":"https://github.com/DrSensor.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Universal Formatter\n\nAn **experimental** code/text formatter that utilize [Rosie Pattern Language](https://rosie-lang.org) \n\n\u003e still just an idea\n\n### Usage\nGiven this _json5.rpl_ and _json5.yml_\n```dhall\npackage json5\n\nimport word, num\n\nlocal true = \"true\"\nlocal false = \"false\"\nlocal null = \"null\"\n\nstring = word.q\nnumber = num.signed_number\n\nkey = word.any / string\nprimitive_value = string / number / true / false / null\nmember = key \":\" primitive_value \",\"?\nmember_non_null = key \":\" (string / number / true / false) \",\"?\n```\n```yml\nversion: '1'\ngrammar: [json5.rpl]\nrules:\n  no_comma:\n    scope: json5.key \":\" json5.primitive \",\"\n    remove: \",\"\n  null_first:\n    scope: \"{\" json5.memeber \"}\"\n    match_and_place:\n      at_start: \"{\"\n      at_end: \"}\"\n    patterns:\n    - place: json5.key \":\" json5.null \",\"?\n      before: json5.member_non_null\n    - match_and_place:\n        before_end: json5.member_non_null\n```\nthen execute\n```console\n$ echo '{\"a\":123,\"b\":null}' | ufmt --grammar json5.yml --enable null_first,no_comma\n{\n  \"b\": null\n  \"a\": 123\n}\n```\n\n## Inspiration\n- https://github.com/trishume/syntect\n- https://github.com/ul/kak-tree\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrsensor%2Funiversal-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrsensor%2Funiversal-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrsensor%2Funiversal-formatter/lists"}