{"id":15168590,"url":"https://github.com/ciavash/pod-contents","last_synced_at":"2025-10-01T00:32:26.339Z","repository":{"id":147482198,"uuid":"411243281","full_name":"CIAvash/Pod-Contents","owner":"CIAvash","description":"Pod::Contents - a Raku module for getting Pod contents as a list of strings or string","archived":true,"fork":false,"pushed_at":"2021-09-28T11:03:23.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-30T17:37:07.051Z","etag":null,"topics":["module","pod","raku","rakulang"],"latest_commit_sha":null,"homepage":"https://codeberg.org/CIAvash/Pod-Contents","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CIAvash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2021-09-28T10:55:21.000Z","updated_at":"2024-03-30T12:39:16.000Z","dependencies_parsed_at":"2023-07-25T01:16:45.768Z","dependency_job_id":null,"html_url":"https://github.com/CIAvash/Pod-Contents","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"ed961dc3ad4355432c16bc74c37d4202a932e147"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FPod-Contents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FPod-Contents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FPod-Contents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FPod-Contents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CIAvash","download_url":"https://codeload.github.com/CIAvash/Pod-Contents/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234803486,"owners_count":18889263,"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":["module","pod","raku","rakulang"],"created_at":"2024-09-27T06:23:20.575Z","updated_at":"2025-10-01T00:32:21.074Z","avatar_url":"https://github.com/CIAvash.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n====\n\nPod::Contents - a [Raku](https://www.raku-lang.ir/en) module for getting Pod contents as a list or string.\n\nDESCRIPTION\n===========\n\nPod::Contents is a [Raku](https://www.raku-lang.ir/en) module for getting the Pod contents as a list of strings or string.\n\nPod formatters can get inlined, pod contents can be indented (with custom level) and joined with a custom\nstring and titles can be included for `table` headers and `defn` terms.\n\nSYNOPSIS\n========\n\n```raku\nuse Pod::Contents:auth\u003czef:CIAvash\u003e;\n\n=NAME My App\n\n=DESCRIPTION An B\u003capp\u003e that does U\u003cstuff\u003e\n\n=begin pod\n=head1 A heading\n\n=item An B\u003citem\u003e\n=begin item2\nAnother C\u003citem\u003e\n\n=begin table\nhcell00 | hcell01\n=================\ncell11  | cell12\ncell21  | cell22\n=end table\n\n     my $app;\n     say 'some code';\n\n=end item2\n\n=end pod\n\nput $=pod.\u0026join_pod_contents_of: 'NAME';\n=output My App␤\n\nput $=pod.\u0026get_first_pod('NAME').\u0026join_pod_contents;\n=output My App␤\n\nput $=pod[0].\u0026join_pod_contents;\n=output My App␤\n\nput $=pod[0].\u0026get_pod_contents.join(\"\\n\\n\");\n=output My App␤\n\nput $=pod.\u0026join_pod_contents_of: 'DESCRIPTION';\n=output An app that does stuff␤\n\nput $=pod.\u0026join_pod_contents_of: 'DESCRIPTION', :!inline_formatters;\n=output An ␤␤app␤␤ that does ␤␤stuff␤\n\nput $=pod.\u0026join_pod_contents_of: 'DESCRIPTION', \"\\n\", :!inline_formatters;\n=output An ␤app␤ that does ␤stuff␤\n\nput $=pod.\u0026get_pod_contents_of('DESCRIPTION', :!inline_formatters).raku;\n=output (\"An \", \"app\", \" that does \", \"stuff\")␤\n\nput $=pod.\u0026get_first_pod('pod').\u0026join_pod_contents_of: Pod::Heading;\n=output A heading␤\n\nput $=pod.\u0026join_pod_contents_of: Pod::Item, :recurse;\n=output An item␤\n\nput $=pod.\u0026get_pod_contents_of(Pod::Block::Table, :recurse).raku;\n=output ((\"cell11\", \"cell12\"), (\"cell21\", \"cell22\"))␤\n\nput $=pod.\u0026get_pod_contents_of(Pod::Block::Table, :recurse, :include_title).raku;\n=output ((\"hcell00\", \"hcell01\"), (\"cell11\", \"cell12\"), (\"cell21\", \"cell22\"))␤\n\nput $=pod.\u0026join_pod_contents_of: Pod::Block::Table, :recurse;\n=output cell11 cell12␤cell21 cell22␤\n\nput $=pod.\u0026join_pod_contents_of: Pod::Block::Table, :recurse, :include_title;\n=output hcell00 hcell01␤cell11 cell12␤cell21 cell22␤\n\nput $=pod.\u0026join_pod_contents_of: Pod::Block::Code, :recurse;\n=output my $app;␤say 'some code'␤\n\nput $=pod.\u0026join_pod_contents_of: Pod::Block::Code, :indent_content, :recurse;\n=output     my $app;␤    say 'some code'␤\n\nput $=pod.\u0026get_first_pod('pod').contents.grep(Pod::Item)[1].\u0026join_pod_contents(:indent_content);\n=output     Another item␤␤   cell11 cell12␤cell21 cell22␤␤        my $app;␤        say 'some code'␤\n\nput $=pod.\u0026get_first_pod('pod').\u0026get_pods(Pod::Item)[1].\u0026join_pod_contents(:indent_content, :indent_level(2));\n=output   Another item␤␤ cell11 cell12␤cell21 cell22␤␤      my $app;␤      say 'some code'␤\n\nput $=pod.\u0026get_pods(Pod::Item, :recurse)[1].\u0026join_pod_contents(:indent_content, :indent_level(2));\n=output   Another item␤␤ cell11 cell12␤cell21 cell22␤␤      my $app;␤      say 'some code'␤\n```\n\nINSTALLATION\n============\n\nYou need to have [Raku](https://www.raku-lang.ir/en) and [zef](https://github.com/ugexe/zef), then run:\n\n```console\nzef install --/test Pod::Contents:auth\u003czef:CIAvash\u003e\n```\n\nor if you have cloned the repo:\n\n```console\nzef install .\n```\n\nTESTING\n=======\n\n```console\nprove -ve 'raku -I.' --ext rakutest\n```\n\nSUBS\n====\n\n## sub get_pod_contents_of\n\n```raku\nsub get_pod_contents_of(\n    $pod where { ... },\n    $thing where { ... },\n    Bool :$recurse,\n    |c\n) returns List:D\n```\n\nReturns a list of pod contents.\n\n- Can recursively find pod with `:recurse`.\n- Can indent pod contents with `:indent_content`.\n- Can include pod titles with `:include_title`.\n- Can disable inlining pod formatters with `:!inline_formatters`.\n- Can put same level items next to each other with `:adjacent_items`.\n\n## sub join_pod_contents_of\n\n```raku\nsub join_pod_contents_of(\n    $pod where { ... },\n    $thing where { ... },\n    Bool :$recurse,\n    |c\n) returns Str:D\n```\n\nJoins pod contents of the requested Pod with the passed string or 2 newlines.\n\n- Can recursively find pod with `:recurse`.\n- Can indent pod contents with `:indent_content`.\n- Can include pod titles with `:include_title`.\n- Can disable inlining pod formatters with `:!inline_formatters`.\n- Can put same level items next to each other with `:adjacent_items`.\n\n## sub get_first_pod\n\n```raku\nsub get_first_pod(\n    $pod where { ... },\n    $thing where { ... },\n    Bool :$recurse\n) returns Pod::Contents::POD\n```\n\nFinds the first Pod using the passed `pod` or `name`, does so recursively if `:recurse` is passed.\n\n## sub get_pods\n\n```raku\nsub get_pods(\n    $pod where { ... },\n    $thing where { ... },\n    Bool :$recurse\n) returns List:D\n```\n\nFinds all Pods using the passed `pod` or `name`, does so recursively if `:recurse` is passed\n\n## sub get_pod_contents\n\n```raku\nsub get_pod_contents(\n    |\n) returns Mu\n```\n\nRecursively gets the Pod contents of a Pod block as a list of (list of) strings.\n\n- Can indent pod contents with `:indent_content`.\n- Can include pod titles with `:include_title`.\n- Can disable inlining pod formatters with `:!inline_formatters`.\n- Can put same level items next to each other with `:adjacent_items`.\n\n## sub check_pod\n\n```raku\nsub check_pod(\n    $pod where { ... },\n    $pod_type where { ... }\n) returns Bool is export(:helpers)\n```\n\nReturns `True` if `pod` matches `pod_type`\n\n## sub indent_content\n\n```raku\nsub indent_content(\n    Str:D $string,\n    Int:D $indent_level where { ... } = 4\n) returns Str is export(:helpers)\n```\n\nIndents `string` by `indent_level`\n\nREPOSITORY\n==========\n\n[https://github.com/CIAvash/Pod-Contents/](https://github.com/CIAvash/Pod-Contents/)\n\nBUG\n===\n\n[https://github.com/CIAvash/Pod-Contents/issues](https://github.com/CIAvash/Pod-Contents/issues)\n\nAUTHOR\n======\n\nSiavash Askari Nasr - [https://www.ciavash.name](https://www.ciavash.name)\n\nCOPYRIGHT\n=========\n\nCopyright © 2021 Siavash Askari Nasr\n\nLICENSE\n=======\n\nThis file is part of Pod::Contents.\n\nPod::Contents is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nPod::Contents is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License along with Pod::Contents. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciavash%2Fpod-contents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fciavash%2Fpod-contents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciavash%2Fpod-contents/lists"}