{"id":32211813,"url":"https://github.com/ildar-shaimordanov/indent-pm","last_synced_at":"2025-10-22T06:55:54.582Z","repository":{"id":56840593,"uuid":"114538339","full_name":"ildar-shaimordanov/indent-pm","owner":"ildar-shaimordanov","description":"Text::Indent::Tiny - tiny and flexible indentation across modules","archived":false,"fork":false,"pushed_at":"2020-10-22T17:25:02.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-20T23:17:38.303Z","etag":null,"topics":["indent","indentation","perl","perl-module","text","text-indent"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/Text::Indent::Tiny","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/ildar-shaimordanov.png","metadata":{"files":{"readme":"README","changelog":"Changes","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-12-17T13:27:23.000Z","updated_at":"2020-10-21T13:26:02.000Z","dependencies_parsed_at":"2022-08-29T01:51:20.233Z","dependency_job_id":null,"html_url":"https://github.com/ildar-shaimordanov/indent-pm","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"purl":"pkg:github/ildar-shaimordanov/indent-pm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ildar-shaimordanov%2Findent-pm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ildar-shaimordanov%2Findent-pm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ildar-shaimordanov%2Findent-pm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ildar-shaimordanov%2Findent-pm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ildar-shaimordanov","download_url":"https://codeload.github.com/ildar-shaimordanov/indent-pm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ildar-shaimordanov%2Findent-pm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280395516,"owners_count":26323515,"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-10-22T02:00:06.515Z","response_time":63,"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":["indent","indentation","perl","perl-module","text","text-indent"],"created_at":"2025-10-22T06:55:47.812Z","updated_at":"2025-10-22T06:55:54.575Z","avatar_url":"https://github.com/ildar-shaimordanov.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    Text::Indent::Tiny - tiny and flexible indentation across modules\n\nVERSION\n    This module version is 0.1.2.\n\nSYNOPSIS\n    Simple usage:\n\n            use Text::Indent::Tiny;\n\n            my $indent = Text::Indent::Tiny-\u003enew(\n                    eol     =\u003e 1,\n                    size    =\u003e 1,\n                    level   =\u003e 2,\n            );\n\n    Cross-module usage:\n\n            use Text::Indent::Tiny (\n                    eol     =\u003e 1,\n                    size    =\u003e 1,\n                    level   =\u003e 2,\n            );\n\n            my $indent = Text::Indent::Tiny-\u003einstance;\n\n    Another and more realistic way of the cross-module usage:\n\n            use Text::Indent::Tiny;\n\n            my $indent = Text::Indent::Tiny-\u003einstance(\n                    eol     =\u003e 1,\n                    size    =\u003e 1,\n                    level   =\u003e 2,\n            );\n\nDESCRIPTION\n    The module is designed to be used for printing indentation in the\n    simplest way as much as possible. It provides methods for turning on/off\n    indentation and output using the current indentation.\n\n    The module design was invented during discussion on the PerlMonks board\n    at \u003chttps://perlmonks.org/?node_id=1205367\u003e. Monks suggested to name the\n    methods for increasing and decreasing indents in the POD-like style.\n    Also they inspired to \"use overload\".\n\nINSTANTIATING\n  Constructor new()\n    The constructor is used for creating the indentaion object. If you need\n    to use indentaion in one style across modules, initialize the indent\n    object in the main program and instatiate it in other modules with the\n    method instance().\n\n    To construct a new Text::Indent::Tiny object, invoke the new method\n    passing the following options as a hash:\n\n    level\n        The initial indentation level. Defaults to 0 (meaning no indent).\n        The specified initial level means the left edge which cannot be\n        crossed at all. So any any indents will be estimated from this\n        level.\n\n    size\n        The number of indent spaces used for each level of indentation. If\n        not specified, the $Text::Indent::Tiny::DefaultSize is used.\n\n    tab The flag to use \"TAB\" as indent.\n\n    text\n        The arbitrary text that is assumed to be indentation.\n\n    eol If specified, tell the item method to add automatically new lines to\n        the input arguments.\n\n    The options text, tab and size have impact on the same stuff. When\n    specified, text has the highest priority. If tab is specified, it\n    cancels size and any other characters in favor of \"TAB\".\n\n  Singleton instance()\n    This method returns the current object instance or create a new one by\n    calling the constructor. In fact, it implements a singleton restricting\n    the only instance across a program and its modules. It allows the same\n    set of arguments as the constructor.\n\nMETHODS\n    The following methods are used for handling with indents: increasing,\n    decreasing, resetting them and applying indents to strings.\n\n    There are two naming styles. The first one is a POD-like style, the\n    second one is more usual.\n\n    Calling the methods in a void context is applied to the instance itself.\n    If the methods are invoked in the scalar context, a new instance is\n    created in this context and changes are applied for this instance only.\n    See for details the Examples 1 and 2.\n\n  over(), increase()\n    Increase the indentation by one or more levels. Defaults to 1.\n\n  back(), decrease()\n    Decrease the indentation by one or more levels. Defaults to 1.\n\n  cut(), reset()\n    Reset all indentations to the initial level (as it has been set in the\n    cunstructor).\n\n  item()\n    This method returns all arguments indented. Accordingly the eol option\n    and the configured $\\ variable it appends all but last arguments with\n    new line.\n\n  Example\n            use Text::Indent::Tiny;\n            my $indent = Text::Indent::Tiny-\u003enew;\n\n            # Let's use newline per each item\n            $\\ = \"\\n\";\n\n            # No indent\n            print $indent-\u003eitem(\"Poem begins\");\n\n            # Indent each line with 4 spaces (by default)\n            $indent-\u003eover;\n            print $indent-\u003eitem(\n                    \"To be or not to be\",\n                    \"That is the question\",\n            );\n            $indent-\u003eback;\n\n            # Indent the particular line locally to 5th level (with 20 spaces)\n            print $indent-\u003eover(5)-\u003eitem(\"William Shakespeare\");\n\n            # No indent\n            print $indent-\u003eitem(\"Poem ends\");\n\nVARIABLES\n    $Text::Indent::Tiny::DefaultSpace\n        The text to be used for indentation. Defaults to one \"SPACE\"\n        character.\n\n    $Text::Indent::Tiny::DefaultSize\n        The number of indent spaces used for each level of indentation.\n        Defaults to 4.\n\nOVERLOADING\n    Some one could find more convenient using the indents as objects of\n    arithmetic operations and/or concatenated strings.\n\n    The module overloads the following operations:\n\n    \"\"  Stringify the indentation.\n\n    \"+\" Increase the indentation.\n\n    \"-\" Decrease the indentation.\n\n    \".\" The same as \"$indent-\u003eitem()\".\n\n  Example\n    So using the overloading the above example can looks more expressive:\n\n            use Text::Indent::Tiny;\n            my $indent = Text::Indent::Tiny-\u003enew;\n\n            # Let's use newline per each item\n            $\\ = \"\\n\";\n\n            # No indent\n            print $indent . \"Poem begins\";\n\n            # Indent each line with 4 spaces (by default)\n            print $indent + 1 . [\n                    \"To be or not to be\",\n                    \"That is the question\",\n            ];\n\n            # Indent the particular line locally to 5th level (with 20 spaces)\n            print $indent + 5 . \"William Shakespeare\";\n\n            # No indent\n            print $indent . \"Poem ends\";\n\nSEE ALSO\n    Text::Indent\n\n    Print::Indented\n\n    String::Indent\n\n    Indent::Block\n\n    Indent::String\n\nACKNOWLEDGEMENTS\n    Thanks to PerlMonks community for suggesting good ideas.\n\n    \u003chttps://perlmonks.org/?node_id=1205367\u003e\n\nAUTHOR\n    Ildar Shaimordanov, \"\u003cildar.shaimordanov at gmail.com\u003e\"\n\nLICENSE AND COPYRIGHT\n    This software is Copyright (c) 2020 by Ildar Shaimordanov.\n\n    This program is released under the following license:\n\n      MIT License\n\n      Copyright (c) 2017-2020 Ildar Shaimordanov\n\n      Permission is hereby granted, free of charge, to any person obtaining a copy\n      of this software and associated documentation files (the \"Software\"), to deal\n      in the Software without restriction, including without limitation the rights\n      to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n      copies of the Software, and to permit persons to whom the Software is\n      furnished to do so, subject to the following conditions:\n\n      The above copyright notice and this permission notice shall be included in all\n      copies or substantial portions of the Software.\n\n      THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n      AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n      LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n      SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fildar-shaimordanov%2Findent-pm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fildar-shaimordanov%2Findent-pm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fildar-shaimordanov%2Findent-pm/lists"}