{"id":15286149,"url":"https://github.com/trapd00r/term-hr","last_synced_at":"2026-02-17T14:00:58.972Z","repository":{"id":57677592,"uuid":"489936273","full_name":"trapd00r/Term-hr","owner":"trapd00r","description":"Perl module that lets you define a thematic change in content of a terminal session","archived":false,"fork":false,"pushed_at":"2024-06-08T08:05:54.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-04T01:55:21.738Z","etag":null,"topics":["perl","terminal"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trapd00r.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,"publiccode":null,"codemeta":null}},"created_at":"2022-05-08T12:23:20.000Z","updated_at":"2022-05-08T13:29:26.000Z","dependencies_parsed_at":"2024-09-30T15:11:42.607Z","dependency_job_id":"b1dcbb2a-cf8b-4e14-b2c2-c97532939e7b","html_url":"https://github.com/trapd00r/Term-hr","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"76741c4215ae95cf2b1dfbc195d344050c0d2ffb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trapd00r/Term-hr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2FTerm-hr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2FTerm-hr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2FTerm-hr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2FTerm-hr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trapd00r","download_url":"https://codeload.github.com/trapd00r/Term-hr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapd00r%2FTerm-hr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29546746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T13:00:00.370Z","status":"ssl_error","status_checked_at":"2026-02-17T12:57:14.072Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["perl","terminal"],"created_at":"2024-09-30T15:10:46.723Z","updated_at":"2026-02-17T14:00:58.888Z","avatar_url":"https://github.com/trapd00r.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nTerm::hr - define a thematic change in the content of a terminal session\n\n# SYNOPSIS\n\n```perl\n    use Term::hr {\n      char      =\u003e '=',   # character to use\n      fg        =\u003e 'fg',  # foreground color, fg = default fg color\n      bg        =\u003e 'bg',  # background color, bg = default bg color\n      bold      =\u003e 0,     # no bold attribute\n      crlf      =\u003e 1,     # add a newline to the returned hr\n      italic    =\u003e 0,     # no italic attribute\n      post      =\u003e 0,     # post whitespace\n      pre       =\u003e 0,     # pre whitespace\n      reverse   =\u003e 0,     # reverse video attribute\n      underline =\u003e 0,     # underline attribute\n      width     =\u003e 80,    # total width of the hr\n    };\n\n    ...\n    print hr();\n    ...\n```\n\n# DESCRIPTION\n\n![screenshot](/img/hr01.png)\n\nTerm::hr exports a single function into the callers namespace, `hr`.\nIt exposes a feature very similar to the HTML \u0026lt;hr\u003e tag; a simple way\nto define a thematic change in content.\n\nIt gives you a way to divide output into sections when you or your program\nproduces a lot of output.\n\nNormally one might want to define the looks of the hr a single time, in the\nbeginning of a program. That way, every invocation will be styled the same.\n\nYou can do that in the same statement as the use statement, as seen above.\n\nThere are however many reasons why you might want to setup a bunch of options as\nyour defaults, and later in your program modify them a bit to suit your needs.\n\nMany different possibilities and combinations is allowed, see below.\n\n# EXAMPLES\n\n```perl\n    use Term::hr;\n    use Term::Size;\n\n    my $hr = hr(\n      {\n        char   =\u003e '#',\n        fg     =\u003e 197,\n        bg     =\u003e 'bg',\n        bold   =\u003e 1,\n        italic =\u003e 1,\n        width  =\u003e ((Term::Size::chars())[0] / 4),\n        pre    =\u003e 1,\n        post   =\u003e 1,\n        crlf   =\u003e 1,\n      },\n    );\n\n    print $hr;\n```\n\nBecause the hr above was crafted with provided options at invocation time,\nthey are temporary. This means that the hr below will have all **module** default\noptions, except for the character.\n\n```perl\n    my $another_hr = hr('_');\n    print $another_hr;\n```\n\nIf you wanted to change the character, but keep all the other options\nyou crafted, set the options at use-time instead:\n\n```perl\n    use Term::hr {\n      fg        =\u003e 196,  # foreground color, fg = default fg color\n      bg        =\u003e 220,  # background color, bg = default bg color\n    };\n\n    # uses '=' as character\n    print hr();\n\n    # use another one\n    my $hr = hr('_');\n```\n\nCombinations are possible, as well as unicode:\n\n```perl\n    use Term::hr {\n      fg     =\u003e 197,\n      bold   =\u003e 1,\n      italic =\u003e 1,\n      crlf   =\u003e 1,\n    };\n\n    print hr();\n    print hr({char =\u003e '𝄘', italic =\u003e 0});\n    print hr('𝄘');\n    print hr({char =\u003e '𝄘', italic =\u003e 0, underline =\u003e 1,});\n    print hr({char =\u003e '𝄘', reverse =\u003e 1, underline =\u003e 1,});\n\n```\n\n```bash\n\n    $ ls; perl -MTerm::hr -E 'say hr({char=\u003e\"🌎\",width=\u003e15})'; date\n```\n\nCreate a shell alias:\n\n```bash\n    $ alias hr\"=perl -MTerm::hr -E 'say hr({fg=\u003e196, char=\u003e q[ ], bold=\u003e1,underline=\u003e1,italic=\u003e1})'\"\n    $ cat /var/log/Xorg.0.log; hr; ls\n```\n\n# Options and attributes\n\nThese are options that can be passed to hr as a key-value hash.\n\n## char\n\nThe character to use to build up the hr.\nDefaults to '='.\n\n## width, size\n\nThe total width of the hr, including pre and post.\nDefaults to 80.\n\n## fg\n\nForeground color.\nDefaults to your default terminal foreground color.\n\n## bg\n\nBackground color.\nDefaults to your default terminal background color.\n\n## crlf\n\nIf provided with a non-zero value, a newline will be added to the end of the hr.\nDefaults to no newline added.\n\n## pre\n\nAmount of whitespace to add before the hr string.\nDefaults to zero.\n\n## post\n\nAmount of whitespace to add after the hr string.\nDefaults to zero.\n\n## bold\n\nIf provided with a non-zero value, bold attribute will be added.\nDefaults to zero.\n\n## italic\n\nIf provided with a non-zero value, italic attribute will be added.\nDefaults to zero.\n## underline\n\nIf provided with a non-zero value, underline attribute will be added.\nDefaults to zero.\n\n## reverse\n\nIf provided with a non-zero value, reverse video attribute will be added.\nDefaults to zero.\n\n# AUTHOR\n\n    Magnus Woldrich\n    CPAN ID: WOLDRICH\n    m@japh.se\n    http://japh.se\n    http://github.com/trapd00r\n\n# COPYRIGHT\n\nCopyright 2022 **THIS APPLICATION**s [\"AUTHOR\"](#author) and [\"CONTRIBUTORS\"](#contributors) as listed\nabove.\n\n# LICENSE\n\nThis program is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrapd00r%2Fterm-hr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrapd00r%2Fterm-hr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrapd00r%2Fterm-hr/lists"}