From 2d7267cb4e612a9d5b835a1385d339946f7c95be Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 2 Jul 2018 01:15:00 -0500 Subject: [PATCH] Add file export to lua-api.md --- utils/scripts/lua-doc-parser.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/utils/scripts/lua-doc-parser.pl b/utils/scripts/lua-doc-parser.pl index 4a9e9862d..a5608944a 100644 --- a/utils/scripts/lua-doc-parser.pl +++ b/utils/scripts/lua-doc-parser.pl @@ -36,6 +36,10 @@ if($#ARGV < 0) { usage(); } +#::: Open File +my $filename = 'lua-api.md'; +open(my $fh, '>', $filename) or die "Could not open file '$filename' $!"; + my $export = $ARGV[0]; $export=~s/--//g; @@ -210,12 +214,24 @@ for my $file (@files) { } } + #::: Header + $header = $split_key; + $header =~s/:://g; + + print $fh "# " . $header . "\n"; + print $fh "```lua\n"; + @methods = sort @methods; foreach $method (@methods) { + print $fh $method; print $method; } + + print $fh "```\n\n"; } +close $fh; + #::: Trim Whitespaces sub trim { my $string = $_[0];