{"id":20500509,"url":"https://github.com/poti1/pod-query","last_synced_at":"2025-03-05T19:29:55.191Z","repository":{"id":38976456,"uuid":"493585832","full_name":"poti1/pod-query","owner":"poti1","description":"Query POD information from a file","archived":false,"fork":false,"pushed_at":"2024-10-13T16:40:52.000Z","size":210,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T06:58:26.510Z","etag":null,"topics":["hacktoberfest","parser","perl","perl5","perldoc","pod"],"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/poti1.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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-18T09:00:01.000Z","updated_at":"2024-10-13T16:40:55.000Z","dependencies_parsed_at":"2025-01-16T06:49:57.525Z","dependency_job_id":"bac8a01d-bc55-42de-b9a9-aae7011bb1a8","html_url":"https://github.com/poti1/pod-query","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poti1%2Fpod-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poti1%2Fpod-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poti1%2Fpod-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poti1%2Fpod-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poti1","download_url":"https://codeload.github.com/poti1/pod-query/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242091014,"owners_count":20070268,"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":["hacktoberfest","parser","perl","perl5","perldoc","pod"],"created_at":"2024-11-15T18:21:05.508Z","updated_at":"2025-03-05T19:29:55.171Z","avatar_url":"https://github.com/poti1.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nPod::Query - Query pod documents\n\n# SYNOPSIS\n\nQuery POD information from a file\n\n    % perl -MPod::Query -E 'say for Pod::Query-\u003enew(\"ojo\")-\u003efind(\"head1[0]\")'\n\n    NAME\n    ojo - Fun one-liners with Mojo\n\n    % perl -MPod::Query -E 'say Pod::Query-\u003enew(\"ojo\")-\u003efind(\"head1[0]/Para[0]\")'\n\n    ojo - Fun one-liners with Mojo\n\n    % perl -MPod::Query -E 'say Pod::Query-\u003enew(shift)-\u003efind(\"head1[0]/Para[0]\")' my.pod\n\nFind Methods:\n\n        find_title;\n        find_method;\n        find_method_summary;\n        find_events;\n        find($query_sting);\n        find(@query_structs);\n\n# DESCRIPTION\n\nThis module takes a class name, extracts the POD\nand provides methods to query specific information.\n\n# SUBROUTINES/METHODS\n\n## \\_has\n\nGenerates class accessor methods (like Mojo::Base::attr)\n\n## path\n\nPath to the pod class file\n\n## lol\n\nList of lists (LOL) structure of the pod file.\nResult of Pod::LOL.\n\n## tree\n\nAn hierarchy is added to the lol to create a\ntree like structure of the pod file.\n\n## class\\_is\\_path\n\nFlag to indicate if the class is really a path to the file.\n\n## new\n\nCreate a new object.\nReturn value is cached (based on the class of the pod file).\n\n        use Pod::Query;\n        my $pod = Pod::Query-\u003enew('Pod::LOL', PATH_ONLY=0);\n\nPATH\\_ONLY can be used to determine the path to the pod\ndocument without having to do much unnecessary work.\n\n## \\_class\\_to\\_path\n\nGiven a class name, returns the path to the pod file.\nReturn value is cached (based on the class of the pod file).\n\nIf the class is not found in INC, it will be checked whether\nthe input is an existing file path.\n\nReturns an empty string if there are any errors.\n\n## \\_mock\\_root\n\nFor debugging and/or testing.\nBuilds a sample object (overwrite this in a test file).\n\n## \\_flatten\\_for\\_tags\n\nRemoves for tags from the lol and flattens\nout the inner tags to be on the same level as the for\ntag was.\n\n## \\_lol\\_to\\_tree\n\nGenerates a tree from a Pod::LOL object.\nThe structure of the tree is based on the N (level) in \"=headN\".\n\nThis example pod:\n\n    =head1 FUNCTIONS\n\n    =Para  Description of Functions\n\n    =head2 Function1\n\n    =Para  Description of Function1\n\n    =head1 AUTHOR\n\n    =cut\n\nThis will be grouped as:\n\n    =head1 FUNCTIONS\n       =Para Description of Functions\n       =head2 Function1\n          =Para Description of Function1\n    =head1 AUTHOR\n\nIn summary:\n\n- Non \"head\" tags are always grouped \"below\".\n- HeadN tags with a higher N with also be grouped below.\n- HeadN tags with the same or lower N will be grouped higher.\n\n## \\_define\\_heads\\_regex\\_table\n\nGenerates the regexes for head elements inside\nand outside the current head.\n\n## \\_make\\_leaf\n\nCreates a new node (aka leaf).\n\n## \\_structure\\_over\n\nRestructures the text for an \"over-text\" element to be under it.\nAlso, \"item-text\" will be the first element of each group.\n\n## find\\_title\n\nExtracts the title information.\n\n## find\\_method\n\nExtracts the complete method information.\n\n## find\\_method\\_summary\n\nExtracts the method summary.\n\n## \\_clean\\_method\\_name\n\nReturns a method name without any possible parenthesis.\n\n## find\\_events\n\nExtracts a list of events with a description.\n\nReturns a list of key value pairs.\n\n## find\n\nGeneric extraction command.\n\nNote: This function is Scalar/List context sensitive!\n\n    $query-\u003efind($condition)\n\nWhere condtion is a string as described in [\"\\_query\\_string\\_to\\_struct\"](#_query_string_to_struct)\n\n    $query-\u003efind(@conditions)\n\nWhere each condition can contain:\n\n    {\n       tag       =\u003e \"TAG_NAME\",    # Find all matching tags.\n       text      =\u003e \"TEXT_NAME\",   # Find all matching texts.\n       keep      =\u003e 1,             # Capture the text.\n       keep_all  =\u003e 1,             # Capture entire section.\n       nth       =\u003e 0,             # Use only the nth match.\n       nth_in_group =\u003e 0,             # Use only the nth matching group.\n    }\n\nReturn contents of entire head section:\n\n    find (\n       {tag =\u003e \"head\", text =\u003e \"a\", keep_all =\u003e 1},\n    )\n\nResults:\n\n    [\n       \"  my \\$app = a('/hel...\",\n       {text =\u003e \"Create a route with ...\", wrap =\u003e 1},\n       \"  \\$ perl -Mojo -E ...\",\n    ]\n\n## \\_query\\_string\\_to\\_struct\n\nConvert a pod query string into a structure based on these rules:\n\n    1. Split string by '/'.\n       Each piece is a separate list of conditions.\n\n    2. Remove an optional '*' or '**' from the last condition.\n       Keep is set if we have '*'.\n       Keep all is set if we have '**'.\n\n    3. Remove an optional [N] from the last condition.\n       (Where N is a decimal).\n       Set nth base on 'N'.\n       Set nth_in_group if previous word is surrounded by ():\n          (WORD)[N]\n\n    4. Double and single quotes are removed from the ends (if matching).\n\n    5. Split each list of conditions by \"=\".\n       First word is the tag.\n       Second word is the text (if any).\n       If either starts with a tilde, then the word:\n          - is treated like a pattern.\n          - is case Insensitive.\n\n    Precedence:\n       If quoted and ~, left wins:\n       ~\"head1\" =\u003e qr/\"head\"/,\n       \"~head1\" =\u003e qr/head/,\n\n## \\_check\\_conditions\n\nCheck if queries are valid.\n\n## \\_set\\_condition\\_defaults\n\nAssigns default query options.\n\n## \\_find\n\nLower level find command.\n\n## \\_invert\n\nPrevious elements are inside of the child\n(due to the way the tree is created).\n\nThis method walks through each child and puts\nthe parent in its place.\n\n## \\_render\n\nTransforms a tree of found nodes in a simple list\nor a string depending on context.\n\nPod::Text formatter is used for `Para` tags when `keep_all` is set.\n\n## get\\_term\\_width\n\nDetermines, caches and returns the terminal width.\n\n### Error: Unable to get Terminal Size\n\nIf terminal width cannot be detected, 80 will be assumed.\n\n# SEE ALSO\n\n[App::Pod](https://metacpan.org/pod/App%3A%3APod)\n\n[Pod::LOL](https://metacpan.org/pod/Pod%3A%3ALOL)\n\n[Pod::Text](https://metacpan.org/pod/Pod%3A%3AText)\n\n# AUTHOR\n\nTim Potapov, `\u003ctim.potapov[AT]gmail.com\u003e`\n\n# BUGS\n\nPlease report any bugs or feature requests to [https://github.com/poti1/pod-query/issues](https://github.com/poti1/pod-query/issues).\n\n# CAVEAT\n\nNothing to report.\n\n# SUPPORT\n\nYou can find documentation for this module with the perldoc command.\n\n    perldoc Pod::Query\n\nYou can also look for information at:\n\n[https://metacpan.org/pod/Pod::Query](https://metacpan.org/pod/Pod::Query)\n[https://github.com/poti1/pod-query](https://github.com/poti1/pod-query)\n\n# ACKNOWLEDGEMENTS\n\nTBD\n\n# LICENSE AND COPYRIGHT\n\nThis software is Copyright (c) 2022 by Tim Potapov.\n\nThis is free software, licensed under:\n\n    The Artistic License 2.0 (GPL Compatible)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoti1%2Fpod-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoti1%2Fpod-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoti1%2Fpod-query/lists"}