{"id":14966099,"url":"https://github.com/jj/raku-pod-utils","last_synced_at":"2026-01-20T23:02:12.367Z","repository":{"id":56555902,"uuid":"193716300","full_name":"JJ/raku-pod-utils","owner":"JJ","description":"Helper functions to deal with Pod elements.","archived":false,"fork":false,"pushed_at":"2022-12-30T09:05:38.000Z","size":42,"stargazers_count":0,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T15:52:45.718Z","etag":null,"topics":["documentation","perl6","pod","pod6"],"latest_commit_sha":null,"homepage":"","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JJ.png","metadata":{"files":{"readme":"README.md","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":"2019-06-25T13:46:49.000Z","updated_at":"2022-12-30T08:48:47.000Z","dependencies_parsed_at":"2023-01-31T11:01:48.526Z","dependency_job_id":null,"html_url":"https://github.com/JJ/raku-pod-utils","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/JJ/raku-pod-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJ%2Fraku-pod-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJ%2Fraku-pod-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJ%2Fraku-pod-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJ%2Fraku-pod-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JJ","download_url":"https://codeload.github.com/JJ/raku-pod-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JJ%2Fraku-pod-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28618329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T22:24:05.405Z","status":"ssl_error","status_checked_at":"2026-01-20T22:20:31.342Z","response_time":117,"last_error":"SSL_read: 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":["documentation","perl6","pod","pod6"],"created_at":"2024-09-24T13:35:49.465Z","updated_at":"2026-01-20T23:02:12.353Z","avatar_url":"https://github.com/JJ.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME [![Test-install distro](https://github.com/JJ/raku-pod-utils/actions/workflows/test.yaml/badge.svg)](https://github.com/JJ/raku-pod-utils/actions/workflows/test.yaml)\n\nPod::Utils - Set of helper functions to ease working with Pods!\n\n# SYNOPSIS\n\n```perl6\n    use Pod::Utils;\n\n    # time to work with Pod::* elements!\n    say first-subtitle($=pod[0].contents);\n\n    =begin pod\n\n    =SUBTITLE Some cool text\n\n    =end pod\n```\n\n# DESCRIPTION\n\nPod::Utils is a set of routines that help you to deal with Pod elements.\nIt lets you manipulate several kinds of Pod objects, obtain gists and modify\nheadings.\n\n### sub first-code-block\n\n```perl6\nsub first-code-block (\n    Array @pod\n) returns Str;\n```\n\nReturns the first `Pod::Block::Code` found in an array, concatenating all lines in it.\nIf none is found, it will return an empty string.\n\nExample:\n\n```perl6\n=begin pod\n=begin code\n\n    say \"some code\";\n    say \"more code\";\n\n=end code\n=end pod\n\nfirst-code-block($=pod[0].contents)\n\n# OUTPUT «say \"some code\";␤say \"more code\";␤»\n```\n\n### sub first-title\n\n```perl6\nsub first-title (\n    Array @pod\n) returns Pod::Block::Named;\n```\n\nReturns the first `=TITLE` element found in `@pods`.\n\nExample:\n\n```perl6\n=begin pod\n\n=TITLE title\n\n=end pod\n\nfirst-title($=pod[0].contents)\n\n# OUTPUT equivalent to:\n\n=TITLE title\n\n```\n\n### sub first-subtitle\n\n```perl6\nsub first-subtitle (\n    Array @pod\n) returns Pod::Block::Named;\n```\n\nReturns the first `=SUBTITLE` element found in `@pods`.\n\nExample:\n\n```perl6\n=begin pod\n\n=subTITLE subtitle\n\n=end pod\n\nfirst-subtitle($=pod[0].contents)\n\n# OUTPUT equivalent to:\n\n=SUBTITLE subtitle\n\n```\n\n### multi sub textify-guts\n\n```perl6\nmulti textify-guts (Any:U,       ) return Str;\nmulti textify-guts (Str:D      \\v) return Str;\nmulti textify-guts (List:D     \\v) return Str;\nmulti textify-guts (Pod::Block \\v) return Str;\n```\n\nConverts lists of `Pod::Block::*` objects and `Pod::Block` objects to strings.\n\nExample:\n\n```perl6\nmy $block = Pod::Block::Para.new(contents =\u003e [\"block\"]);\nsay textify-guts($block); # OUTPUT «block␤»\nsay textify-guts([$block, $block]); # OUTPUT «block block␤»\n```\n\n### multi sub recurse-until-str\n\n```perl6\nmulti sub recurse-until-str(Str:D $s)      return Str;\nmulti sub recurse-until-str(Pod::Block $n) return Str;\n\n```\n\nAccepts a `Pod::Block::*` object and returns a concatenation of all subpods content.\n\nExample:\n\n```perl6\nmy $block         = Pod::Block::Para.new(contents =\u003e [\"block\"]);\nmy $complex-block = pod-block(\"one\", pod-block(\"two\"), pod-bold(\"three\"));\nsay recurse-until-str($block); # OUTPUT «block␤»\nsay recurse-until-str($complex-block); # OUTPUT «onetwothree␤»\n```\n\n# Pod::Utils::Build\n\n# SYNOPSIS\n\n```perl6\n    use Pod::Utils::Build;\n\n    # time to build Pod::* elements!\n    say pod-bold(\"bold text\");\n```\n\n# DESCRIPTION\n\nPod::Utils::Build is a set of routines that help you to create new\nPod elements.\n\n### sub pod-title\n\n```perl6\nsub pod-title (\n    Str $title,\n) returns Pod::Block::Named;\n```\n\nCreates a new `Pod::Block::Named` object (with `:name` set to `\"TITLE\"`)\nand populates it with a `Pod::Block::Para` containing `$title`.\n\nExample:\n\n```perl6\n\npod-title(\"title\");\n\n# OUTPUT Equivalent to:\n\n=begind pod\n\n=TITLE title\n\n=end pod\n```\n\n### sub pod-with-title\n\n```perl6\nsub pod-with-title (\n    Str $title,\n    Array @blocks\n) returns Pod::Block::Named;\n```\n\nCreates a new `Pod::Block::Named` object (with `:name` set to \"pod\")\nand populate it with a title (using `pod-title`) and `@blocks`.\n\nExample:\n\n```perl6\n\n=begind pod\n\nNormal paragraph\n\n=end pod\n\npod-with-title(\"title\", $=pod.first.contents[0]);\n\n# OUTPUT Equivalent to:\n\n=beging pod\n\n=TITLE title\n\nNormal paragraph\n\n=end pod\n```\n\n### sub pod-block\n\n```perl6\nsub pod-block (\n    Array *@contents\n) returns Pod::Block::Para;\n```\n\nCreates a `Pod::Block::Para` with contents set to `@contents`.\n\nExample:\n\n```perl6\n\n\nsay pod-block(\"title\", Pod::Block::Para.new(contents =\u003e [\"paragraph\"]));\n\n# OUTPUT\n\nPod::Block::Para\n  title\n  Pod::Block::Para\n    paragraph\n\n```\n\n### sub pod-link\n\n```perl6\nsub pod-link (\n    Str $text,\n    Str $url\n) returns Pod::FormattingCode;\n```\n\nCreates a `Pod::FormattingCode` (type Link) with contents set to `$text`.\nand meta set to `$url`.\n\nExample:\n\n```perl6\n\npod-link(\"text\",\"url\");\n\n# OUTPUT Equivalent to:\n\nL\u003ctext|url\u003e\n```\n\n### sub pod-bold\n\n```perl6\nsub pod-bold (\n    Str $text,\n) returns Pod::FormattingCode;\n```\n\nCreates a `Pod::FormattingCode` (type B) with contents set to `$text`.\n\nExample:\n\n```perl6\n\npod-bold(\"text\");\n\n# OUTPUT Equivalent to:\n\nB\u003ctext\u003e\n```\n\n### sub pod-code\n\n```perl6\nsub pod-code (\n    Str $text,\n) returns Pod::FormattingCode;\n```\n\nCreates a `Pod::FormattingCode` (type C) with contents set to `$text`.\n\nExample:\n\n```perl6\n\npod-code(\"text\");\n\n# OUTPUT Equivalent to:\n\nC\u003ctext\u003e\n```\n\n### sub pod-item\n\n```perl6\nsub pod-item (\n    Array *@contents ,\n    Int   :$level = 1,\n) returns Pod::Item;\n```\n\nCreates a `Pod::Item` object with contents set to `@contents` and level to `$level`.\n\nExample:\n\n```perl6\n\npod-item(pod-block(\"item\"), level =\u003e 1);\n\n# OUTPUT Equivalent to:\n\n=item item\n\n```\n\n### sub pod-heading\n\n```perl6\nsub pod-heading (\n    Str   $name,\n    Int   :$level = 1,\n) returns Pod::Heading;\n```\n\nCreates a `Pod::Heading` object with level set `$level` and contents initialized\nwith a `Pod::Block::Para` object containing `$name`.\n\nExample:\n\n```perl6\n\npod-heading(\"heading\", level =\u003e 1);\n\n# OUTPUT Equivalent to:\n\n=head1 heading\n\n```\n\n### sub pod-table\n\n```perl6\nsub pod-table (\n    Array @contents,\n    Array :@headers,\n) returns Pod::Block::Table;\n```\n\nCreates a `Pod::Block::Table` object with the headers `@headers` and rows `@contents`.\n`$caption` is set to `\"\"`.\nExample:\n\n```perl6\n\npod-table([[\"col1\", \"col2\"],], headers =\u003e [\"h1\", \"h2\"]);\n\n# OUTPUT Equivalent to:\n\n=begin table\n\nh1   | h2\n============\ncol1 | col2\n\n=end table\n\n```\n\n### sub pod-lower-headings\n\n```perl6\nsub pod-lower-headings (\n    Array @content,\n    Int   :$to,\n) returns Array;\n```\n\nGiven an array of Pod objects, lower the level of every heading following\nthe next formula =\u003e `current-level - $by + $to`, where `$by` is the level of the\nfirst heading found in the array.\n\nExample:\n\n```perl6\n\nmy @contents = [\n    pod-heading(\"head\", level =\u003e 2),\n    pod-heading(\"head\", level =\u003e 3)\n];\n\npod-lower-headings(@contents)\n\n# OUTPUT Equivalent to:\n\n=head1 head\n\n=head2 head\n\n```\n\n# AUTHORS\n\nAlexander Mouquin \u003c@Mouq\u003e\n\nWill Coleda \u003c@coke\u003e\n\nRob Hoelz \u003c@hoelzro\u003e\n\n\u003c@timo\u003e\n\nMoritz Lenz \u003c@moritz\u003e\n\nJuan Julián \u003c@JJ\u003e\n\n\u003c@MasterDuke17\u003e\n\nZoffix Znet \u003c@zoffixznet\u003e\n\nAntonio \u003c@antoniogamiz\u003e\n\n# COPYRIGHT AND LICENSE\n\nCopyright 2019 Perl 6 team\n\nThis library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjj%2Fraku-pod-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjj%2Fraku-pod-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjj%2Fraku-pod-utils/lists"}