{"id":25802961,"url":"https://github.com/thomas-hiron/cmp-html-class","last_synced_at":"2026-05-03T07:44:16.451Z","repository":{"id":224504131,"uuid":"763429559","full_name":"thomas-hiron/cmp-html-class","owner":"thomas-hiron","description":"nvim-cmp source for html classes autocompletion ","archived":false,"fork":false,"pushed_at":"2024-04-21T09:34:50.000Z","size":164,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-21T10:59:08.772Z","etag":null,"topics":["neovim","neovim-plugin","neovim-plugin-lua","nvim-cmp"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/thomas-hiron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-26T09:27:01.000Z","updated_at":"2024-04-21T09:34:53.000Z","dependencies_parsed_at":"2024-03-10T12:40:11.258Z","dependency_job_id":null,"html_url":"https://github.com/thomas-hiron/cmp-html-class","commit_stats":null,"previous_names":["thomas-hiron/cmp-html-class"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas-hiron%2Fcmp-html-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas-hiron%2Fcmp-html-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas-hiron%2Fcmp-html-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas-hiron%2Fcmp-html-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomas-hiron","download_url":"https://codeload.github.com/thomas-hiron/cmp-html-class/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241039595,"owners_count":19898715,"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":["neovim","neovim-plugin","neovim-plugin-lua","nvim-cmp"],"created_at":"2025-02-27T17:36:58.105Z","updated_at":"2026-05-03T07:44:16.444Z","avatar_url":"https://github.com/thomas-hiron.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cmp-html-class\n\n### ⚠️  This repo has been moved ⚠️\n\nThis code has been merged to https://github.com/thomas-hiron/cmp-symfony.\n\n---\n\n[nvim-cmp](https://github.com/hrsh7th/nvim-cmp) source for html classes.  \nThis plugin autocompletes class tags using a pre-generated json file.  \n\n![Autocomplete](./docs/autocomplete.png)\n\n## Prerequisites\nA json file must be generated first. It contains one json object\nper line, with two keys:\n- _class_: the html class to autocomplete\n- _files_: a json array containing all files where this class is\ndefined\n\nHere is an example:\n```json\n{\"class\":\"my-first-class\",\"files\":[\"/path/to/file.css\",\"/path/to/file.min.css\"]}\n{\"class\":\"my-second-class\",\"files\":[\"/path/to/file.css\"]}\n```\n\n## Generate the json file\nThe file is generated with this bash script:\n```bash\ntemp_dir=$(mktemp -d)\n\n# Get all classes in css files, in json format, then use jq to get all matching\n# results and format them: {\"class\":\"my-first-class\",\"file\":\"/path/to/file.css\"}\nrg \"\\.[a-z][a-z0-9-]{3,}\" -tcss --no-filename --json assets | jq -c '. \n                                    | select(.type == \"match\") \n                                    | {class: .data.submatches[].match.text, file: .data.path.text}' \u003e $temp_dir/raw.json\n\n# Sort and uniq input file\ncat $temp_dir/raw.json | sort | uniq \u003e $temp_dir/uniq.json\n\n# Group results by class name and add a files key containing all files\ncat $temp_dir/uniq.json | jq -sc 'map(. + {data: [{class: [.class], file: [.file]}]})\n                                    | group_by(.class)[]\n                                    | .[0] + {files: [.[].data[].file | add]}\n                                    | del (.data, .file)' \u003e $temp_dir/grouped.json\n\n# Remove trailing dot in class name\nsed -i 's/\"\\./\"/' $temp_dir/grouped.json\n\nmv $temp_dir/grouped.json ~/generated_html_classes.json\n```\n\n## Setup\n\n```lua\nrequire('cmp').setup({\n  sources = {\n    { name = 'html_class' },\n  },\n})\n```\n\n## Triggers\n\nThe plugin is activated for `twig` and `html` filetypes.  \nAutocompletion is triggered for double quotes and space\ncharacters.\n\n## Configuration\n\nThere is no configuration at the moment.\n\n## Todo\n\n- Configure filetypes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomas-hiron%2Fcmp-html-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomas-hiron%2Fcmp-html-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomas-hiron%2Fcmp-html-class/lists"}