b0VIM 9.0ªVØe’$˛ªügrizzlysmitpern~grizzlysmit/Projects/perl/perl6/doc-n-save/bin/doc-n-save.rakuutf-8
3210#"! UtpP
MI(RÅ7‘5√
S	a\3^6¡M[OP∑ad7èPÏ‰‘æΩ©VUJI65('	Û⁄ø®ãlG$
≥
h
5

ı÷’√ëÅoÙÛËìílkWV	‚
’
‘
Ç
E
D
9
8
+
*
„	ê	è	Ñ	É	/	∑∂µûãärq_X6UkèZ†f,Û∫ÄF≈x.⁄‘¨lfJ	”|v[B)‹±rJ›´} does not exist or i            } elsif "               } elsif "$docs/{$pod}.rakudoc".IO ~~ :f {            $pod1 = "$lib/{$pod}.rakudoc";        } elsif $lib.IO ~~ :d && "$lib/{$pod}.rakudoc".IO        } elsif "$docs/{$pod}.rakudoc".IO ~~ :f {            $pod1 = "$lib/{$pod}.rakudoc";        } elsif $lib.IO ~~ :d && "$lib/{$pod}.rakudoc".IO ~~ :f {            $pod1 = "$bin/{$pod}.raku";        } elsif $bin.IO ~~ :d && "$bin/{$pod}.raku".IO ~~ :f {            $pod1 = "$lib/{$pod}.rakumod";        if $lib.IO ~~ :d && "$lib/{$pod}.rakumod".IO ~~ :f {    if !@exts {    my Str:D $pod1 = '';    $pod ~~ s:g!'::'!/!;    my Str:D $pod = $name;    }        die "Error: {$markdown-path.IO.dirname} does not exist or is not a directory";    unless $markdown-path.IO.dirname.IO ~~ :d {    }        die "Error: $docs does not exist or is not a directory";    unless $docs  doc-n-save explicit <name> [<addi  doc-n-save expli  doc-n-save explicit <name> [<additional-pod-files> ...] [-l|--lib=<Str>] [-b|--bin=<Str>] [-e|--exts=<Str>] [-d|--docs=<Str>] [-m|--markdown-path=<Str>] [-o|--only-app] [--separate-markdown-files] [-c|--comment=<Str>]  doc-n-save prompt create config [<name>] [<additional-pod-files> ...] [-l|--lib=<Str>] [-b|--bin=<Str>] [-e|--exts=<Str>] [-d|--docs=<Str>] [-m|--markdown-path=<Str>] [-o|--only-app] [--separate-markdown-files] [-c|--comment=<Str>]  doc-n-save create config <name> [<additional-pod-files> ...] [-l|--lib=<Str>] [-b|--bin=<Str>] [-e|--exts=<Str>] [-d|--docs=<Str>] [-m|--markdown-path=<Str>] [-o|--only-app] [--separate-markdown-files] [-c|--comment=<Str>]  doc-n-save [-c|--comment=<Str>]Usage:doc-n-save --help=begin code :lang<bash>=head3 doc-n-save =head3 doc-n-save.raku=item1 L<release-d|#release-d> is a program to send a new release to B<zef> via B<fez> this one solves a bug in B<fez>.=item1 L<release|#release> is a program to send a new release to B<zef> via B<fez>.=end item1from a few simple arguments or make sure that an existing repository is complete. L<mk-raku-dirs|#mk-raku-dirs> either create a full skeleton repository=begin item1=end item1(files containing pod6 markup) and saving the result to git.L<doc-n-save|#doc-n-save-1> a program for generating Documentation from pod files=begin item1and do things like summit to zef etc. A collection of B<Raku> programs for managing modules and apps in B<Raku>,  =head1 IntroductionL<Top of Document|#table-of-contents>GPL V3.0+ L<LICENSE|https://github.com/grizzlysmit/App-Doc-N-Save/blob/main/LICENSE>=COPYRIGHT=SUBTITLE A collection of B<Raku> programs for managing modules and apps in B<Raku>, and do things like summit to zef etc.=TITLE Doc-N-Save=VERSION 0.1.14=AUTHOR Francis Grizzly Smit (grizzly@smit.id.au)=NAME Doc-N-Save =item2 L<release-d|#release-d>=item2 L<release|#release>=item2 L<mk-raku-dirs|#mk-raku-dirs>=item4 L<doc-n-save explicit|#doc-n-save-explicit>=item4 L<doc-n-save prompt create config|#doc-n-save-prompt-create-config>=item4 L<doc-n-save create config|#doc-n-save-create-config>=item4 L<doc-n-save|#doc-n-save-2>=item3 In detail=item2 L<doc-n-save|#doc-n-save-1>=item1 L<Introduction|#introduction>=item1 L<COPYRIGHT|#copyright>=item1 L<SUBTITLE|#subtitle>=item1 L<TITLE|#title>=item1 L<VERSION|#version>=item1 L<AUTHOR|#author>=item1 L<NAME|#name>=end head2Table of Contents=begin head2=head1 Doc-N-Save =begin pod#%*SUB-MAIN-OPTS<bundling>       = True;%*SUB-MAIN-OPTS¬´named-anywhere¬ª = True;my %*SUB-MAIN-OPTS;use Gzz::Text::Utils;use JSON::Fast;use v6;#!/usr/bin/env rakuad„
á$ﬁw‚
ª
•
Ñ
V
<

“ütS.ﬁ‘¬®â>-ı
œ
ô
Y
O

ˇ	¡	õ	ë		e	F		Ë¨zp^D%˚ è_ÕóÅvhN<Ó                     Str:D :c(:$comment) = 'using doc-n-save', *@additional-po                                       Str:D                                              S                     Str:D :c(:$comment) = 'using doc-                     Str:D :c(:$comment) = 'using doc-n-sa                     Str:D :c(:$comment) = 'using doc-n-save', *@additional-pod-files --                     Str:D :c(:$comment) = 'usin                     Str:D :c(:$comment) = 'using doc-n-sav                     Str:D :c(:$comment) = 'using                     Str:D :c(:$comment) =                     Str:D :c(:                     Str:D                                                 Str:D :c(:$comment) = 'using                      Str:D :c(:$comment) = 'using doc-n-save                     Str:D :c(:$comment) = 'using                      Str:D :c(:$comment) = '                     Str:D :c(:                     Str:D                                                 Str:D :c(:$commen                     Str:D :c(:$comment) = 'using doc-n-save',                                      Str:D :c(:$comment) = 'using doc-n-save',                                Str:D :c(:$comment) = 'using doc-n-save', *                     Str:D :c(:$comment) = 'using doc-                     Str:D :c(:$commen                     Str:D :c(:$comment) = 'using doc-n-                                      Str:D :c(:$comment) = 'using doc-n-save', *@                               Str:D :c(:                     Str:D                                                 Str:D :c(:$comment) = 'using doc-n-save                                         Str:D :c(:$comme                     Str:D :c(:$c                     Str:D :c(:$comment) =                      Str:D :c(:$comment) = 'using d                     Str:D :c(:$comment) = 'using doc-n-save', *@addition                     Str:D :c(:$c                     Str:D                     Str:D :c(:$comment) = 'us                     Str:D :c(:$c                     S                     Str:D :c(:$comment                     Str:D :c(:$c                                 Str:D :c(:$comment) = 'using doc-n-save', *@additional-pod-files --> Int:D) ¬ª¬ª¬ª                     Bool:D :o(:$only-app) is copy = False, Bool:D :$separate-markdown-files = False,                      Str:D :m(:$markdown-path) is copy = 'README.md',                     Str:D :e(:$exts) = 'rakumod:raku:rakudoc', Str:D :d(:$docs) is copy = 'docs',} #`¬´¬´¬´ multi sub MAIN('explicit', Str:D $name, Str:D :l(:$lib) is copy = 'rakulib', Str:D :b(:$bin) is copy = 'bin',ad$7”™Å_5”úw98-,∏
P
O
7
6
#

˙˘ÔÓ»«æΩÅXıÔ√âO›
¢
h
%
Á	ö	O	8	˙Ù†K;.         } elsif "$docs/{$pod}.rakudoc".        } elsif "$docs/{$pod}.rakudoc".IO ~~ :f {            $p              } elsif "$docs/{$pod        } elsif "$docs/{$pod}.rakudoc".IO ~~ :f {            $po              } elsif "$docs/{$pod}.rakudoc".IO ~    }        exit 1;    } else {        exit 0;                        $separate-markdown-files, $comment, @additional-pod-files) {    if make-n-save-docs($name, $lib, $bin, @exts, $docs, $markdown-path, $only-app,    }        $comment                       = ~%config¬´comment¬ª;    without $comment {    my Str:D  @additional-pod-files    = |%config¬´additional-pod-files¬ª;    my Bool:D $separate-markdown-files = %config¬´separate-markdown-files¬ª;    my Bool:D $only-app                = %config¬´only-app¬ª;    my Str:D  $markdown-path           = %config¬´markdown-path¬ª;    my Str:D  $docs                    = %config¬´docs¬ª;    my Str:D  @exts                    = |%config¬´exts¬ª;    my Str:D  $bin                     = %config¬´bin¬ª;    my Str:D  $lib                     = %config¬´lib¬ª;    my Str:D  $name                    = %config¬´name¬ª;    my %config                         = from-json $json;    my $json = ".doc-n-save.json".IO.slurp;    }        exit 1;        $*ERR.say: qq[Error: ".doc-n-save.json" doesn't exist, in this directory];    unless ".doc-n-save.json".IO ~~ :f {multi sub MAIN(Str :c(:$comment) is copy = Str --> Int:D) {=end podL<Top of Document|#table-of-contents>=end code  doc-n-save [-c|--comment=<Str>]Usage:doc-n-save  --help=begin code :lang<bash>the parameters to generate the docs and then save them to git i.e. commit and push to main/remote repo.With no arguments B<doc-n-save> looks for a file called B<.doc-n-save.json> and uses that to set=head3 doc-n-save=begin pod                     @additional-pod-files --> Bool:D) ¬ª¬ª¬ª                     Str:D $comment,                     Bool:D $separate-markdown-files,                      Bool:D $only-app is copy,                     Str:D $markdown-path is copy,                     Str:D $docs is copy,                     Str:D @exts,                     Str:D $bin is copy,                     Str:D $lib is copy,} #`¬´¬´¬´ sub make-n-save-docs(Str:D $name,ad
_
ùWç
ã
¯sÌ\;Á
í
Ç
u
e
_
^
	{	#	Ä	k	                                                                           $separate-markdown-files, $comm                                                         $separate-markdown-files, $comment, @additional-pod-files);     }        exit 1;    } else {        exit 0;                        $separate-markdown-files, $comment     }        exit 1;    } else {        exit 0;                        $separate-markdown-files, $comment, @additional-pod-files) {    if make-n-save-docs($name, $lib, $bin, @exts, $docs, $markdown-path, $only-app,    my @exts = $exts.split(':');                                                                                                && (%*ENV¬´DOC_N_SAVE_MARKDOWN-PATH¬ª.IO ~~ :d);    $markdown-path = %*ENV¬´DOC_N_SAVE_MARKDOWN-PATH¬ª if $markdown-path eq 'README.md' && (%*ENV¬´DOC_N_SAVE_MARKDOWN-PATH¬ª:exists)    $docs = %*ENV¬´DOC_N_SAVE_DOCS¬ª if $docs eq 'docs' && (%*ENV¬´DOC_N_SAVE_DOCS¬ª:exists) && (%*ENV¬´DOC_N_SAVE_DOCS¬ª.IO ~~ :d);    $exts = %*ENV¬´DOC_N_SAVE_EXT¬ª if $exts  eq 'rakumod:raku:rakudoc' && (%*ENV¬´DOC_N_SAVE_EXT¬ª:exists) && (%*ENV¬´DOC_N_SAVE_EXT¬ª.IO ~~ :d);    $bin = %*ENV¬´DOC_N_SAVE_BIN¬ª if $bin eq 'bin' && (%*ENV¬´DOC_N_SAVE_BIN¬ª:exists) && (%*ENV¬´DOC_N_SAVE_BIN¬ª.IO ~~ :d);    $lib = %*ENV¬´DOC_N_SAVE_LIB¬ª if $lib eq 'rakulib' && (%*ENV¬´DOC_N_SAVE_LIB¬ª:exists) && (%*ENV¬´DOC_N_SAVE_LIB¬ª.IO ~~ :d);                     Str:D :c(:$comment) = 'using doc-n-save', *@additional-pod-files --> Int:D) {                     Bool:D :o(:$only-app) is copy = False, Bool:D :$separate-markdown-files = False,                      Str:D :m(:$markdown-path) is copy = 'README.md',                     Str:D :e(:$exts) = 'rakumod:raku:rakudoc', Str:D :d(:$docs) is copy = 'docs',ad¥ò3òóåãdc›÷Ï
Î
·
‡
”
ü
í
ë


ı¶´ûù1Œ
Õ
¬
o
Ë	{	n	m	ÔèéÉä}| À øæòÇñxwQPGFÍ∞z:ºÄ8Ò∞è{9ŸπzZı≥í5ºó(:$lib) is copy = 'rakulib', Str:D :b(:    @candidates.push: %only-app-row;    my %only-app-row = type => 'Bool', name => 'only-app', value => $only-app;    @candidates.push: %markdown-path-row;    my %markdown-path-row = type => 'Str', name => 'markdown-path', value => $markdown-path;    @candidates.push: %docs-row;    my %docs-row = type => 'Str', name => 'docs', value => $docs;    @candidates.push: %exts-row;    my %exts-row = type => 'Array', name => 'exts', value => @exts;    @candidates.push: %bin-row;    my %bin-row = type => 'Str', name => 'bin', value => $bin;    @candidates.push: %lib-row;    my %lib-row = type => 'Str', name => 'lib', value => $lib;    @candidates.push: %name-row;    my %name-row = type => 'Str', name => 'name', value => $name;    my @candidates;    my @exts = $exts.split(':');                     *@additional-pod-files is copy --> Int:D) {                     Str:D :c(:$comment) is copy = 'using doc-n-save',                     Bool:D :$separate-markdown-files is copy = False,                      Bool:D :o(:$only-app) is copy = False,                     Str:D :m(:$markdown-path) is copy = 'README.md',                     Str:D :d(:$docs) is copy = 'docs',                   doc-n-save prompt create config doc-n-save mk-raku-di                     L<Top of Document|#table-of-contents>=end item4including nano seconds and timezone offset. (i.e. 2024-02-23T06:10:30.2387654+11:00)Where $comment is the comment you set, and $datetime is a full ISO 8601 timestamp notation,=begin item4=item3 B¬´do-n-save actually uses a date time and the comment field as the commit comment, (i.e. I<$comment $datetime>)¬ª.=item2 B¬´-c|--comment=<Str>¬ª           Set to a comment you want to use for the git commit defaults to B<using doc-n-save>.=end item2generally you don't want this, as B<raku.land> currently will not carry the docs directory etc.B¬´--separate-markdown-files¬ª           Set to true if you want each B<markdown> file to generate it's own B<markdown> file,=begin item2=item2 B¬´-o|--only-app¬ª                Set to true if this is a executable only package (i.e. no modules).=item2 B¬´-m|--markdown-path=<Str>¬ª     The path to the primary B<markdown> file by default B<README.md>, generally leave this alone.=item2 B¬´-d|--docs=<Str>¬ª              The name of the documentation directory. =end item2B<rakumod:raku:rakudoc> these are the standard extensions so you probably should leave this alone.B¬´-e|--exts=<Str>¬ª                     An array of extensions to look for separated by B<C<:>> by default=begin item2=item2 B¬´-b|--bin=<Str>¬ª               The name of the bin directory, for executables within the library.=item2 B¬´-l|--lib=<Str>¬ª               The name of the library directory by default rakulib with a symbolic link of lib to alias it to that.=item2 B<additional-pod-files...>      A list of zero or more other pod files.=end item3 B<NB: can be an application file (i.e. ending in I<.raku>), a Module (i.e. ending in I<.rakumod>) or a doc file (i.e. ending in I<.rakudoc>)>.=begin item3=item2 B<name> is the name of the primary pod file =item1 Where=end code  doc-n-save prompt create config [<name>] [<additional-pod-files> ...] [-l|--lib=<Str>] [-b|--bin=<Str>] [-e|--exts=<Str>] [-d|--docs=<Str>] [-m|--markdown-path=<Str>] [-o|--only-app] [--separate-markdown-files] [-c|--comment=<Str>]Usage:doc-n-save prompt create config --help=begin code :lang<sh>Build the B<.doc-n-save.json> file interactively using a menu system. =head3 doc-n-save prompt create config=begin pod                     Str:D :c(:$comment) = 'using doc-n-save', *@additional-pod-files --> Int:D) ¬ª¬ª¬ªadGo÷o                     Bool:D :o(:$only-app) is copy = False, Bool:D :$separate-markdown-files = False,                      Str:D :m(:$markdown-path) is copy = 'README.md',                     Str:D :e(:$exts) = 'rakumod:raku:rakudoc', Str:D :d(:$docs) is copy = 'docs',} #`¬´¬´¬´ multi sub MAIN('create', 'config', Str:D $name, Str:D :l(:$lib) is copy = 'rakulib', Str:D :b(:$bin) is copy = 'bin',adqR—üs>Ÿ©îÙ
„
Ω
p
ÙnF8 §}DÎ
≈
Ø
a
O
5
'


–	ñ	>		”¢xY?-#ÒµÉW8‹ûçNDŒ®p_ı€…øÉoJ#¯≈|U;
Ê–©Çq        } elsif "$docs/{$pod}.rakudoc".IO ~~ :f {            $pod1 = "$lib/{$pod}.rakudoc";        } elsif $lib.IO ~~ :d && "$lib/{$pod}.rakudoc".IO ~~ :f {            $pod1 = "$bin/{$pod}.raku";        } elsif $bin.IO ~~ :d    return True;    return False if $p7.exitcode != 0;    my Proc $p7 = run 'git', 'status';    "git status".say;    return False if $p6.exitcode != 0;    my Proc $p6 = run 'git', 'push', '--all';    "git push --all".say;    return False if $p5.exitcode != 0;    my Proc $p5 = run 'git', 'commit', '-a', '-m', "$comment $datetime";    qq[git commit -a -m "$comment $datetime"].say;    my Str:D $datetime = DateTime.now.Str;    return False if $p4.exitcode != 0;    my Proc $p4 = run 'git', 'pull';    "git pull".say;    } # for @additional-pod-files -> $additional-pod-file #        }            next;            'Failed'.say;        if $p3.exitcode != 0 {        }            $markdown-path.IO.spurt($markdown-content, :append);        } else {            $markdown-path.IO.spurt($markdown-content);        if $separate-markdown-files {        my $markdown-content = $p3.out.slurp: :close;        my Proc $p3 = run 'raku', '--doc=Markdown', $pod, :out;        }            "raku --doc=Markdown $pod  >> $markdown-path".say;        } else {            "raku --doc=Markdown $pod  > $markdown-path".say;        if $separate-markdown-files {        }            next;            'Failed'.say;        if $p2.exitcode != 0 {        $html-path.IO.spurt($html-content);        my $html-content = $p2.out.slurp: :close;        my Proc $p2 = run 'raku', '--doc=HTML', $pod, :out;        "raku --doc=HTML $pod  > $html-path".say;        }            next;            'Failed'.say;        if $p1.exitcode != 0 {        $man-path.IO.spurt($man-content);        my $man-content = $p1.out.slurp: :close;        my Proc $p1 = run 'raku', '--doc=Man', $pod, :out;        "raku --doc=Man $pod  > $man-path".say;        $markdown-path = "$docs/{$additional-pod-file}.md" if $separate-markdown-files;        $html-path = "$docs/{$additional-pod-file}.html";        $man-path = "$docs/{$additional-pod-file}.1";        $pod = $pod1;        }             }                die $msg;                }                    $msg ~= qq['$lib/{$pod}.$ext'$sep'$bin/{$pod}.$ext'$end];                    }                        $end = '!!!';                        $sep = ' nor ';                    if $ind == @exts.elems - 1 {                for @exts.kv -> Int:D $ind, Str:D $ext {                my Str:D $end = ",\n";                my Str:D $sep = ', ';                my Str:D $msg = "Error: pod file not found as any of:\n";            unless $pod1.IO ~~ :f {            }                last if $pod1.IO ~~ :f;                                                                                            !! "$docs/{$additional-pod-file}.$ext"));                                    !! (("$bin/{$additional-pod-file}.$ext".IO ~~ :f) ?? "$bin/{$additional-pod-file}.$ext"                $pod1 = (("$lib/{$pod}.$ext".IO ~~ :f) ?? "$lib/{$pod}.$ext"            for @exts -> Str:D $ext {        } else {            }                die qq[Error: pod file not found as '$lib/{$pod}.rakumod', '$bin/{$pod}.raku', '$lib/{$pod}.rakudoc' nor '$docs/{$pod}.rakudoc'];            } else {                $pod1 = "$docs/{$pod}.rakudoc";            } elsif "$docs/{$pod}.rakudoc".IO ~~ :f {                $pod1 = "$lib/{$pod}.rakudoc";            } elsif "$lib/{$pod}.rakudoc".IO ~~ :f {                $pod1 = "$bin/{$pod}.raku";            } elsif "$bin/{$pod}.raku".IO ~~ :f {                $pod1 = "$lib/{$pod}.rakumod";ad'Wﬂe≤W    ".doc-n-save.json".IO.spurt($json);    my Str:D $json = to-json %config, :spacing(4);                 only-app => $only-app, comment => $comment, additional-pod-files => @additional-pod-files;                 separate-markdown-files => $separate-markdown-files,     my %config = name => $name, lib => $lib, bin => $bin, exts => @exts, docs => $docs, markdown-path => $markdown-path,     my @exts = $exts.split(':');ad	á	ˇâ&‡yì

Å¸vÂ
Ω
}
w
[


‰	ç	á	    }        die "Error: {$markdown-path.IO.dirname} does not exist or is not a directory";    unless $markdown-path.IO.dirname.IO ~~ :d {    }        die "Error: $docs does not exist or is not a directory";    unless $docs.IO ~~ :d {    }        die "Error: $lib does not exist or is not a directory";    unless $only-app || $lib.IO ~~ :d {                                                                                                && (%*ENV¬´DOC_N_SAVE_MARKDOWN-PATH¬ª.IO ~~ :d);    $markdown-path = %*ENV¬´DOC_N_SAVE_MARKDOWN-PATH¬ª if $markdown-path eq 'README.md' && (%*ENV¬´DOC_N_SAVE_MARKDOWN-PATH¬ª:exists)    $docs = %*ENV¬´DOC_N_SAVE_DOCS¬ª if $docs eq 'docs' && (%*ENV¬´DOC_N_SAVE_DOCS¬ª:exists) && (%*ENV¬´DOC_N_SAVE_DOCS¬ª.IO ~~ :d);    $exts = %*ENV¬´DOC_N_SAVE_EXT¬ª if $exts  eq 'rakumod:raku:rakudoc' && (%*ENV¬´DOC_N_SAVE_EXT¬ª:exists) && (%*ENV¬´DOC_N_SAVE_EXT¬ª.IO ~~ :d);    $bin = %*ENV¬´DOC_N_SAVE_BIN¬ª if $bin eq 'bin' && (%*ENV¬´DOC_N_SAVE_BIN¬ª:exists) && (%*ENV¬´DOC_N_SAVE_BIN¬ª.IO ~~ :d);    $lib = %*ENV¬´DOC_N_SAVE_LIB¬ª if $lib eq 'rakulib' && (%*ENV¬´DOC_N_SAVE_LIB¬ª:exists) && (%*ENV¬´DOC_N_SAVE_LIB¬ª.IO ~~ :d);                     Str:D :c(:$comment) = 'using doc-n-save', *@additional-pod-files --> Int:D) {                     Bool:D :o(:$only-app) is copy = False, Bool:D :$separate-markdown-files = False,                      Str:D :m(:$markdown-path) is copy = 'README.md',                     Str:D :e(:$exts) = 'rakumod:raku:rakudoc', Str:D :d(:$docs) is copy = 'docs',multi sub MAIN('create', 'config', Str:D $name, Str:D :l(:$lib) is copy = 'rakulib', Str:D :b(:$bin) is copy = 'bin',ad≈}	(∫ób5‡æ¨èC˜
´
ô
ã
u
k
d
R
&
ˆ ìf@Î≥Ö]6ƒ
í
b
;

ﬁ	¡	≠	}	0		            if "$lib/{$pod}.rak            if "$lib/{$pod}.rakumod".IO ~~ :f {                                          if "$lib/{$pod}.rakumod".IO ~~ :f {        if !@exts {        $pod ~~ s:g!'::'!/!;        $pod = $additional-pod-file;    for @additional-pod-files -> $additional-pod-file {    return False if $p3.exitcode != 0;    $markdown-path.IO.spurt($markdown-content);    my $markdown-content = $p3.out.slurp: :close;    my Proc $p3 = run 'raku', '--doc=Markdown', $pod, :out;    "raku --doc=Markdown $pod  > $markdown-path".say;    return False if $p2.exitcode != 0;    $html-path.IO.spurt($html-content);    my $html-content = $p2.out.slurp: :close;    my Proc $p2 = run 'raku', '--doc=HTML', $pod, :out;    "raku --doc=HTML $pod  > $html-path".say;    return False if $p1.exitcode != 0;    $man-path.IO.spurt($man-content);    my $man-content = $p1.out.slurp: :close;    my Proc $p1 = run 'raku', '--doc=Man', $pod, :out;    "raku --doc=Man $pod  > $man-path".say;    my Str:D $html-path = "$docs/{$name}.html";    my Str:D $man-path = "$docs/{$name}.1";    $pod = $pod1;    }         }            die $msg;            }                }                    when 'rakudoc'  { $msg = qq['$docs/{$pod}.$ext'$sep]; }                    when 'rakumod'  { $msg = qq['$lib/{$pod}.$ext'$sep];  }                    when 'raku'     { $msg = qq['$bin/{$pod}.$ext'$sep];  }                given $ext {                }                    $sep = '!!!';                }elsif $ind == @exts.elems - 1 {                    $sep = ' nor ';                if $ind == @exts.elems - 2 {            for @exts.kv -> Int:D $ind, Str:D $ext {            my Str:D $sep = ',\n';            my Str:D $msg = "Error: pod file not found as any of:\n";adÒ›5‘”»«ß¶PO76#;:0/"Ó
·
‡
Q
P
D
ıf˙ÌÏÄæ
7
 	Ω	º	>	ﬁ›“TŸÃÀo
ÁÊ›≥≥==end podL<Top of Document|#table-of-con==end podL<Top of Document|#table-of-contents>=end item4including nano seconds and timezone offset. (i.e. 2024-02-23T06:10:30.2387654+11:00)Where $comment is the comment you set, and $datetime is a full ISO 8601 timestamp notation,=begin item4=item3 B¬´do-n-save actually uses a date time and the comment field as the commit comment, (i.e. I<$comment $datetime>)¬ª.=item2 B¬´-c|--comment=<Str>¬ª           Set to a comment you want to use for the git commit defaults to B<using doc-n-save>.=end item2generally you don't want this, as B<raku.land> currently will not carry the docs directory etc.B¬´--separate-markdown-files¬ª           Set to true if you want each B<markdown> file to generate it's own B<markdown> file,=begin item2=item2 B¬´-o|--only-app¬ª                Set to true if this is a executable only package (i.e. no modules).=item2 B¬´-m|--markdown-path=<Str>¬ª     The path to the primary B<markdown> file by default B<README.md>, generally leave this alone.=item2 B¬´-d|--docs=<Str>¬ª              The name of the documentation directory. =end item2B<rakumod:raku:rakudoc> these are the standard extensions so you probably should leave this alone.B¬´-e|--exts=<Str>¬ª                     An array of extensions to look for separated by B<C<:>> by default=begin item2=item2 B¬´-b|--bin=<Str>¬ª               The name of the bin directory, for executables within the library.=item2 B¬´-l|--lib=<Str>¬ª               The name of the library directory by default rakulib with a symbolic link of lib to alias it to that.=item2 B<additional-pod-files...>      A list of zero or more other pod files.=end item3 B<NB: can be an application file (i.e. ending in I<.raku>), a Module (i.e. ending in I<.rakumod>) or a doc file (i.e. ending in I<.rakudoc>)>.=begin item3=item2 B<name> is the name of the primary pod file =item1 Where=end code  doc-n-save create config <name> [<additional-pod-files> ...] [-l|--lib=<Str>] [-b|--bin=<Str>] [-e|--exts=<Str>] [-d|--docs=<Str>] [-m|--markdown-path=<Str>] [-o|--only-app] [--separate-markdown-files] [-c|--comment=<Str>]Usage:doc-n-save  --help=begin code :lang<raku>Generates the B<C<.doc-n-save.json>> from the supplied arguments and any Environment.=head3 doc-n-save create config=begin pod} #`¬´¬´¬´ multi sub MAIN(--> Int:D) ¬ª¬ª¬ªadsøMˇıÙ©®êÉÇœŒ√<—
–
√
¬
Z




˜ˆê54)(¯˜’¨Éa7’
û
y
@

Ÿ	”	∑	v	p	@	È„»ØñÜIﬂ∑uJÏ€KA4˘∏w6(ıÎøæ©®êèÖÑ^]TzSˆŸ≈ï            if "$lib/{$pod}.rakumod".IO ~~ :f {        if !@exts {        $pod ~~ s:g!'::'!/!;        $pod = $additional-pod-file;    for @additional-pod-files -> $additional-pod-file {    return False if $p3.exitcode != 0;    $markdown-path.IO.spurt($markdown-content);    my $markdown-content = $p3.out.slurp: :close;    my Proc $p3 = run 'raku', '--doc=Markdown', $pod, :out;    "raku --doc=Markdown $pod  > $markdown-path".say;    return False if $p2.exitcode != 0;    $html-path.IO.spurt($html-content);    my $html-content = $p2.out.slurp: :close;    my Proc $p2 = run 'raku', '--doc=HTML', $pod, :out;    "raku --doc=HTML $pod  > $html-path".say;    return False if $p1.exitco             i         if $pod1 eq '' || $pod1.IO ~~          if         if $pod1 eq '' |         if $pod1 eq '         if $pod1 eq '' || $pod1.IO ~~ :!f {        }            last if $pod1 ne '' && $pod1.IO ~~ :f;            }                when 'rakudoc'  { $pod1 = "$docs/{$pod}.$ext"; }                when 'rakumod'  { $pod1 = "$lib/{$pod}.$ext";  }                when 'raku'     { $pod1 = "$bin/{$pod}.$ext";  }            given $ext {        for @exts -> Str:D $ext {    } else {        }            die qq[Error: pod file not found as '$lib/{$pod}.rakumod', '$bin/{$name}.raku', '$lib/{$pod}.rakudoc' nor '$docs/{$name}.rakudoc'];        } else {            $pod1 = "$docs/{$pod}.rakudoc";        } elsif "$docs/{$pod}.rakudoc".IO ~~ :f {            $pod1 = "$lib/{$pod}.rakudoc";        } elsif $lib.IO ~~ :d && "$lib/{$pod}.rakudoc".IO ~~ :f {            $pod1 = "$bin/{$pod}.raku";        } elsif $bin.IO ~~ :d && "$bin/{$pod}.raku".IO ~~ :f {            $pod1 = "$lib/{$pod}.rakumod";        if $lib.IO ~~ :d && "$lib/{$pod}.rakumod".IO ~~ :f {    if !@exts {    my Str:D $pod1 = '';    $pod ~~ s:g!'::'!/!;    my Str:D $pod = $name;    }        die "Error: {$markdown-path.IO.dirname} does not exist or is not a directory";    unless $markdown-path.IO.dirname.IO ~~ :d {    }        die "Error: $docs does not exist or is not a directory";    unless $docs.IO ~~ :d {    }        die "Error: $lib does not exist or is not a directory";   unless $only-app || $lib.IO ~~ :d {                     @additional-pod-files --> Bool:D) {                     Str:D $comment,                     Bool:D $separate-markdown-files,                      Bool:D $only-app is copy,                     Str:D $markdown-path is copy,                     Str:D $docs is copy,                     Str:D @exts,                     Str:D $bin is copy,                     Str:D $lib is copy,sub make-n-save-docs(Str:D $name,=end podL<Top of Document|#table-of-contents>=end item2form but does the create docs and save them to git without saving the args like the other.The B<C<doc-n-save explicit>> form takes all the same arguments as the B<C<doc-n-save create config>>=begin item2=end item2input-menu that allows you to build the correct values a step at a time.B<C<doc-n-save prompt create config>> also creates a config file B<C<.doc-n-save.json>> but gives you a=begin item2=item2 the B<C<doc-n-save create config>> creates a B<C<.doc-n-save.json>> file for the first form to use.=item3 comment should be a string to override the comment in the B<C<.doc-n-save.json>> file or leave it out to leave that comment in.=end item2in the root directory of the project which is where you run doc-n-save from. The first form B<C<doc-n-save [-c|--comment=<Str>]>> expects a  B<C<.doc-n-save.json>> file to exist=begin item2=item1 Where (in brief)B<C<doc-n-save>> expects to be run from the root directory of the project.=end codead5ÅMÑP·m<˙
È
’
∑
å
`
V

Û„›—ôj0˙∫Ç<∏
q
+
*




«	∆	Æ	≠	ë	ä	Æ≠£¢ïaTSƒ√∑hŸm`_ÛêèÑ1™=0/±QPE«L?>‚çåÅû=end item4including nano seconds and timezone offset. (i.e. 2024-02-23T06:10:30.2387654+11:00)Where $comment is the comment you set, and $datetime is a full ISO 8601 timestamp notation,=begin item4=item3 B¬´do-n-save actually uses a date time and the comment field as the commit comment, (i.e. I<$comment $datetime>)¬ª.=item2 B¬´-c|--comment=<Str>¬ª           Set to a comment you want to use for the git commit defaults to B<using doc-n-save>.=end item2generally you don't want this, as B<raku.land> currently will not carry the docs directory etc.B¬´--separate-markdown-files¬ª           Set to true if you want each B<markdown> file to generate it's own B<markdown> file,=begin item2=item2 B¬´-o|--only-app¬ª                Set to true if this is a executable only package (i.e. no modules).=item2 B¬´-m|--markdown-path=<Str>¬ª     The path to the primary B<markdown> file by default B<README.md>, generally leave this alone.=item2 B¬´-d|--docs=<Str>¬ª              The name of the documentation directory. =end item2B<rakumod:raku:rakudoc> these are the standard extensions so you probably should leave this alone.B¬´-e|--exts=<Str>¬ª                     An array of extensions to look for separated by B<C<:>> by default=begin item2=item2 B¬´-b|--bin=<Str>¬ª               The name of the bin directory, for executables within the library.=item2 B¬´-l|--lib=<Str>¬ª               The name of the library directory by default rakulib with a symbolic link of lib to alias it to that.=item2 B<additional-pod-files...>      A list of zero or more other pod files.=end item3 B<NB: can be an application file (i.e. ending in I<.raku>), a Module (i.e. ending in I<.rakumod>) or a doc file (i.e. ending in I<.rakudoc>)>.=begin item3=item2 B<name> is the name of the primary pod file =item1 Where=end code  doc-n-save explicit <name> [<additional-pod-files> ...] [-l|--lib=<Str>] [-b|--bin=<Str>] [-e|--exts=<Str>] [-d|--docs=<Str>] [-m|--markdown-path=<Str>] [-o|--only-app] [--separate-markdown-files] [-c|--comment=<Str>]Usage:doc-n-save explicit  --help=begin code :lang<bash>Define the docs etc explicitly and then commit to git etc.=head3 doc-n-save explicit=begin pod                     *@additional-pod-files is copy --> Int:D) ¬ª¬ª¬ª                     Str:D :c(:$comment) is copy = 'using doc-n-save',                     Bool:D :$separate-markdown-files is copy = False,                      Bool:D :o(:$only-app) is copy = False,                     Str:D :m(:$markdown-path) is copy = 'README.md',                     Str:D :d(:$docs) is copy = 'docs',                     Str:D :e(:$exts) = 'rakumod:raku:rakudoc',                     Str:D :b(:$bin) is copy = 'bin',                     Str:D :l(:$lib) is copy = 'rakulib',                     Str $name is copy = Str, } #`¬´¬´¬´ multi sub MAIN('prompt', 'create', 'config',    exit 1;    }        exit 0;        ".doc-n-save.json".IO.spurt($json);        my Str:D $json = to-json %config, :spacing(4);        }            %config{$name} = %row¬´value¬ª;            my Str:D $name = %row¬´name¬ª;        for @result -> %row {        my %config;    if @result {    my @result = input-menu(@candidates, "Configure Doc-N-Save");    @candidates.push: %additional-pod-files-row;    my %additional-pod-files-row = type => 'Array', name => 'additional-pod-files', value => @additional-pod-files;    @candidates.push: %comment-row;    my %comment-row = type => 'Str', name => 'comment', value => $comment;    @candidates.push: %separate-markdown-files-row;    my %separate-markdown-files-row = type => 'Bool', name => 'separate-markdown-files', value => $separate-markdown-files;adtd6ˇÈËûùàhH(ˇﬂ∫öoIÊ
∆
q
P
O
E
D




Ê∑}GœâMæ
}
\
H

Â	¶	Ü	G	'	„¬Ä_ÿâd    @candidates.push: %only-app-row;    my %only-app-row = type => 'Bool', name => 'only-app', value => $only-app;    @candidates.push: %markdown-path-row;    my %markdown-path-row = type => 'Str', name => 'markdown-path', value => $markdown-path;    @candidates.push: %docs-row;    my %docs-row = type => 'Str', name => 'docs', value => $docs;    @candidates.push: %exts-row;    my %exts-row = type => 'Array', name => 'exts', value => @exts;    @candidates.push: %bin-row;    my %bin-row = type => 'Str', name => 'bin', value => $bin;    @candidates.push: %lib-row;    my %lib-row = type => 'Str', name => 'lib', value => $lib;    @candidates.push: %name-row;    my %name-row = type => 'Str', name => 'name', value => $name;    my @candidates;    my @exts = $exts.split(':');                     *@additional-pod-files is copy --> Int:D) {                     Str:D :c(:$comment) is copy = 'using doc-n-save',                     Bool:D :$separate-markdown-files is copy = False,                      Bool:D :o(:$only-app) is copy = False,                     Str:D :m(:$markdown-path) is copy = 'README.md',                     Str:D :d(:$docs) is copy = 'docs',                     Str:D :e(:$exts) = 'rakumod:raku:rakudoc',                     Str:D :b(:$bin) is copy = 'bin',                     Str:D :l(:$lib) is copy = 'rakulib',                     Str $name is copy = Str, multi sub MAIN('prompt', 'create', 'config',=end podL<Top of Document|#table-of-contents>=end codechoose a candidate 0..11 =:> ‚åºuse cancel, bye, bye bye, quit, q, or 11 to quit or enter to accept the values as is        11	OK > OK                     10	cancel > cancel              9	additional-pod-files > mk-raku-dirs, release, release-d         8	comment > using doc-n-save         7	separate-markdown-files > False         6	only-app > False             5	markdown-path > README.md         4	docs > docs                  3	exts > rakumod, raku, rakudoc         2	bin > bin                    1	lib > rakulib                0	name > doc-n-save   Configure Doc-N-Savedoc-n-save prompt create config doc-n-save mk-raku-dirs release release-d=begin code :lang<sh>ad0`ˇŸÿœŒ`multi sub MAIN('explicit', Str:D $name, Str:D :l(:$lib) is copy = 'rakulib', Str:D :b(:$bin) is copy = 'bin',=end podL<Top of Document|#table-of-contents>