{"id":20230642,"url":"https://github.com/cdepillabout/highlight","last_synced_at":"2025-07-30T18:06:57.593Z","repository":{"id":22296178,"uuid":"93383322","full_name":"cdepillabout/highlight","owner":"cdepillabout","description":"command line tool for highlighting parts of files that match a regex","archived":false,"fork":false,"pushed_at":"2022-05-26T05:49:49.000Z","size":314,"stargazers_count":4,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-13T01:39:24.678Z","etag":null,"topics":["cli","grep","hacktoberfest","haskell","highlight","highlighting","hrep","regex"],"latest_commit_sha":null,"homepage":"http://hackage.haskell.org/package/highlight","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdepillabout.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-05T08:40:21.000Z","updated_at":"2024-11-16T00:06:58.000Z","dependencies_parsed_at":"2022-09-20T11:24:44.875Z","dependency_job_id":null,"html_url":"https://github.com/cdepillabout/highlight","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cdepillabout/highlight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdepillabout%2Fhighlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdepillabout%2Fhighlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdepillabout%2Fhighlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdepillabout%2Fhighlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdepillabout","download_url":"https://codeload.github.com/cdepillabout/highlight/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdepillabout%2Fhighlight/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267914063,"owners_count":24164638,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"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":["cli","grep","hacktoberfest","haskell","highlight","highlighting","hrep","regex"],"created_at":"2024-11-14T07:43:17.669Z","updated_at":"2025-07-30T18:06:57.542Z","avatar_url":"https://github.com/cdepillabout.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nHighlight\n=========\n\n[![Build Status](https://github.com/cdepillabout/highlight/workflows/CI/badge.svg)](https://github.com/cdepillabout/highlight/actions)\n[![Hackage](https://img.shields.io/hackage/v/highlight.svg)](https://hackage.haskell.org/package/highlight)\n[![Stackage LTS](http://stackage.org/package/highlight/badge/lts)](http://stackage.org/lts/package/highlight)\n[![Stackage Nightly](http://stackage.org/package/highlight/badge/nightly)](http://stackage.org/nightly/package/highlight)\n![BSD3 license](https://img.shields.io/badge/license-BSD3-blue.svg)\n\n`highlight` is a command line program for highlighting parts of a file matching\na regex.\n\nFor example, take a look at the following file:\n\n![non-highlighted file](/img/non-highlighted-file.png?raw=true \"non-highlighted file\")\n\n`highlight` can be used to highlight the regex `cat`:\n\n![simple highlighted file](/img/highlight-simple-example.png?raw=true \"simple highlighted file\")\n\n\u003c!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again --\u003e\n**Table of Contents**\n\n- [Highlight](#highlight)\n    - [Uses](#uses)\n        - [`highlight`](#highlight)\n        - [highlight output from `grep`](#highlight-output-from-grep)\n        - [`hrep`](#hrep)\n    - [Installation](#installation)\n    - [Other ways to highlight parts of files](#other-ways-to-highlight-parts-of-files)\n    - [Contributions](#contributions)\n        - [Additional flags](#additional-flags)\n    - [Development](#development)\n        - [Build](#build)\n        - [Test](#test)\n\n\u003c!-- markdown-toc end --\u003e\n\n\n## Uses\n\nThis package installs two binaries, `highlight` and `hrep`.  The following\nsection explains the main uses of `highlight` and `hrep`.\n\n### `highlight`\n\n`highlight` is used to highlight a given regex in a file, while printing out\nall lines of the file.\n\nThe short example above show how to use `highlight` to highlight a regex in a\nsingle file.  It is also possible to use `highlight` on multiple files at once:\n\n![multiple highlighted files](/img/highlight-multi-file-example.png?raw=true \"multiple highlighted files\")\n\n`highlight` will color and stripe the filenames to make it easier to see which\nline came from which file.  This also shows an example of the `--ignore-case`\noption, which is similar to `grep`'s `--ignore-case` option.\n\n### highlight output from `grep`\n\n`highlight` has a special option for highlighting output from `grep`:\n\n![highlight from grep](/img/highlight-from-grep.png?raw=true \"highlight from grep\")\n\nThis `--from-grep` option will color and stripe filenames, similar to the\nprevious example.\n\n### `hrep`\n\nWith the previous `--from-grep` option to `highlight`, one unfortunate point is\nthat the regex has to be specified twice, once to `grep` and once to\n`highlight`.\n\nThe `hrep` command can solve this for us.  It is just like the `grep` command,\nbut it will color and stripe filenames:\n\n![hrep example](/img/hrep-example.png?raw=true \"hrep example\")\n\n## Installation\n\n`highlight` and `hrep` can be installed with\n[`stack`](https://docs.haskellstack.org/en/stable/README/):\n\n```sh\n$ stack --resolver nightly-2017-07-03 install highlight\n```\n\nBy default, `stack` will install binaries into `~/.local/bin/`.\n\nIt should also be possible to use `cabal` to install this package.\n\n## Other ways to highlight parts of files\n\nIt is possible to highlight lines matching a given regex with `grep` two\ndifferent ways.\n\n1.  Use a special regex that will match any line, but only highlight the part\n    desired.  It would look like this:\n\n    ```sh\n    $ grep 'about|$' file-cats file-dogs file-goats\n    ```\n\n2.  Give a large `--context` flag:\n\n    ```sh\n    $ grep --context 9999 'about' file-cats file-dogs file-goats\n    ```\n\nHowever, neither of these will color and stripe filenames.\n\n## Contributions\n\nFeel free to open an\n[issue](https://github.com/cdepillabout/pretty-simple/issues) or\n[PR](https://github.com/cdepillabout/pretty-simple/pulls) for any\nbugs/problems/suggestions/improvements.\n\n### Additional flags\n\n`highlight` and `hrep` do not currently support all flags and options that\n`grep` does.  Ideally, `highlight` and `hrep` would be drop-in replacements for\n`grep`, supporting all the same flags and options as `grep`.\n\nIf there is a flag or option you frequently use and want supported with\n`highlight` or `hrep`, please feel free to open an issue or PR.  Some\nflags/options will be relatively easy to support, while some may require quite\na large amount of additional code.\n\n## Development\n\n### Build\n\n`highlight` and `hrep` can be built will the following command.  See the\n[Installation](#installation) section above for information about `stack`.\n\n```sh\n$ stack build\n```\n\n### Test\n\nThe tests can be run with the following command:\n\n```sh\n$ stack test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdepillabout%2Fhighlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdepillabout%2Fhighlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdepillabout%2Fhighlight/lists"}