{"id":50679220,"url":"https://github.com/gerph/nano-colour","last_synced_at":"2026-06-08T17:32:13.733Z","repository":{"id":353128471,"uuid":"1217480620","full_name":"gerph/nano-colour","owner":"gerph","description":"Colour files using nanorc syntax colouring","archived":false,"fork":false,"pushed_at":"2026-05-07T23:57:13.000Z","size":102,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-08T01:32:39.247Z","etag":null,"topics":["nanorc-rcfiles","syntax-highlighting"],"latest_commit_sha":null,"homepage":"","language":"Perl","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/gerph.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-21T23:43:25.000Z","updated_at":"2026-05-03T02:01:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gerph/nano-colour","commit_stats":null,"previous_names":["gerph/nano-colour"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gerph/nano-colour","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fnano-colour","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fnano-colour/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fnano-colour/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fnano-colour/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerph","download_url":"https://codeload.github.com/gerph/nano-colour/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Fnano-colour/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34073776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["nanorc-rcfiles","syntax-highlighting"],"created_at":"2026-06-08T17:32:13.180Z","updated_at":"2026-06-08T17:32:13.724Z","avatar_url":"https://github.com/gerph.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nano-colour - colouring files using nanorc definitions\n\nThis repository provides a Perl-based syntax highlighter that leverages `nanorc` configuration files to provide ANSI-colored output in the terminal.\n\n## Purpose\n\nThe primary tool in this repository is `nano-colour`. It was designed to bring `nano`-style syntax highlighting to the command line, allowing you to view highlighted source code directly in your terminal or pipe it to other tools.\n\n## Features\n\n- **Syntax Auto-discovery**: Automatically selects the correct highlighting rules based on the file extension.\n- **Support for `nanorc` Syntax**: Parses standard `nanorc` files, supporting:\n  - Single-line regex rules (`color`, `icolor`).\n  - Multi-line rules (`start=\"...\" end=\"...\"`).\n  - Foreground and background color combinations.\n  - `bright` color modifiers.\n- **Flexible Input**:\n  - Highlights files by name.\n  - Supports reading from `STDIN` (when syntax is specified).\n- **Customizable Syntax Path**: Uses the `NANOCOLOUR_DIR` environment variable to locate highlighting definitions.\n\n## Installation\n\nThe `nano-colour` script is a standalone Perl script. Ensure you have Perl installed on your system.\n\n```bash\n# Add the script to your path or run it directly\nchmod +x nano-colour\n```\n\n## Usage\n\n### Basic Usage\nTo highlight a file, provide the filename and the directory containing `.nanorc` files:\n\n```bash\n./nano-colour myfile.pl examples/\n```\n\n### Using Environment Variables\nYou can set `NANOCOLOUR_DIR` to avoid passing the directory every time:\n\n```bash\nexport NANOCOLOUR_DIR=$(pwd)/examples\n./nano-colour myfile.pl\n```\n\n### Specifying Syntax Manually\nUse the `-s` or `--syntax` option to force a specific highlighting scheme:\n\n```bash\n./nano-colour -s perl myfile.txt\n```\n\n### Highlighting from STDIN\nWhen a syntax is forced, `nano-colour` can read from standard input:\n\n```bash\ncat myfile.pl | ./nano-colour -s perl\n```\n\n## Examples\n\nThe `examples/` directory contains a variety of `nanorc` definitions for popular formats, including:\n- Bash, C, HTML, JavaScript, JSON, Lua, Makefile, Markdown, Perl, Python, XML, YAML, and even `nanorc` itself.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Fnano-colour","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerph%2Fnano-colour","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Fnano-colour/lists"}