You can probably use foldexpr
to do this.
Here is a gist written by a person on the Internet. It defines a foldexpr
function for folding the POD
format.
I tried it on a random Perl script I found on this site (warning no https).
The foldexpr
seems to work okay. It might work well enough for your use case that you can tweak it.
On the example script I found it managed to hide most but not all of the POD
documentation.
+ +-- 11 lines: !/usr/local/bin/perl---------------------------------------------------------------------------------------------------
[--clearDb] [--writeToDb]
--path path --division name
--out name
+ +-- 2 lines: Examples:--------------------------------------------------------------------------------------------------------------
perl parseRefSeqGenomes.pl --help
perl parseRefSeqGenomes.pl --man
# Load all RefSeq data:
perl parseRefSeqGenomes.pl --clearDb --writeToDb
--path /data/genomes --division bct
--out bct.genomes.pep.fasta
+ +-- 82 lines: =head1 DESCRIPTION-----------------------------------------------------------------------------------------------------
+ +-- 16 lines: package main;----------------------------------------------------------------------------------------------------------
# Check arguments.
my( $help, $man, $clearDb, $writeToDb, $division, $path, $outFileName );
Getopt::Long::GetOptions(
'help' => \$help,
'man' => \$man,
'clearDb' => \$clearDb,
'writeToDb' => \$writeToDb,
'division=s' => \$division,
'path=s' => \$path,
'out=s' => \$outFileName );
# Check for requests for help or for man (full documentation):
Pod::Usage::pod2usage( -verbose => 1 ) if ( $help );
example.pl
dap
with a POD fold shouldnt delete the POD ? What do you mean by pod isnt for programmers (isnt it documentation? Did i misunderstand that?)?